How can I create a borderless OpenGL window that covers the whole screen? Currently I'm working in Vista but I would like it to work anywhere.
I have inherited from QGLWidget and gave it no parent so it would be a top level window. I'm currently drawing a fullscreen quad in my paintGL() function. Since Qt doesn't seem to have the ability to change the video mode, I do that using win32 function calls similar to here.
Part of the problem is, I would like this window to be on my second monitor in a dual-monitor setup, and I'll have other Qt windows on the first monitor.
I detect the geometry of the second monitor just fine using:
Code:
int j = 0; if (j != i) break; }
I then:
Code:
setGeometry(rect); updateGeometry();
Which seems to work, except I can see the border of the window on my primary monitor. Also, I can minimize and move the window on the second monitor, which I would like to prevent.
I have tried:
Code:
this->showFullscreen();
This leaves a black bar above my fullscreen quad that seems to be about the size of the title bar if the title bar was visible.
I have also tried:
Code:
setFixedSize(w, h); setWindowFlags(Qt::FramelessWindowHint);
which fails to create the QGLWidget because the QGLContext fails to create. Apparently you cannot create a frameless OpenGL widget?
I have also tried this->resize(w, h) and this->show() but none of these options seem to create what I want: a fullscreen, borderless/frameless, OpenGL window.
Anyone have any ideas? Thank you.