Skip to main content
gamedev.net
🔒 Locked

Direct Draw problem

Started by Peon 4 replies 700+ views
Original Post
Peon
Peon
I''m having a strange problem, and I assume it is because of Direct Draw. This is what happens: -The app (a sprite editor) I am making runs, sets the display to 320x200, and then allows a user to draw a sprite (not done with that last part yet, hehe ) Anyway, it runs fine most of the time but sometimes, it dumps me back into my editor in 320x200 mode without mouse control. I am forced to reboot and try and change my resolution to normal (a big problem because in 320 x 200 mode you can''t exactly desktop->right click-> set display mode because the resolution "changer" is cut off!) This has happened about 4 times, and each time I have NOT changed anything important. I can post code, but does anyone have a general idea of what''s happening? thanks, peon
Peon
FrigidHelix
FrigidHelix
This has happened to me a few times. I don''t think this is necessarily a problem in your application, since I have had games do this to me (even ones like DiabloII), so it could be something with your directX drivers. Looking thru your code wouldnt hurt tho.

When this happens to me, I do the following to change my display mode (usually it changes the color mode and resolution, which is really annoying).

Right click on desktop, go to properties.
You will only be able to see the top part of the dialog. Go to the settings tab. Use to right arrow key to increase the resolution. You should see the picture of the window increasing.(if it is not, try hitting tab and retrying). Press enter, and then accept the dialog that is displayed.

Now you can actually see something again.

Try adding some sort of log, so you can see where the problem occurs. When this happens to me, when I go to display settings, it crashes, saying that so and so dll failed.
Peon
Peon
Yeah, I fixed it a little earlier doing what you said (tab->right arrow->enter.) It''s just frustrating because it''s such a simple app, oh well
Peon
Peon
Peon
The mystery thickens... I just did a short test.

I ran my program from the VC++ editor. Within 5 runs of the same executable, I got the same error.

However...

I went to the folder where the executable was and ran it. 20 times. With NO problems!

Is there something about running in the editor I''m unaware of?
Peon
FrigidHelix
FrigidHelix
In response to your last question:
"Is there something about running in the editor I''m unaware of? "

Yes, there is. I presume by "running in the editor" you mean running a debug build (pressing F5), or perhaps doing (Cntrl F7). If you are running a debug build, and your DirectDraw application runs in fullscreen exclusive mode, some unexpected things can happen (or at least to me they do).

In full screen mode, GDI calls do not work, so the debugger has a tuff time communicating with the application. This could account for problems, perhaps the spontaneous exiting. The best way to find out, is run in debug mode, but make your direct draw run in windowed mode.

This way, if something bad does happen, you should be able to get more info from the debugger.

I remember I used to have this problem on one of my previous projects. I use pretty much the same code for initializing direct draw, but I don''t experience this anymore. Perhaps that is because I run my debug version in windowed mode.

Another possiblity could be that there is a non directdraw error occuring elsewhere in your code, that makes the debugger barf. For example, in one of my projects, it would exit spontaneously in debug mode, but it would run fine in release mode. It turned out that I was trying to delete a pointer which had not been initialized. In release mode it ran fine (it just deleted some random, and potentially dangerous portion of memory), and in debug mode it barfed, and quit.

Just some pointers, I know how very frustrating these sort of problems can be. Hehehe, I thought these mysterious and annoying as hell problems only happened to me!
Peon
Peon
Hehe, alright I''ll check into the things you mentioned. Thanks, I doubt I''d ever get it without your pointers
Peon

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.