Right, I can blt a BMP to the backbuffer, and then flip. This works just fine, but when I add another surface, and try to blt one after another, it doesn't work. The blt fails. Now, I don't have colorkey. Is this going to be an issue? Here is my code:
Code:#include "Unit1.h" #include <ddraw.h> #include "Mercury.h" extern LPDIRECTDRAW7 lpdd; //version 7.0 main extern MercuryEngine GameEngine; //Main GameEngine class BOB { public: int x,y; //x-y coords LPDIRECTDRAWSURFACE7 DDBOB; //DX BACK surface RECT src_rect; RECT dest_rect; BOB(); }; BOB::BOB() { //int bob! this->src_rect.left = 0; this->src_rect.top = 0; this->src_rect.right = 63; this->src_rect.left = 63; this->dest_rect.left = 100; this->dest_rect.top = 100; this->dest_rect.right = 100+63; this->dest_rect.left = 100+64; this->x = 100; this->y = 100; } ... BOB bob; ... if(FAILED(DDback->Blt(&dest_rect,DDback_sprite,&src_rect,DDBLT_WAIT, NULL))) { Application->MessageBoxA("Error","Boom",MB_OK); Application->Terminate(); } if(FAILED(DDback->Blt(&bob.dest_rect,bob.DDBOB,&bob.src_rect ,DDBLT_WAIT,NULL))) { Application->MessageBoxA("BOB don't like you!","Boom",MB_OK); Application->Terminate(); }
Its the second BLT that fails.
Also, if I put the LoadBitmap for BOB into the constructor of BOB, it get what seems to be an adress error.
Any ideas?
Cheers



LinkBack URL
About LinkBacks



