Making a 3d windowed application
In this tutorial we wil know how to declare correctly The main NemoX object and how to initialize them. Before reading that part of our tutorial series Make sure you have downloaded the NemoX engine Files and have correctly registered them.If not go to the previous tutorial.
1.Main Object Declaration and initialization
2.Game Loop Creation with a keyboard handler
NemoX engine provides classes that encapsulates important DirectX 8.1 methods such as Rendering function,Xfile,special Effects..ect.. We will learn in the futur tutorials how to use them.
For This tutorial We will use only One class NemoX class. This class allow to start en terminate all the engine.It's the Main engine components All ather components use NemoX class. So we have to Initialize it first and Deinitialize it after we free all other components that we use.
First thing the Declararion:
'The first thing
to do is to Declarate the Object that
For that step we will add a standart initialization sub for all the tutorial we will use.
We use this NemoX object function:
Function Initialize(HAND As Long, 'it's the handle of the main Form Optional DeviceType As NEMO_DEVICE_TYPE = NEMO_HAL_DEVICE, To use Acceleration Optional Windowed As Boolean = 1, 'we want to stay in Windowed mode Optional Wi = 640, 'if fullscreen the window width Optional HI = 480, 'if fullscreen the window height Optional BPP = 16, 'the depthbit for the zbuffer Optional TnL As Boolean = False, 'activate the Hardware lighting and transform device Optional VertSincOFF As Boolean = True, 'for the vertical refresh syncronization Optional GamaLevel = 1, 'the gama level Optional NumBUFFERS = 1 'the number of backbuffer to use) As Boolean
Now to launch the Demo we just have to add this in the Form_load sub:
Making a game loop is very easy We use a simple Do.....Loop statement with inside a Rendering part as shown in that piece of Vb code source
This is the end of the Tutorial #2 Fullcode source can be downloaded here..
If All code is okay the screen should look like in that shot bellow
See you in the next Tutorial.....sincerly Polaris..Don't forget Any Bugs
The Previous Tutorial 1 :Setting up the NemoX engine
The Next Tutorial 3 :Making a 3d Fullscreen application