Could somebody help me with the book Windows Game Programming for Dummies
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!
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
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))
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))
--- Official D Blog | Learning D | The One With D | D Bits
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement