Jump to content
  • Advertisement
Sign in to follow this  
floatingwoods

OpenGL Rendering overwrites foreign tooltips

This topic is 3173 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

Hello, I am wondering why my openGL rendering window is overwriting (occluding) foreign tooltips (from other applications, e.g. when ejecting a USB key for instance) and not my own tooltips. I am rendering some openGL content non-stop (for an animation) and the openGL window gets refreshed all the time. Is there a way I can avoid having other tooltips erased (or partially erased)? In current state it gives a rather unprofessional feeling when you see a tooltip flickering and fighting with the openGL window. Thanks

Share this post


Link to post
Share on other sites
Advertisement
This is either a driver issue, a window manager issue or an issue with your library that initializes the OpenGL context (SDL, Qt, ...). For my personal experience, the latter is the major 'culprit' of this problem, so you should start investigating into it.

Either way, this is not an OpenGL issue in the sense that no call beginning with gl may cause this issue, neither a gl call can stop or even attenuate it.

Share this post


Link to post
Share on other sites
Thanks for the reply vincoof,

The problem appears on all PC running my application, so I looked at how I initialize OpenGL, but couldn't put the finger on what is wrong. This is what I have to set-up OpenGL:


bool CMainWindow::setUpOpenGL()
{
static PIXELFORMATDESCRIPTOR pfd={sizeof(PIXELFORMATDESCRIPTOR),1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,24,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,
PFD_MAIN_PLANE,0,0,0,0};
hDC=::GetDC(m_hWnd);
if (hDC==NULL)
return(false);
GLuint PixelFormat=ChoosePixelFormat(hDC,&pfd);
if (PixelFormat==NULL)
return(false);
if(!SetPixelFormat(hDC,PixelFormat,&pfd))
return(false);
hRC=wglCreateContext(hDC);
if (hRC==NULL)
return(false);
if(!wglMakeCurrent(hDC,hRC))
return(false);
}



And this is how I handle display:


wglMakeCurrent(hDC,hRC);
render();
glFinish();
SwapBuffers(hDC);
wglMakeCurrent(NULL,NULL);



Might the problem be in how I create the window?

Share this post


Link to post
Share on other sites
It is not good to call glFinish()
http://www.opengl.org/wiki/Common_Mistakes#glFinish_and_glFlush

About the tooltip issue, I haven't seen this issue and I have an app that updates the screen. I just check on my Win Vista, nvidia Gf 8600 with slightly old drivers.

So like the previous guy said, your GL code is ok. Perhaps you can get rid of the wglMakeCurrent calls in your render loop to see if that makes a difference but most likely, it won't.

Share this post


Link to post
Share on other sites
Tested several times with a 3D application that I move under a spamming tooltip in the tray, and for every OpenGL window the result is 'bad' (strongly flickering) and Direct3D windows are fine. You can run the test with Google Earth which can be downloaded for free and has a an "OpenGL mode" and a "DirectX mode" (in fact Direct3D, of course). Tested on Windows XP with a GeForce 8800 GTX.

Unfortunately, I don't know of a neat and simple solution. I think you could get the regions of overlapping widgets and try not to draw in these regions, but this would be very tricky, if ever possible, and not even sure this would be enough.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!