Archived

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

WizzardUK

Tricks Of The Windows Game Programming Gurus Help

Recommended Posts

WizzardUK    122
Hi all, I bought the above book to help me get into game programming now that I have some time after finishing Uni. Everything was going great until I got to the displaying Bitmaps. I have compiled and linked the code and it runs, but only a black screen appears (ie no bitmap). I copied the example source code to check against mine, but the same result, finally I ran the pre compiler EXE on the CD and again just a black screen is displayed. According to the book I should be seeing an image. Also, other pre compiled EXE''s on the CD show only a blank screen, or the image is currupted. All the images load fine into Paint Shop Pro. If anyone has any ideas why these problems are occurring I would appreciate it if they could reply. Cheers Wizzard

Share this post


Link to post
Share on other sites
eco    122
Head over to http://www.xgames3d.com/ubbcgi/ultimatebb.cgi (Xtreme Games LLC Bulletin Board). It's Andre's personal forum and most questions can be answered there (sometimes by Andre himself).

Edited by - eco on February 6, 2002 6:39:47 PM

Share this post


Link to post
Share on other sites
zipless    122
"Oh no, not again"

Just do a search on this forum and it'll pop up a couple of threads about this, i think theres one on page 2 of the board as well cos it was only asked a day or 2 ago. If it's not there try the DX one instead.

Basically your getting a blank screen because windows is posting a WM_PAINT message after you draw the bitmap to the screen causing it to be overwritten. The quick fix is to take out the line in the windows class that makes the background grey or black or whatever it is, just set it to NULL. Now windows won't try to do anything when WM_PAINT is handled.

The answer to your next question (there'll probably be one for exercise 13) you need to change the bitmap loading section to increment the pointer by the lPitch and NOT the width as the code does, this'll clear the images up.


The problems are pretty easy to sort it's just a shame that they're smack bang in the middle of all the new bitmap stuff and your still trying to learn it. If you need a more in depth explanation post again and i'll help you out but have a look at the other threads first. i think they've got the book title in their subjects.

hope this helps
zipless

/* Ignorance is bliss, then you go and spoil it by learning stuff */

Edited by - zipless on February 6, 2002 7:36:09 PM

Share this post


Link to post
Share on other sites
WizzardUK    122
Thanks for the reply everyone.

zipless, I didnt see anyother posts about the book (OK,OK I didnt look :-) ) mainly because I thought it was just a problem with my code, not his.

I think I understood all you said so I will try it out. Don''t be suprised if you see "I tried it but now I''m stuck again!" as my next post!

parklife, I have a GeForce2.

and eco, ta for the link, I will head over there if the info zipless gave me doesnt work (although I''m sure it will!)

Thanks again yall
Wizzard

Share this post


Link to post
Share on other sites