Advertisement

More help with blitting

Started by October 14, 2000 12:33 PM
1 comment, last by OoMMMoO 24 years, 3 months ago
I had just got some help with blitting and everything was going good, untill I didnt want to blit random colors or make it blit fullscreen. I just want it to blit a certain color over and over and just in a small area here is some of my code.
    
//My color macro

#define RGB16(r,g,b) ((b%32)+((g%64)<<5)+((r%32)<<11))

int GameMain()
{

if (KEYDOWN(VK_ESCAPE))
   SendMessage(main_window_handle,WM_CLOSE,0,0);


RECT dest_rect;

memset(&ddbltfx, 0, sizeof(ddbltfx));
ddbltfx.dwSize = sizeof(ddbltfx);

ddbltfx.dwFillColor=RGB16(10,20,10);
dest_rect.left=0;
dest_rect.top=0;
dest_rect.right=5;
dest_rect.bottom=5;
lpddsback->Blt(&dest_rect,NULL,NULL,DDBLT_COLORFILL|DDBLT_WAIT,&ddbltfx);

while(FAILED(lpddsprimary->Flip(NULL,DDFLIP_WAIT)));
Sleep(300);

return(1);

} 
    
My program just keeps blitting random colors and fullscreen please help Brendon Glanzer
Nothing seems to be wrong with your code (nothing that I can see, that is). Maybe you should try rebuilding your project?
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
Advertisement
May be ,a old video card in your pc fight with directx7(or some one higher)
try to blt offsurface to PrimarySurface directly.

This topic is closed to new replies.

Advertisement