View unanswered posts | View active topics It is currently Fri Nov 28, 2014 1:16 pm



Reply to topic  [ 4 posts ] 
 Any Advice? 
Author Message

Joined: Tue May 24, 2005 7:01 am
Posts: 2
Location: Indiana
Post Any Advice?
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 DirectDraw.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!


Wed May 25, 2005 12:53 am
Profile

Joined: Mon Aug 18, 2003 7:01 am
Posts: 27
Post Any Advice?
It could be something with your compiler. Or a compiler setting.

I've seen comercial DirectDraw games not notice when they lost thier palette. I've seen it a few times in StarCraft. Either when tabbing out or another program like outlook bringing up a notification window. I've also seen it randomly. I can't tell you whats making it happen is your code, but are you watching for the device lost errors and recreating the device?

-Ed


Wed May 25, 2005 3:33 am
Profile

Joined: Tue May 24, 2005 7:01 am
Posts: 2
Location: Indiana
Post Any Advice?
I noticed that the WM_PALETTECHANGED message kept getting sent.

I tried to counter this by re-setting the palette to what I needed it to be after every such
message. However, whatever is responsible for sending it does it infinitely, so that it happens again about 3 secs after I change the palette to what it should be.

I have no idea what sends this message or how to stop it from affecting my palette.
This happens on 2 of my computers, which both have WindowsXP.


Wed May 25, 2005 8:41 pm
Profile

Joined: Tue Mar 09, 2004 8:01 am
Posts: 5
Location: South Carolina
Post Any Advice?
Why in the world would you want to use 256 colors on a nice, modern, Windows XP machine? That's just crazy.

I bet it has to do with that. DirectX Engineers probably don't test newer versions for such a thing, even though it should be backward-compatable. IDK, sounds crazy. Maybe something running in the background? Try starting it in safe mode. If it still works, it's probably some program in the background.


Wed Jun 01, 2005 3:28 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.