Advertisement Jump to content
Sign in to follow this  
aqrit

OpenGL crash on window focus loss [ Win7 ]

This topic is 1869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've got a OpenGL window that basically displays a bitmap.

The program never reads anything from the "screen".

 

It seems to "stop responding" (somewhere in nvidia's opengl stuff**), when another window manages to steal focus from my window.

 

I can reproduce this issue fairly reliably by popping up a [Warning this file came from the internet] box anywhere on screen.

 

Any thoughts?

 

 

I'm not sure that I've setup OpenGL correctly...

glViewport and glOrtho are set to the client window size

then I draw a GL_QUADS

with glTexCoord2i being either 0 or 1 and glVertex2i set to either 0 or screen_size(w/h)

 

** attached a debugger and looked at the stack

Originally a call to glFinish was on the stack

when I commented that out it was then a call to glTexSubImage2D on the stack

so is it waiting on that texture somehow?

edit:  or is it a coincidence that the debugger breaks in on opengl stuff

Edited by aqrit

Share this post


Link to post
Share on other sites
Advertisement

It is quite hard to find the problem from your explanation.

Post your code, so that we might see where the problem is.

Share this post


Link to post
Share on other sites

Okay, first of all let me tell you that my knowledge of DirectX is very limited.

Now when you posted your question about an OpenGL window, in the OpenGL forum, i assumed that the code you'd give was strictly OpenGL.

 

But the code you provided, at least for me, is confusing.

It seems you have DriectDraw (or something alike) code mixed with OpenGL, and that that project doesn't even produce an application, but a DLL?

 

Please note that i'm not trying to (nor want to) preach or be offensive, i'm just trying to understand your purpose so that i can help, so if you could explain a bit more about that DLL, and how it fits in your projet (if there's any, i mean it's intended usage) it be thankful.

 

In the mean time, have you checked if your problem isn't in the window's procedure?

I say this, because, since your problem occurs when the window loses focus, then it may be related to the way you handle the window's focus messages (this assuming you create the window yourself, and don't use a framework or something like that).

 

Another possibility could be when reaquiring video resources after the window lost focus, but i have to tell you, i've used OpenGL for a good while, and this never happened. The most i had to do was reload textures (and anything related to VRAM resources, like VBOs,etc), but the application never crashed...

 

One last thing, does the window stops responding only when another window has focus, or it happens every time your windowloses focus (like minimizing, cliking on the desktop, etc)?

 

Once again, i hope you don't take this the wrong way, just trying to be helpful.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!