Jump to content
  • Advertisement


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


TOTWGPG example doesnt work

This topic is 6377 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
Original post by tryforfulluse

maybe your just not smart enough

that was evil...


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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!