Commit Graph

12 Commits

Author SHA1 Message Date
Robert Osfield
bc5575f83a From Kristofer Tingdahl, "I and my team have gone over the code again, and we feel that we are comfortable in our current proposal for change. It goes deeper than it did before, and I explain why:
There was code in the osgViewer/Viewer.cpp and osgViewer/CompositeViewer.cpp that transformed the Y-coordinates of an event. The code in the composite viewer did however miss the touch-data of the event. I thought that it should really be the GUIEventAdapter that should know about this, and hence I added the
GUIEventAdapter::setMouseYOrientationAndUpdateCoords which is re-computing the coordinates. First I simply added a boolean to the setMouseYOrientation function:

setMouseYOrientation( MouseYOrientation, bool updatecooreds=false );

but then the serializer complained.

This function is called from both the Viewer and the CompositeViewer. We have not tested from the viewer, but I cannot see it would not work from visual inspection.

The other change is in MultiTouchTrackballManipulator::handleMultiTouchDrag. I have removed the normalisation. The reason for that is that it normalised into screen coordinates from 0,0 to 1,1. The problem with that is that if you have a pinch event and you keep the distance say 300 pixels between your fingers, these 300 pixels represent 0.20 of the screen in the horizontal domain, but 0.3 of the screen in the vertical domain. A rotation of the pinch-fingers will hence result in a zoom in, as the normalised distance is changing between them.

A consequence of this is that I have changed the pan-code to use the same algorithm as the middle-mouse-pan.

The rest of it is very similar from previous revision, and there has been some fine-tuning here and there.

"
2014-04-24 17:14:54 +00:00
Robert Osfield
5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00
Robert Osfield
6246cd5d85 From Roni Zanolli,Added use of Qt's new devicePixelRatio() method to assist with handling the upscalling of resolution on iPhone for "retina" displays.
From Robert Osfield, changed Roni's code to use a #define GETDEVICEPIXELRATIO to access the versioned Qt devicePixelRatio() method to avoid duplication of the Qt version checking.
2014-01-20 10:40:49 +00:00
Robert Osfield
bab56f9854 From Jan Ciger, compilation fix for Qt 5.0.2 2013-06-20 09:30:31 +00:00
Robert Osfield
bdfd18dc03 From Kristofer Tingdahl, with additions from Riccardo Corsi and Robert Milharcic, support for Qt5 build 2013-06-10 14:34:25 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
06f7fd4f48 From Marius Kintel, "GraphicsWindowQt::WindowData no longer requires the parent widget of a graphics window to be of type GLWidget." 2012-02-07 11:41:20 +00:00
Robert Osfield
64fa6aec43 From Robert Milharcic, "This will hopefully fix some issues with osgQt, more precisely with GLWidget event handling. There are at least two current GL context braking events, QEvent::Hide and QEvent::ParentChange. When running in a multithreaded mode they both try to change current GL context in a wrong thread (main GUI thread). The QEvent::ParentChange is also problematic when running in a single threaded model because Qt is going to release current contex then delete it, and then it will create new one, and as a result the osg will continue to render to an invalid deleted context. This changes workaround above problems by deferring execution of the problematic evens. These events has to be enqueued and executed later. The enqueued event processing is currently done right after swap in a swapBuffersImplementation of GraphicsWindowQt while code is running in a render thread by calling QGLWidget handler directly. In principle the deferred events queue should be executed while in GUI thread but I couldn't find any reliable way to do this, that is without risking a deadlock. For now it is assumed, Qt is not going to execute any GUI thread only operations inside the QGLWidget handler." 2011-09-13 11:09:39 +00:00
Robert Osfield
a287d85585 From Jan Peciva, I have improved GraphicsWindowQt:
- renamed osgQt::GraphWidget to osgQt::GLWidget
as it better fits to Qt naming (osgQt::GLWidget is derived from QGLWidget
while recent GraphWidget... it is unclear, maybe QGraphicsView,
QGraphicsScene,....)
- added the code to properly manage ON_DEMAND rendering scheme
(involves osgQt::setViewer() and internal HeartBeat class)
- added forward key events functionality. It allows to not eat the key events
by GLWidget, but it forwards them to Qt processing as well.
- destroying GLWidget before GraphicsWindowQt and vice versa does not crash
the application
- it is possible to request particular QGLFormat in GLWidget constructor
- added QtWindowingSystem class
- multithread OSG rendering improvements/fixes

--

From Robert Osfield, added back in getGraphWidget() method for backwards compatibility.
2011-05-16 09:06:06 +00:00
Robert Osfield
0875b19ab8 Fixed traling spaces 2011-05-16 08:59:10 +00:00
Robert Osfield
45c933daf2 Ran:
svn propset svn:eol-style native include/*/*
 svn propset svn:keywords "Author Date Id Revision" include/*/*
2011-01-31 11:40:35 +00:00
Robert Osfield
eb9510eb72 Moved GraphicsWindowQt from osgviewerQtContext into osgQt. 2010-12-13 16:25:50 +00:00