Original Post
Alright, I have a pounding headache and need some serious help:
I have made a DX wrapper. In it is a function for blitting to the Primary surface- baasically this without the error checking:
CGraphics::XBlitToSurface( LPDIRECTDRAWSURFACE7 lpDDS, LPRECT rectSource, LPRECT rectDest )
{
hr = lpddsPrimary->Blt( rectDest, lpDDS, rectSource,
DDBLT_WAIT, NULL );
}
Everytime I run through, hr is INVAIDRECT.
When I run it with rectSource as NULL, the program runs through.
I call XBlitToSurface with my windows drawing routine. Here are the pertinant parts:
RECT destRect, srcRect;
LPDIRECTDRAWSURFACE7 LV, RV, TH, BH;
//This sets up all the surfaces
cGraphics.CreateOSSurface( sBorders.VWidth ,
sBorders.VLegnth, &LV );
//Assign destRect values....
srcRect.top = 0;
srcRect.left = 0;
srcRect.bottom = 100; //sBorders.VLegnth;
srcRect.right = 5; //sBorders.VWidth;
cGraphics.XBlitToSurface( LV, &srcRect, &destRect );
I have tried everything, making srcRect an LPRECT directly, createing a placebo RECT in the XBlit function, making sure the values were long, made sure nothing in the rect (including the address) change during execution.
Am I missing something? I alos made sure LV-the offscreen surface is valid. I dont lock the surface. Should I be doing that? I didn''t think you needed to to blit something.
Anyways, I am out of ideas.
Please help!!