Skip to main content
gamedev.net
🔒 Locked

blitting problem

Started by YoshiN 0 replies 150+ views
Original Post
YoshiN
YoshiN
Okay, I wrote a function that loads a bitmap onto an offscreen surface. I know that it is loading the bitmap (I tested the actual bitmap loading on the backbuffer, and it worked), however when I blit the offscreen surface to the backbuffer, nothing is displayed. Here is the code that is creating the offscreen surface (the surface image is a ref parameter for lpddstest):
  
        DDSURFACEDESC2 ddsd;	// ddraw surface description

	// clear the ddsd struct of garbage

	memset(&ddsd, 0, sizeof(ddsd));

	// fill in the description structure

	ddsd.dwSize = sizeof(ddsd);								// size of the struct

	ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;	// flags

	ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;			// surface is off screen

	ddsd.dwWidth = width;									// width of surface

	ddsd.dwHeight = height;									// height of surface

	
	// create the surface

	if(lpdd->CreateSurface(&ddsd, ℑ, NULL)!=DD_OK)
		return(0);
  
and then in the main game loop, I try to blit that surface to the backbuffer and then flip the backbuffer with the primary surface like so:
  
        // blit the test surface to the backbuffer

	if(lpddsback->Blt(&dest_rect, lpddstest, NULL,
           DDBLT_WAIT, NULL) != DD_OK)
		return(0);

	// flip the pages

	while(lpddsprimary->Flip(NULL, DDFLIP_WAIT)!=DD_OK);
  
The screen just remains blank. If anyone knows what the problem is, please help me out. -Yoshi XGXCX ''''99
-YoshiXGXCX ''99

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.