Archived

This topic is now archived and is closed to further replies.

TOTWGPG example doesnt work

This topic is 6159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

chapter 7, example12 i have a gf2 with win2000 and i get a blank screen, i tried it on a friends computer who has gf1 and win98 and he also got a blank screen, wtf?? here is the part of the code that displays the 24bit image: [soure] // lock the primary surface lpddsprimary->Lock(NULL,&ddsd, DDLOCK_SURFACEMEMORYPTR | DDLOCK_WAIT,NULL); // get video pointer to primary surfce DWORD *primary_buffer = (DWORD *)ddsd.lpSurface; // process each line and copy it into the primary buffer for (int index_y = 0; index_y < SCREEN_HEIGHT; index_y++) { for (int index_x = 0; index_x < SCREEN_WIDTH; index_x++) { // get BGR values UCHAR blue = (bitmap.buffer[index_y*SCREEN_WIDTH*3 + index_x*3 + 0]), green = (bitmap.buffer[index_y*SCREEN_WIDTH*3 + index_x*3 + 1]), red = (bitmap.buffer[index_y*SCREEN_WIDTH*3 + index_x*3 + 2]); // this builds a 32 bit color value in A.8.8.8 format (8-bit alpha mode) DWORD pixel = _RGB32BIT(0,red,green,blue); // write the pixel primary_buffer[index_x + (index_y*ddsd.lPitch >> 2)] = pixel; } // end for index_x } // end for index_y // now unlock the primary surface if (FAILED(lpddsprimary->Unlock(NULL))) return(0); [/source] and the one that displays the 8bit pic doesnt work either.

Share this post


Link to post
Share on other sites
quote:
Original post by tryforfulluse

maybe your just not smart enough


that was evil...
--


WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);


Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software

Share this post


Link to post
Share on other sites