I created what I thought was a simple program. I load a bitmap, turn it into an image, use the image to create a sprite. I rotate the sprite 45 degrees, then use getImage to try and paste it somewhere else having been rotated 45 degrees. Thing crashes though. here is the code:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSetDisplayMode(800,600,32);
dbSyncOn ( );
dbSyncRate ( 0 );
//You'll have to replace the line below with an image
//you have preferably 100 x 100 pixels.
dbLoadBitmap("100by100.bmp", 1);
dbGetImage(1,0,0,100,100);
dbSetCurrentBitmap(0);
dbSprite(1,100,100,1);
dbOffsetSprite(1,50,50);
dbRotateSprite(1,45);
dbGetImage(2,0,0,200,200);
dbPasteImage(2,200,200);
while ( LoopGDK ( ) )
{
dbPrint((double)dbMouseX());
dbPrint((double)dbMouseY());
if ( dbEscapeKey ( ) )
{
break;
}
dbSync ( );
}
for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );
dbDeleteImage ( 1 );
return;
}
Any help in solving this mystery would be great.
My end goal is simply to capture a picture from the screen and save it to a file using dbSaveImage.
Thank you