Posted: 5th Sep 2006 01:22
Hey everyone... DarkSDK newbie here, I am attempting to transform quickstart tutorial 1 from DBPro to DarkSDK, but can't get the right results to display on screen. When I run this code the original picture displays, but then nothing happens afterwards. What am I missing?
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncRate(60);
dbSyncOn();
dbBackdropOff();
dbLoadBitmap("media/800x600.jpg");
int x1 = 352;
int y1 = 16;
int x2 = 784;
int y2 = 384;
float tv = 0;
int spr = 2;
dbGetImage(1,0,0,800,600,0);
dbGetImage(2,x1,y1,x2,y2,0);
dbSprite(1,0,0,1);
dbSprite(2,x1,y1,2);
while (LoopGDK())
{
if (dbSpaceKey())
return;
tv = tv + 0.01;
dbSetSpriteTextureCoord(spr,0, 0.0, 0.0 + tv);
dbSetSpriteTextureCoord(spr,1, 1.0, 0.0 + tv);
dbSetSpriteTextureCoord(spr,2, 0.0, 1.0 + tv);
dbSetSpriteTextureCoord(spr,3, 1.0, 1.0 + tv);
if (dbUpKey())
spr = 2;
if (dbDownKey())
spr = 1;
dbSync();
}
}