gloperate icon indicating copy to clipboard operation
gloperate copied to clipboard

Viewport does not align with window boundaries

Open j-o opened this issue 8 years ago • 1 comments

For some reason, the screen area OpenGL draws into does not align with the window area. There is an offset of about [-11, 11] pixels (seen from the top left), hence the black borders on the top and right (I changed the clear color to red in ShapeDemo). OpenGLWindow::geometry() reports 0, 0, 1280, 720 relative to the main window (which is correct, in theory).

untitled-3

Using Qt 5.9.1 on Windows 10 x64 with Visual Studio 2017.

j-o avatar Aug 04 '17 11:08 j-o

Removing the explicit call to QWindow::create() from the constructor of OpenGLWindow and lazily initializing the context seems to fix this. This is the way it is demonstrated in the Qt OpenGLWindow example (http://doc.qt.io/qt-5/qtgui-openglwindow-example.html). What was the rationale for doing it differently?

j-o avatar Aug 04 '17 14:08 j-o