From Stephan Huber, "* imageio: removed ReaderWriterImageIO_IOS.cpp, refactored ReaderWriterImageIO to work on OS X and IOS
* avfoundation: added support for IOS (CoreVideo-support is still in development, works only for SDK >= 6.0, set IPHONE_SDKVER in cMake accordingly) * zeroconf: added ZeroConf-device-plugin (Mac/Win only, linux implementation missing) to advertise and discover services via ZeroConf/Bonjour, on windows you'll need the Bonjour SDK from Apple * osgosc: modified the example to demonstrate the usage of the ZeroConf-plugin (start the example with the command-line-argument --zeroconf) * SlideShowConstructor: enable/disable CoreVideo via a environment variable (P3D_ENABLE_CORE_VIDEO) * RestHttp: mouse-motion-events get interpolated * RestHttp: unhandled http-requests get sent as an user-event to the event-queue, all arguments get attached as user-values to the event * modified some CMakeModules to work correctly when compiling for IOS * fixed a compile-error for IOS in GraphicsWindowIOS * some minor bugfixes"
This commit is contained in:
@@ -303,6 +303,25 @@ void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_opti
|
||||
}
|
||||
}
|
||||
|
||||
void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name)
|
||||
{
|
||||
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device_name);
|
||||
if (dev.valid())
|
||||
{
|
||||
OSG_INFO << "Adding Device : " << device_name << std::endl;
|
||||
if (dev->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)
|
||||
viewer.addDevice(dev.get());
|
||||
|
||||
if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS)
|
||||
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get()));
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN << "could not open device: " << device_name << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
@@ -434,27 +453,15 @@ int main( int argc, char **argv )
|
||||
const char* p3dDevice = getenv("P3D_DEVICE");
|
||||
if (p3dDevice)
|
||||
{
|
||||
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(p3dDevice);
|
||||
if (dev.valid())
|
||||
{
|
||||
viewer.addDevice(dev.get());
|
||||
}
|
||||
addDeviceTo(viewer, p3dDevice);
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::string device;
|
||||
while (arguments.read("--device", device))
|
||||
{
|
||||
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device);
|
||||
if (dev.valid())
|
||||
{
|
||||
OSG_NOTICE<<"Adding Device : "<<device<<std::endl;
|
||||
if (dev->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)
|
||||
viewer.addDevice(dev.get());
|
||||
|
||||
if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS)
|
||||
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get()));
|
||||
}
|
||||
addDeviceTo(viewer, device);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user