Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport does not align with window boundaries #393

Open
j-o opened this issue Aug 4, 2017 · 1 comment
Open

Viewport does not align with window boundaries #393

j-o opened this issue Aug 4, 2017 · 1 comment
Labels

Comments

@j-o
Copy link
Contributor

j-o commented Aug 4, 2017

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 j-o added the bug label Aug 4, 2017
@j-o
Copy link
Contributor Author

j-o commented Aug 4, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant