Alright, decided I wanted to start on another GDK project, but hit a couple problems right out the starting gate.
Here's the source code... very simple.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple 3D project that uses Dark GDK
// it can be used as a starting point in making your own 3D games
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// in this application we are going to create some 3D objects
// and position them on screen
// when starting a Dark GDK program it is useful to set global
// application properties, we begin by turning the sync rate on,
// this means we control when the screen is updated, we also set
// the maximum rate to 60 which means the maximum frame rate will
// be set at 60 frames per second
dbSyncOn ( );
dbSyncRate ( 75 );
// set our random seed to a value from the timer, this will help
// to ensure each time we run our program the random values appear
// more random
dbRandomize ( dbTimer ( ) );
// make a sample floor
dbLoadImage("media/2d/stairs1.dds",1);
int ct;
ct=0;
for (int i=0; i<10; i++) {
dbLoadObject("media/3d/stairs1.x",i);
dbTextureObject(i,1);
dbRotateObject(i,0,270,0);
dbPositionObject(i,0,0,0);
//ct++;
}
// move our camera back so we can view the objects
dbPositionCamera ( 0, 100, -200 );
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
while ( LoopGDK ( ) )
{
// display some text on screen
dbText ( 0, 0, "Use the up and down arrow keys to move the camera" );
dbText(0,15,dbStr(ct));
// move the camera forwards
if ( dbUpKey ( ) )
dbMoveCamera ( 1 );
// move the camera backwards
if ( dbDownKey ( ) )
dbMoveCamera ( -1 );
// here we make a call to update the contents of the screen
dbSync ( );
}
// and now everything is ready to return back to Windows
return;
}
Here are the problems:
1) Even though I initialize 10 objects the same way... only the first one actually gets rotated and textured. The others are unrotated and solid white (texturless)
2) I declare ct and initialize it with a value of 0... yet it's printed on screen as 7006.
Have I done something wrong here? Maybe something stupidly simple that I've overlooked?
[EDIT]
Attached a pic of what happens so you can see the problems better.
The one and only,