Sign in to follow this  
Alexander311

Any Advice?

Recommended Posts

I have encountered a strange problem, trying to create a DirectX game. I am working in a 640 by 480 8bit color mode with DirectX and simple 2-dimensional drawing using Direct Draw.I use a 256 color palette. When I run direct draw code that involves the Flip() function, sometimes all the colors displayed get changed. So all the bitmaps, bobs, and other graphics are displayed, but the colors are not what they are supposed to be. This happens at the start of the program and continues unless I re-initialize direct draw. Interestingly, this occurs only some of the time, so most of the time the program runs just fine. But sometimes, I turn it on and the colors are messed up. Also, I have noticed that when I access a bitmap or something and then run my game, this weird color changing effect has a much higher chance of occuring. I even tried not drawing any bitmaps and just having a black screen (fill the back_buffer with black). Still, the problem occurs. I get a light blue screen instead of black. I am running this code on a Windows XP machine. When I ran the same code on Windows 98 (before upgrading my machine to XP), this never occurred. I tried this executable on another Windows Xp machine and the problem still occured. Also, this doesn't happen for just my code. I tried Andre Lamothe's code (the alien prog11_6.cpp). My machine runs the executable provided on the Dummies CD fine. However, after I compile and link the code on my machine... the resulting executable has this weird colors problem. Thus, I think that creating Directx executables on a WindowsXP machine causes this strange problem to occur. Has anyone else encountered this problem? I upgraded to latest Directx SDK and the thing persists. I've been trying to figure this out for a week and to no avail!

Share this post


Link to post
Share on other sites
Are you running in fullscreen? If not, try that. Also try setting your desktop (right click desktop->properties->settings->color quality) to a lower color mode than 32-bit if it isn't already.

Just a guess...I had a similar problem a long time ago with DDraw and dropping the desktop color fixed it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this