Rendering overwrites foreign tooltips

Started by
3 comments, last by vincoof 14 years, 4 months ago
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
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.
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?
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.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
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.

This topic is closed to new replies.

Advertisement