Hi,
With DarkGDK do I need to turn something on in code to use the 2d drawing functions? I tried converting the starfeild tutorial to c++ and darkgdk but nothing is drawn.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include \"DarkGDK.h\"
#define MAXSTARS 200
#define SPEEDFACTOR .75
#define STARLAYERS 5
struct star
{
float x;
float y;
float z;
float speed;
DWORD color;
};
star stars[MAXSTARS];
// the main entry point for the application is this function
void DarkGDK ( void )
{
float temp_col = 0.0f;
for (int s=0; s< MAXSTARS; s++)
{
stars[s].x=dbRND(dbScreenWidth());
stars[s].y=dbRND(dbScreenHeight());
stars[s].z=int(s/(MAXSTARS/STARLAYERS))+1;
temp_col = (255/STARLAYERS)*stars[s].z;
stars[s].speed=stars[s].z*SPEEDFACTOR;
stars[s].color= dbRGB( 255, 255, 255 ); //set to this for testing
}
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
int sx=0;
// our main loop
while ( LoopGDK ( ) )
{
dbCLS(0);
for (int s=0; s < MAXSTARS; s++)
{
sx=stars[s].x;
dbDot(sx,stars[s].y,stars[s].color);
sx=sx-stars[s].speed;
if (sx < 0) sx = 800;
stars[s].x=sx;
}
// update the screen
dbSync ( );
}
// return back to windows
return;
}