After a lot of troubleshooting and research I finally found what is happening.
The problem will only happen if you have a retina display system.

 You can find more information on the website below:

http://blog.qt.digia.com/blog/2013/04/25/retina-display-support-for-mac-os-ios-and-x11/

   The text below I copied from the website:

  OpenGL operates in device pixel space. For example, the width and height 
passed to glViewport should be in device pixels. QGLWidget::resizeGL() gives 
the width and height in device pixels.

However, QGLWidget::width() is really QWidget::width() which returns a value in 
device-independent pixels. Resolve it by multiplying with 
widget->windowHandle()->devicePixelRatio() if needed.

   Below the test I have done. The window starts with the problem but
if you resize it fixes it.

void GLWidget::resizeEvent( QResizeEvent* event )
{
    const QSize& size = event->size();
    const qreal retinaScale = devicePixelRatio();

    _gw->resized( x(), y(), size.width()*retinaScale, size.height()*retinaScale 
);
    _gw->getEventQueue()->windowResize( x(), y(), size.width(), size.height() );
    _gw->requestRedraw();

    _size = size;
}

  Anyway I will be looking if I can fix everything and I found a few more 
issues while troubleshooting this:

  - When you resize down the window it has a strange effect too.

  - Camera Manipulator does not work if you use QtCreator to create your 
MainWindow. It works fine in osgviewerQt example.

  I hope this can help and when I have a final solution I will post again.


Roni

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57797#57797





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to