🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Could somebody help me with the book Windows Game Programming for Dummies

Started by
2 comments, last by Chrono999 24 years, 3 months ago
Whoever has the book WGPfD, could you please help me with a problem I''m having in chapter 10. He writes example code which loads 16 bit pictures but they turn out all green. The 8 bit pictures turn out okay but I can''t load 8 bit without getting it green. If anyone else has had this problem or solved it please help me out!
Advertisement
you need to find out what pixel format your card 555 or 565 is look up DDPIXELFORMAT and GetPixelFormat, its in the directX help file.
"I have realised that maths can explain everything. How it can is unimportant, I want to know why." -Me
What do I do with it?
You also need to use a different macro to make your colors. Read up about DDPIXELFORMAT like Chris F. suggested. If it returns 15, use this macro:

RGB15BIT(r,g,b) ((b%32)+((g%32)<<5)+((r%32)<<10))

If it returns 16, use this one:
RGB16BIT (r,g,b) ((b%32)+((g%64)<<6)+((r%32)<<11))

This topic is closed to new replies.

Advertisement