Hi everyone, I´m doing a arena-style game and I want to draw the corpses and blood and stuff right on the background surface, so I dont need to redraw everything everytime.. I created a simple function to do this thru surface´s DC´s but it damn slow
if anyone have any other Idea(faster than this one) it would be greatly appreciated.
thanks, and here is my code:
if anyone have any other Idea(faster than this one) it would be greatly appreciated.
thanks, and here is my code:
- Code:
void RotateSample::DrawOnSurface(int destx, int desty,Surface* &dest, Surface* source)
{ dest->Unlock(false);
HDC HDC1;
HDC HDC2;
int sw = source->GetWidth();
int sh = source->GetHeight();
HDC1 = dest->GetDC(false);
HDC2 = source->GetDC(false);
TransparentImage(HDC1,destx,desty,sw,sh,HDC2,0,0,sw,sh, RGB(255,0,255));
dest->ReleaseDC(HDC1); //as you can imagine, here occurs the slow down, where the changes are made
source->ReleaseDC(HDC2);
}