Commit Graph

710 Commits

Author SHA1 Message Date
Robert Osfield
3b6c2b636a Renamed osgViewer::Config osgViewer::ViewConfig and moved it's declaration into include/osgViewer. 2013-05-16 10:11:06 +00:00
Robert Osfield
e3ed763c15 Added WoWVxDisplay view config 2013-05-16 09:08:27 +00:00
Robert Osfield
625821a91a Created a dedicated include/osgViewer/config and src/osgViewer/config directories to place all the Config classes. 2013-05-15 16:15:38 +00:00
Robert Osfield
9552567cd4 Added support for osgViewer::Config in osgViewer::Viewer command line parsing 2013-05-15 12:50:38 +00:00
Robert Osfield
bcbaaefa02 Introduced osgViewer::Config base class and beginnigs of various Config implementations.
Introduced osgViewer serializers plugin for serialization support for osgViewer::Config implementations and Keystone
2013-05-15 11:31:49 +00:00
Robert Osfield
01e8287b7d Fixed build for when automatic type conversion isn't enabled for ref_ptr<> 2013-05-13 11:02:40 +00:00
Robert Osfield
9249a59db2 Fixed the render order to the Render To Texture cameras used in stereo keystoning. 2013-05-13 09:53:54 +00:00
Robert Osfield
e9388d5ad8 Improved the use of the Keystone's defined in the DisplaySettings object. 2013-05-13 09:49:54 +00:00
Robert Osfield
4e34cadee2 Added to Viewer::realize() automatic setup using Keystone when available and enabled, and when no other window setup has been selected. 2013-05-13 09:18:37 +00:00
Robert Osfield
5dd07e4d1c Added keystone file handling 2013-05-10 16:06:10 +00:00
Robert Osfield
9c1c34d765 Moved Keystone support from osgkeystone example into osgViewer::View 2013-05-10 10:00:38 +00:00
Robert Osfield
e545627571 Moved Keystone class into osgViewer library. 2013-05-09 15:18:14 +00:00
Robert Osfield
668d351765 Introduced new scheme for handling mouse events with osgViewer. The new scheme enables robust event handling even when using distortion correction render to texture Cameras. 2013-05-03 19:26:27 +00:00
Robert Osfield
adea6c9329 Implemented stereo support into osgkeystone as a testbed for moving stereo support from SceneView into osgViewer 2013-04-18 09:47:28 +00:00
Robert Osfield
34a6b38983 Preperation for adding stereo support direclty into osgViewer. 2013-04-15 14:21:32 +00:00
Robert Osfield
796bced555 Fixed warning 2013-02-04 13:28:05 +00:00
Robert Osfield
bada884342 From Pjotr Svetachov, "when you restart threading
with startThreading/stopThreading the _drawQueue and _availableQueue
are not reset properly. This can lead to a deadlock when threading is
started again. So before threading is started again the queues must be
reset. This deadlock is also reported earlier by someone else in here:
http://forum.openscenegraph.org/viewtopic.php?p=43415#43415"
2013-01-23 17:38:28 +00:00
Robert Osfield
e5ce3489a2 From Mathias Froehlich, "Attached is a patch that includes the stereo cameras in
Renderer::*etCameraRequiresSetUp.

I am not sure if the getter needs to be changed, but this is currently
included for consistency."
2013-01-23 11:20:00 +00:00
Robert Osfield
e76e3a7b1b From Stephan Huber, "* osgGA: fixed a small bug regarding emulating mouse-events from touch-events
* resthttp/osc: encapsulate RequestHandler-classes in their own namespaces to prevent class-name-lookup-errors in the debugger/code (had some weird crashes)
* QTKit: fixed a compile-bug for gcc and blocks
* osgPresentation: click_to_* will fire on RELEASE, only if the drawable received a PUSH beforehand
* p3d/osgPresentation: implemented "forward_mouse_event_to_device"-tag, which will forward mouse-events to all registered devices of a viewer, if an intersection occurs. The mouse-coordinates get reprojected
* present3d: all devices get registered with the viewer
* osgViewer: only devices which are capable of receiving events are queried for new events.
* GraphicWindowIOS: added a flag to GraphicWindowIOS::WindowData to set up a retained backing buffer (defaults to false) This will enable read-back of the render-buffer with glReadPixels even after the renderbuffer got presented
* curl: added an optimized check for file-existance, now only the headers are requested and checked, instead of reading the whole file and handle it with a ReaderWriter
* p3d: fixed a bug, where the existence of a local file may prevent the remote loading of a file with the same name.

"
2013-01-07 12:17:26 +00:00
Robert Osfield
634f597feb From Juergen Rensen, "This is a fix for the latest SVN version (rev 13269). The ‘destroyFrameBuffer’ method in ‘GraphicsWindowIOS.mm’ had ‘glDeleteFramebuffersOES’ calls for the stencil buffer, MSAA render buffer and MSAA depth buffer instead of ‘glDeleteRenderbuffersOES’. The fix changes the mismatched calls to ‘glDeleteRenderbuffersOES’.
The impact of the bug was a memory leak that would affect multi-sampling iOS apps that allow for device rotation or window resizing in general. For our app, the leak ranged from ca. 10 MB to 40 MB per device rotation, depending on device, for the MSAA buffers. I have not been able to confirm impact for the stencil buffer. "
2012-12-18 09:49:01 +00:00
Robert Osfield
d200ef90a7 From Stephan Hunber, "* now you can create a transparent opengl-view (see GraphicWindowIOS::WindowData)
* changes of the view's bound are reported via osg's event-system more reliably

"
2012-12-14 16:31:07 +00:00
Robert Osfield
5a88734598 Moved the expansion of the key codes into ApplicationUsage so that help is only generated for non zero keycodes. 2012-12-05 10:13:51 +00:00
Robert Osfield
cbf6745da5 Added missing break; 2012-12-04 09:11:17 +00:00
Robert Osfield
e72af02c2b Added first step to adding pruning of expired image requests. 2012-11-13 11:45:20 +00:00
Robert Osfield
ad1cec1b2e From Stephan Huber, introduced syncornization of osgGA::Device 2012-11-13 11:20:36 +00:00
Robert Osfield
36f6ef7242 From Alexander Sinditskiy, "I found issue with capturing mouse buttons.
This issue can be reproduced:
1. Create osgViewer window,
2. Push right&left mouse buttons on the osgViewer window,
3. Move mouse out of window, and release right&left mouse buttons.

osgViewer window handle only first mouse release, as result window thinks that we did not released second mouse button.

I attached fix for this issue."
2012-11-08 17:19:51 +00:00
Robert Osfield
1591fe09f3 Added osgGA::Device class for integration of both physical and virtual devices.
Added template readFile(..) function to make it more convinient to cast to a specific object type.

Added support for osgGA::Device to osgViewer.

Added sdl plugin to provides very basic joystick osgGA::Device integration.
2012-10-23 16:15:03 +00:00
Robert Osfield
0dbafcc316 From Leigh Stivers, "We had this problem which shows up with nVidia's latest Quadro driver, 305.93 - and older drivers when the nVidia's setting "Thread Optimization" was turned on, running Windows 7. The symptom, is that after creating a first view and using it, and then creating a second view, the first view will never render anything but black.
What happens is this:
A view is created, and then the viewers thread is created and runs.
The setReleaseContextAtEndOfFrameHint is true.
To create a second view, the viewer is setDone(true), and we wait for the thread exit.

At this point, inside the ViewerBase::RenderingTraversals code, there are places where it reads "if(_done) return;"

The problem, is that it won't reach the code that will releaseContext().

Apparently, this driver won't let any other thread to makeCurrent(), if another thread (dead or not) has ownership.  So when the Viewers is re-started, the first view won't be able to use the gc.

The change attached (against rev 13153) corrects this."
2012-09-28 16:36:42 +00:00
Robert Osfield
4896edda56 From Thomas Hogarth, "Apple have decided in their eternal wisdom to do away with separate depth and stencil buffers on iOS from version 5 and above.
Attached are changes to GraphicsWindowIOS.mm to support setting up the new buffer type when compiling for iOS5,
also attached is a small change to FrameBufferObject.cpp to report support for packed depth stencil via the
GL_OES_packed_depth_stencil extension.

For anyone reading this you can attach a packed depth stencil to your FBO like so

_rttCamera->attach( osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, GL_DEPTH24_STENCIL8_EXT );

Luckily GL_DEPTH24_STENCIL8_EXT happens to have the same value as iOSs GL_DEPTH24_STENCIL8_OES"
2012-09-27 08:34:56 +00:00
Robert Osfield
d511288718 From Ulrich Hertlein, "attached is a patch to src/osgViewer/CMakeLists.txt that inverts the logic of when to use
Cocoa and when to use the old Carbon interface for the windowing system.

The old code had to be modified for every new OS X release to default to Cocoa.
The new code uses Carbon for <= OS X 10.4 and Cocoa on everything else."
2012-09-20 11:16:02 +00:00
Robert Osfield
55d03d5b34 Added setting of the input range of the event state based on the master cameras viewport. 2012-09-07 09:31:26 +00:00
Robert Osfield
39dcea9ebb From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues. 2012-09-05 21:03:41 +00:00
Robert Osfield
f5a3c40934 Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization. 2012-09-05 13:48:23 +00:00
Robert Osfield
58b66be7b7 Added check against the Camera NodeMask to decide whether it's appropriate to test for events on that camera. 2012-08-21 09:45:24 +00:00
Robert Osfield
4b220d4fd7 Changed updateCamera(Camera*) to updateCamera(Camera&) to make it clear that a valid Camera object should be passed in. 2012-07-09 17:49:04 +00:00
Robert Osfield
65ab874143 From Riccardo Corsi, introduced CameraManipulator::updateCamera() method that allows more Camera properties to be controlled by the CameraManipulator. 2012-07-09 17:32:13 +00:00
Robert Osfield
f784884fd1 Refactored the way that the static Scene cache is managed by moving all the functionality into a SceneSingleton 2012-06-25 16:31:36 +00:00
Robert Osfield
59133b43d3 Moved the frame() event into the event traversal after then events and their state have been accumulated. 2012-06-15 09:04:32 +00:00
Robert Osfield
5fc6f0a796 As per Ulrich Hertlrein's suggestion, changed APPLE_PLATFORM_SDK_CANONICAL_NAME to OSG_OSX_SDK_NAME. 2012-03-23 10:21:51 +00:00
Robert Osfield
c2ae14f94d From Erik den Dekker, "
IF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.7.sdk")
...

            ELSEIF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.5.sdk" OR ${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.6.sdk")

...

ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
...

            ELSE()

...

            ENDIF()


Which is fragile because XCode could be installed into another directory than /Developer. (In case XCode is not installed into the /Developer directory CMake can automatically resolve the path via command line utility ${CMAKE_XCODE_SELECT} --print-path)

This issue bites me currently because the latest XCode (Version 4.3.1 - 4E1019) installed through the Mac App Store is per default installed in "/Applications/Xcode.app/Contents/Developer" and hence the 10.7 SDK in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"

Searching the web to find the proper way to determine the version of the Platform SDK programmatically, I found no standard way. I came up with 2 options myself:

1) Parse the path string to extract the version number

2) Read a value from the SDKSettings.plist found in the root of each SDK  (e.g., "defaults read ${CMAKE_OSX_ROOT}/SDKSettings.plist CanonicalName" gives "macosx10.7")

I implemented the last option and verified that at least the following Mac OS SDKs (10.3.9, 10.4, 10.5, 10.6, 10.7) support this method. It also looks reasonably future proof. An additional benefit of this method is that it also seems to be compatible with iOS and iOS Simulator SDKs (at least for version 5.1, but I assume this also applies to older versions). This is interesting because the CMake infrastructure to build OSG for iOS currently still contains similar hard-coded paths and even requires you to manually change the cmake file to build for another iOS SDK version. In the near future I hope to address these issues, but I haven't been able to try this yet."
2012-03-23 10:18:27 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
f551c3dcec From David Callu, "just a typo fix that break the compilation under windows" 2012-03-21 14:08:07 +00:00
Robert Osfield
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +00:00
Robert Osfield
2f2908b7eb Removed inappropriate warning 2012-03-20 12:01:02 +00:00
Robert Osfield
7977b31577 Moved static initializers into global scope to prevent problems with using exit(). 2012-03-12 14:22:48 +00:00
Robert Osfield
71893c46e5 From Olaf Flebbe, "Appended now a bugfixed proposition for the Win7 Multitouch Support.
Now examples/osgmultitouch really works ;-)

Based on yesterdays trunk.

* It should now work with all Visual Studio Versions.
* WIN_VER is left as-is
* I added the missing declarations from a recent SDK, if not supplied by the SDK
* If someone chooses to update WIN_VER, the declarations should not break.
* All API Calls are runtime detected.
* No CMake Variable, Support is enabled automatically ."
2012-03-07 09:32:38 +00:00
Robert Osfield
11c9ec4f7d From Thomas Hogarth, build fix for IOS build 2012-02-28 10:21:21 +00:00
Robert Osfield
da44e4f4b6 From Paul Martz, "The attached fixes a few issues that are present when ref_ptr implicit casting is disabled." 2012-02-21 17:20:58 +00:00
Robert Osfield
0b88ad24b2 From Olaf Flebbe, "Macos X cleanup:
I added AFAIK proper defaults for several Macos X Version API targets.

* In order to determine which defaults to apply, consult the  CMAKE_OSX_SYSROOT variable pointing to the used SDK, not the pure existence of an SDK.

* Defaults are now:
10.7: Support Intel 32 and 64 Bit Cocoa with imageio picture reader
10.6 + 10.5: Support Cocoa with imageio on Intel and PowerPC
10.4: Carbon, Quicktime and PowerPC

Now OSG compiles out of the box for MacOSX  10.7. , tested with gcc and clang with FlightGear."
2012-02-21 11:30:07 +00:00
Robert Osfield
041dd7a871 From Riccardo Corsi, Added passing of EventVisitor pointer to event handlers. 2012-02-20 12:18:50 +00:00