diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index f4c6ca4cf..98654e1fb 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -311,8 +311,7 @@ void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name) if (dev.valid()) { OSG_INFO << "Adding Device : " << device_name << std::endl; - if (dev->getCapabilities() & osgGA::Device::RECEIVE_EVENTS) - viewer.addDevice(dev.get()); + viewer.addDevice(dev.get()); if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS) viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get())); diff --git a/include/osgPresentation/PickEventHandler b/include/osgPresentation/PickEventHandler index c65d51d43..32031be83 100644 --- a/include/osgPresentation/PickEventHandler +++ b/include/osgPresentation/PickEventHandler @@ -56,6 +56,8 @@ class OSGPRESENTATION_EXPORT PickEventHandler : public osgGA::GUIEventHandler osgPresentation::Operation _operation; JumpData _jumpData; + std::set _drawablesOnPush; + }; } diff --git a/include/osgPresentation/SlideEventHandler b/include/osgPresentation/SlideEventHandler index 4d6ab3a2b..802b0dd13 100644 --- a/include/osgPresentation/SlideEventHandler +++ b/include/osgPresentation/SlideEventHandler @@ -36,7 +36,8 @@ enum Operation RUN, LOAD, EVENT, - JUMP + JUMP, + FORWARD_EVENT }; struct JumpData diff --git a/include/osgViewer/api/IOS/GraphicsWindowIOS b/include/osgViewer/api/IOS/GraphicsWindowIOS index 335fa7b5b..a02a7e13a 100644 --- a/include/osgViewer/api/IOS/GraphicsWindowIOS +++ b/include/osgViewer/api/IOS/GraphicsWindowIOS @@ -149,7 +149,8 @@ class GraphicsWindowIOS : public osgViewer::GraphicsWindow : _windowOrView(window_or_view), _deviceOrientationFlags(orientationFlags), _viewContentScaleFactor(scaleFactor), - _createTransparentView(false) + _createTransparentView(false), + _useRetainedBacking(false) { } @@ -161,12 +162,17 @@ class GraphicsWindowIOS : public osgViewer::GraphicsWindow bool getCreateTransparentView() { return _createTransparentView; } void setCreateTransparentView(bool b) { _createTransparentView = b; } + + bool getUseRetainedBacking() { return _useRetainedBacking; } + void setUseRetainedBacking(bool b) { _useRetainedBacking = b; } + private: UIView* _windowOrView; DeviceOrientationFlags _deviceOrientationFlags; float _viewContentScaleFactor; bool _createTransparentView; + bool _useRetainedBacking; friend class GraphicsWindowIOS; diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index abcffb577..6d0178a23 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -1794,7 +1794,7 @@ ReaderWriter* Registry::getReaderWriterForProtocolAndExtension(const std::string { // try first the registered ReaderWriter ReaderWriter* result = getReaderWriterForExtension(extension); - if (result->acceptsProtocol(protocol)) + if (result && result->acceptsProtocol(protocol)) return result; result = NULL; diff --git a/src/osgGA/EventQueue.cpp b/src/osgGA/EventQueue.cpp index 557bd5fa3..f1bdba123 100644 --- a/src/osgGA/EventQueue.cpp +++ b/src/osgGA/EventQueue.cpp @@ -409,7 +409,7 @@ GUIEventAdapter* EventQueue::touchBegan(unsigned int id, GUIEventAdapter::Touch { // emulate left mouse button press - _accumulateEventState->setButtonMask((1) | _accumulateEventState->getButtonMask()); + _accumulateEventState->setButtonMask(GUIEventAdapter::LEFT_MOUSE_BUTTON | _accumulateEventState->getButtonMask()); _accumulateEventState->setX(x); _accumulateEventState->setY(y); } @@ -418,7 +418,9 @@ GUIEventAdapter* EventQueue::touchBegan(unsigned int id, GUIEventAdapter::Touch event->setEventType(GUIEventAdapter::PUSH); event->setTime(time); event->addTouchPoint(id, phase, x, y, 0); - + if(_firstTouchEmulatesMouse) + event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON); + addEvent(event); return event; @@ -446,7 +448,7 @@ GUIEventAdapter* EventQueue::touchEnded(unsigned int id, GUIEventAdapter::Touch { if (_firstTouchEmulatesMouse) { - _accumulateEventState->setButtonMask(~(1) & _accumulateEventState->getButtonMask()); + _accumulateEventState->setButtonMask(~GUIEventAdapter::LEFT_MOUSE_BUTTON & _accumulateEventState->getButtonMask()); _accumulateEventState->setX(x); _accumulateEventState->setY(y); } @@ -455,6 +457,9 @@ GUIEventAdapter* EventQueue::touchEnded(unsigned int id, GUIEventAdapter::Touch event->setEventType(GUIEventAdapter::RELEASE); event->setTime(time); event->addTouchPoint(id, phase, x, y, tap_count); + if(_firstTouchEmulatesMouse) + event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON); + addEvent(event); return event; diff --git a/src/osgPlugins/QTKit/OSXQTKitVideo.mm b/src/osgPlugins/QTKit/OSXQTKitVideo.mm index 6ce03ce1e..c1b8da16a 100644 --- a/src/osgPlugins/QTKit/OSXQTKitVideo.mm +++ b/src/osgPlugins/QTKit/OSXQTKitVideo.mm @@ -99,9 +99,19 @@ void OSXQTKitVideo::initializeQTKit() if (![NSThread isMainThread]) { dispatch_apply(1, dispatch_get_main_queue(), ^(size_t n) { EnterMovies(); - QTMovie* movie = [QTMovie movie]; - // release missing by intent, gets released by the block! - movie = NULL; + { + // workaround for gcc bug. See discussion here + // http://stackoverflow.com/questions/6525928/objective-c-block-vs-objective-c-block + + #if (GCC_VERSION <= 40201) && !(__clang__) + QTMovie* ::temp_movie = [QTMovie movie]; + #else + QTMovie* temp_movie = [QTMovie movie]; + #endif + + // release missing by intent, gets released by the block! + temp_movie = NULL; + } }); } else diff --git a/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp b/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp index c4bf58632..7e556479b 100755 --- a/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp +++ b/src/osgPlugins/RestHttpDevice/RestHttpDevice.cpp @@ -17,6 +17,7 @@ #include #include "request_handler.hpp" +namespace RestHttp { class StandardRequestHandler : public RestHttpDevice::RequestHandler { @@ -254,6 +255,7 @@ bool RequestHandlerDispatcherCallback::operator()(const std::string& request_pat return _parent->handleRequest(request_path, reply); } +} RestHttpDevice::RestHttpDevice(const std::string& listening_address, const std::string& listening_port, const std::string& doc_root) : osgGA::Device() @@ -274,20 +276,20 @@ RestHttpDevice::RestHttpDevice(const std::string& listening_address, const std:: { OSG_WARN << "RestHttpDevice :: warning, can't locate document-root '" << doc_root << "'for the http-server, starting anyway" << std::endl; } - _server.setCallback(new RequestHandlerDispatcherCallback(this)); + _server.setCallback(new RestHttp::RequestHandlerDispatcherCallback(this)); - addRequestHandler(new KeyCodeRequestHandler(false)); - addRequestHandler(new KeyCodeRequestHandler(true)); + addRequestHandler(new RestHttp::KeyCodeRequestHandler(false)); + addRequestHandler(new RestHttp::KeyCodeRequestHandler(true)); - addRequestHandler(new SetMouseInputRangeRequestHandler()); - addRequestHandler(new MouseMotionRequestHandler()); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::PRESS)); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::RELEASE)); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::DOUBLE_PRESS)); + addRequestHandler(new RestHttp::SetMouseInputRangeRequestHandler()); + addRequestHandler(new RestHttp::MouseMotionRequestHandler()); + addRequestHandler(new RestHttp::MouseButtonRequestHandler(RestHttp::MouseButtonRequestHandler::PRESS)); + addRequestHandler(new RestHttp::MouseButtonRequestHandler(RestHttp::MouseButtonRequestHandler::RELEASE)); + addRequestHandler(new RestHttp::MouseButtonRequestHandler(RestHttp::MouseButtonRequestHandler::DOUBLE_PRESS)); - addRequestHandler(new HomeRequestHandler()); + addRequestHandler(new RestHttp::HomeRequestHandler()); - addRequestHandler(new StandardRequestHandler()); + addRequestHandler(new RestHttp::StandardRequestHandler()); // start the thread start(); diff --git a/src/osgPlugins/curl/ReaderWriterCURL.cpp b/src/osgPlugins/curl/ReaderWriterCURL.cpp index ac38ea8db..c83d5bdc1 100644 --- a/src/osgPlugins/curl/ReaderWriterCURL.cpp +++ b/src/osgPlugins/curl/ReaderWriterCURL.cpp @@ -706,14 +706,33 @@ bool ReaderWriterCURL::read(std::istream& fin, std::string& destination) const } #endif +size_t empty_write_data(const char *buffer, size_t size, size_t nmemb, char +*userp) +{ + return size*nmemb; +} + bool ReaderWriterCURL::fileExists(const std::string& filename, const osgDB::Options* options) const { if (osgDB::containsServerAddress(filename)) { + std::string data; OSG_NOTICE<<"Checking if file exists using curl plugin: "< struct NativeTypeTraits { @@ -709,6 +710,7 @@ public: }; +} // end of namespace @@ -732,32 +734,32 @@ OscReceivingDevice::OscReceivingDevice(const std::string& server_address, int li _socket = new UdpListeningReceiveSocket(IpEndpointName( server_address.c_str(), listening_port ), this); - addRequestHandler(new KeyCodeRequestHandler(false)); - addRequestHandler(new KeyCodeRequestHandler(true)); - addRequestHandler(new KeyPressAndReleaseRequestHandler()); + addRequestHandler(new OscDevice::KeyCodeRequestHandler(false)); + addRequestHandler(new OscDevice::KeyCodeRequestHandler(true)); + addRequestHandler(new OscDevice::KeyPressAndReleaseRequestHandler()); - addRequestHandler(new SetMouseInputRangeRequestHandler()); - addRequestHandler(new SetMouseOrientationRequestHandler()); + addRequestHandler(new OscDevice::SetMouseInputRangeRequestHandler()); + addRequestHandler(new OscDevice::SetMouseOrientationRequestHandler()); - MouseMotionRequestHandler* mm_handler = new MouseMotionRequestHandler(); + OscDevice::MouseMotionRequestHandler* mm_handler = new OscDevice::MouseMotionRequestHandler(); addRequestHandler(mm_handler); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::PRESS)); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::RELEASE)); - addRequestHandler(new MouseButtonRequestHandler(MouseButtonRequestHandler::DOUBLE_PRESS)); - addRequestHandler(new MouseScrollRequestHandler()); + addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::PRESS)); + addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::RELEASE)); + addRequestHandler(new OscDevice::MouseButtonRequestHandler(OscDevice::MouseButtonRequestHandler::DOUBLE_PRESS)); + addRequestHandler(new OscDevice::MouseScrollRequestHandler()); - addRequestHandler(new MouseButtonToggleRequestHandler("1", mm_handler)); - addRequestHandler(new MouseButtonToggleRequestHandler("2", mm_handler)); - addRequestHandler(new MouseButtonToggleRequestHandler("3", mm_handler)); + addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("1", mm_handler)); + addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("2", mm_handler)); + addRequestHandler(new OscDevice::MouseButtonToggleRequestHandler("3", mm_handler)); - addRequestHandler(new PenPressureRequestHandler()); - addRequestHandler(new PenOrientationRequestHandler()); - addRequestHandler(new PenProximityRequestHandler(true)); - addRequestHandler(new PenProximityRequestHandler(false)); + addRequestHandler(new OscDevice::PenPressureRequestHandler()); + addRequestHandler(new OscDevice::PenOrientationRequestHandler()); + addRequestHandler(new OscDevice::PenProximityRequestHandler(true)); + addRequestHandler(new OscDevice::PenProximityRequestHandler(false)); - addRequestHandler(new StandardRequestHandler("/osg/set_user_value", true)); + addRequestHandler(new OscDevice::StandardRequestHandler("/osg/set_user_value", true)); - addRequestHandler(new StandardRequestHandler("", false)); + addRequestHandler(new OscDevice::StandardRequestHandler("", false)); start(); } diff --git a/src/osgPlugins/osc/OscSendingDevice.cpp b/src/osgPlugins/osc/OscSendingDevice.cpp index 268b80f01..eba58273a 100755 --- a/src/osgPlugins/osc/OscSendingDevice.cpp +++ b/src/osgPlugins/osc/OscSendingDevice.cpp @@ -24,7 +24,6 @@ OscSendingDevice::OscSendingDevice(const std::string& address, int port) , _transmitSocket(IpEndpointName(address.c_str(), port)) , _buffer(new char[BUFFER_SIZE]) , _oscStream(_buffer, BUFFER_SIZE) - , _firstRun(true) { setCapabilities(SEND_EVENTS); @@ -50,12 +49,14 @@ void OscSendingDevice::sendEvent(const osgGA::GUIEventAdapter &ea) switch(ea.getEventType()) { case osgGA::GUIEventAdapter::RESIZE: - sendInit(ea); + _oscStream << osc::BeginMessage("/osgga/resize") << ea.getWindowX() << ea.getWindowY() << ea.getWindowWidth() << ea.getWindowHeight() << osc::EndMessage; do_send = true; break; case osgGA::GUIEventAdapter::SCROLL: + beginSendInputRange(ea); _oscStream << osc::BeginMessage("/osgga/mouse/scroll") << ea.getScrollingMotion() << ea.getScrollingDeltaX() << ea.getScrollingDeltaY() << osc::EndMessage; + _oscStream << osc::EndBundle; do_send = true; break; @@ -95,32 +96,31 @@ void OscSendingDevice::sendEvent(const osgGA::GUIEventAdapter &ea) break; case osgGA::GUIEventAdapter::PUSH: + beginSendInputRange(ea); _oscStream << osc::BeginMessage("/osgga/mouse/press") << ea.getX() << ea.getY() << getButtonNum(ea) << osc::EndMessage; + _oscStream << osc::EndBundle; do_send = true; break; case osgGA::GUIEventAdapter::RELEASE: + beginSendInputRange(ea); _oscStream << osc::BeginMessage("/osgga/mouse/release") << ea.getX() << ea.getY() << getButtonNum(ea) << osc::EndMessage; + _oscStream << osc::EndBundle; do_send = true; break; case osgGA::GUIEventAdapter::DOUBLECLICK: + beginSendInputRange(ea); _oscStream << osc::BeginMessage("/osgga/mouse/doublepress") << ea.getX() << ea.getY() << getButtonNum(ea) << osc::EndMessage; + _oscStream << osc::EndBundle; do_send = true; break; case osgGA::GUIEventAdapter::MOVE: - if (_firstRun) - { - _firstRun = false; - sendInit(ea); - do_send = true; - break; - } - // break missing by intent; - case osgGA::GUIEventAdapter::DRAG: + beginSendInputRange(ea); _oscStream << osc::BeginMessage("/osgga/mouse/motion") << ea.getX() << ea.getY() << osc::EndMessage; + _oscStream << osc::EndBundle; do_send = true; break; @@ -150,6 +150,7 @@ void OscSendingDevice::sendEvent(const osgGA::GUIEventAdapter &ea) break; } + if (do_send) { OSG_INFO << "OscDevice :: sending event per OSC " << std::endl; @@ -178,13 +179,11 @@ int OscSendingDevice::getButtonNum(const osgGA::GUIEventAdapter& ea) return -1; } -void OscSendingDevice::sendInit(const osgGA::GUIEventAdapter &ea) +void OscSendingDevice::beginSendInputRange(const osgGA::GUIEventAdapter &ea) { _oscStream << osc::BeginBundle(); - _oscStream << osc::BeginMessage("/osgga/resize") << ea.getWindowX() << ea.getWindowY() << ea.getWindowWidth() << ea.getWindowHeight() << osc::EndMessage; _oscStream << osc::BeginMessage("/osgga/mouse/set_input_range") << ea.getXmin() << ea.getYmin() << ea.getXmax() << ea.getYmax() << osc::EndMessage; _oscStream << osc::BeginMessage("/osgga/mouse/y_orientation_increasing_upwards") << (bool)(ea.getMouseYOrientation() == osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS) << osc::EndMessage; - _oscStream << osc::EndBundle; } diff --git a/src/osgPlugins/osc/OscSendingDevice.hpp b/src/osgPlugins/osc/OscSendingDevice.hpp index cac02dd7d..fccf62d27 100755 --- a/src/osgPlugins/osc/OscSendingDevice.hpp +++ b/src/osgPlugins/osc/OscSendingDevice.hpp @@ -27,13 +27,12 @@ public: virtual void sendEvent(const osgGA::GUIEventAdapter &ea); private: - void sendInit(const osgGA::GUIEventAdapter& ea); + void beginSendInputRange(const osgGA::GUIEventAdapter& ea); int getButtonNum(const osgGA::GUIEventAdapter& ea); void sendUserDataContainer(const std::string& key, const osg::UserDataContainer* udc, bool asBundle); std::string transliterateKey(const std::string& key) const; UdpTransmitSocket _transmitSocket; char* _buffer; osc::OutboundPacketStream _oscStream; - bool _firstRun; }; diff --git a/src/osgPlugins/p3d/ReaderWriterP3D.cpp b/src/osgPlugins/p3d/ReaderWriterP3D.cpp index 0bf8ddbe1..de4ef1b6c 100644 --- a/src/osgPlugins/p3d/ReaderWriterP3D.cpp +++ b/src/osgPlugins/p3d/ReaderWriterP3D.cpp @@ -1458,6 +1458,13 @@ void ReaderWriterP3DXML::parseLayer(osgPresentation::SlideShowConstructor& const OSG_INFO<<"click_to_run ["<contents<<"]"<contents,osgPresentation::RUN, jumpData); } + else if (cur->name == "forward_mouse_event_to_device") + { + osgPresentation::JumpData jumpData; + + OSG_ALWAYS<<"forward_mouse_event_to_device ["<contents<<"]"<contents,osgPresentation::FORWARD_EVENT, jumpData); + } else if (cur->name == "click_to_load") { osgPresentation::JumpData jumpData; @@ -2217,7 +2224,7 @@ class MyReadFileCallback : public virtual osgDB::ReadFileCallback ++itr) { const std::string& path = *itr; - std::string newpath = path.empty() ? filename : osgDB::concatPaths(path, filename); + std::string newpath = osgDB::containsServerAddress(filename) ? filename : path.empty() ? filename : osgDB::concatPaths(path, filename); osgDB::ReaderWriter::ReadResult result; if (osgDB::containsServerAddress(newpath)) { @@ -2381,7 +2388,8 @@ osgDB::ReaderWriter::ReadResult ReaderWriterP3DXML::readNode(std::istream& fin, osg::ref_ptr local_opt = options ? static_cast(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; local_opt->setReadFileCallback(new MyReadFileCallback); - + local_opt->setFindFileCallback(new MyFindFileCallback); + return readNode(input, local_opt.get()); } diff --git a/src/osgPresentation/PickEventHandler.cpp b/src/osgPresentation/PickEventHandler.cpp index d1cd0fb4b..807a7f876 100644 --- a/src/osgPresentation/PickEventHandler.cpp +++ b/src/osgPresentation/PickEventHandler.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -23,7 +24,8 @@ using namespace osgPresentation; PickEventHandler::PickEventHandler(osgPresentation::Operation operation, const JumpData& jumpData): _operation(operation), - _jumpData(jumpData) + _jumpData(jumpData), + _drawablesOnPush() { OSG_INFO<<"PickEventHandler::PickEventHandler(operation="< cloned_ea = osg::clone(&ea); + const osg::BoundingBox bb(hitr->drawable->getBound()); + const osg::Vec3& p(hitr->localIntersectionPoint); + + float transformed_x = (p.x() - bb.xMin()) / (bb.xMax() - bb.xMin()); + float transformed_y = (p.z() - bb.zMin()) / (bb.zMax() - bb.zMin()); + + cloned_ea->setX(ea.getXmin() + transformed_x * (ea.getXmax() - ea.getXmin())); + cloned_ea->setY(ea.getYmin() + transformed_y * (ea.getYmax() - ea.getYmin())); + cloned_ea->setMouseYOrientation(osgGA::GUIEventAdapter::Y_INCREASING_UPWARDS); + + // std::cout << transformed_x << "/" << transformed_x << " -> " << cloned_ea->getX() << "/" <getY() << std::endl; + + + // dispatch cloned event to devices + osgViewer::View::Devices& devices = viewer->getDevices(); + for(osgViewer::View::Devices::iterator i = devices.begin(); i != devices.end(); ++i) + { + if((*i)->getCapabilities() & osgGA::Device::SEND_EVENTS) + { + (*i)->sendEvent(*cloned_ea); + } + } } - else if (ea.getEventType()==osgGA::GUIEventAdapter::RELEASE) + else { - doOperation(); - return true; + if (ea.getEventType()==osgGA::GUIEventAdapter::PUSH) + { + _drawablesOnPush.insert( hitr->drawable ); + } + else if (ea.getEventType()==osgGA::GUIEventAdapter::MOVE) + { + OSG_INFO<<"Tooltip..."<drawable) != _drawablesOnPush.end()) + doOperation(); + return true; + } } } } @@ -178,6 +221,8 @@ void PickEventHandler::doOperation() OSG_INFO<<"Requires jump "<get(); - es->checkEvents(); + if (es->getCapabilities() & osgGA::Device::RECEIVE_EVENTS) + es->checkEvents(); // open question, will we need to reproject mouse coordinates into current view's coordinate frame as is down for GraphicsWindow provided events? // for now assume now and just get the events directly without any reprojection. diff --git a/src/osgViewer/GraphicsWindowIOS.mm b/src/osgViewer/GraphicsWindowIOS.mm index 51a753625..a54e372bb 100644 --- a/src/osgViewer/GraphicsWindowIOS.mm +++ b/src/osgViewer/GraphicsWindowIOS.mm @@ -271,16 +271,18 @@ typedef std::map TouchPointsIdMapping; if (_win->getTraits()->inheritedWindowData.valid()) win_data = dynamic_cast(_win->getTraits()->inheritedWindowData.get()); - eaglLayer.opaque = win_data ? !win_data->getCreateTransparentView() : YES ; + eaglLayer.opaque = win_data ? !win_data->getCreateTransparentView() : YES; + bool retained_backing = win_data ? win_data->getUseRetainedBacking() : NO; + if(_win->getTraits()->alpha > 0) { //create layer with alpha channel RGBA8 eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; + [NSNumber numberWithBool:retained_backing], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; }else{ //else no alpha, IOS uses RBG565 eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGB565, kEAGLDrawablePropertyColorFormat, nil]; + [NSNumber numberWithBool:retained_backing], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGB565, kEAGLDrawablePropertyColorFormat, nil]; } } diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 419da8d13..86e2dd8d0 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -651,7 +651,8 @@ void Viewer::eventTraversal() ++eitr) { osgGA::Device* es = eitr->get(); - es->checkEvents(); + if (es->getCapabilities() & osgGA::Device::RECEIVE_EVENTS) + es->checkEvents(); // open question, will we need to reproject mouse coordinates into current view's coordinate frame as is down for GraphicsWindow provided events? // for now assume now and just get the events directly without any reprojection.