root/OpenSceneGraph/trunk/include/osgGA/Device @ 13172

Revision 13172, 1.5 kB (checked in by robert, 57 minutes ago)

From Jan Klimke, "i noticed, that there are a couple of additional flaws when building osg for Mac OS X 10.10 Yosemite.

The mac os sdk version is recognized by the current CMAKE script as 10.1 instead of 10.10 since it cuts the version string from the 4th place. I introduced a more reliable version checking based on splitting the returned version code into MAJOR MINOR and PATCH parts and reassemble the OSG sdk version afterwards.

I replaced the existing CMake code against the following (returning now version 10.10 as expected):

# Determine the canonical name of the selected Platform SDK

EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"

OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)

STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

Also i added the check for the new Version to some more find scripts.

Additionally the nil object in Objective C now seems to be equivalent with a null_ptr that cannot be passed as GLInt anymore. So i switched this in the PixelBufferCocoa?.mm to pass a zero instead of nil.
"

Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGGA_EVENTSOURCE
15#define OSGGA_EVENTSOURCE 1
16
17#include <osgGA/EventQueue>
18
19namespace osgGA {
20
21/**
22 * Device base class from abstracting away from devices/windows that can generate events.
23 */
24class OSGGA_EXPORT Device : public osg::Object
25{
26    public:
27
28        Device();
29        Device(const Device& es, const osg::CopyOp& copyop);
30
31        META_Object(osgGA,Device);
32
33        virtual void checkEvents() {};
34
35        void setEventQueue(osgGA::EventQueue* eventQueue) { _eventQueue = eventQueue; }
36        osgGA::EventQueue* getEventQueue() { return _eventQueue.get(); }
37        const osgGA::EventQueue* getEventQueue() const { return _eventQueue.get(); }
38
39    protected:
40
41        virtual ~Device();
42
43        /** Prevent unwanted copy operator.*/
44        Device& operator = (const Device&) { return *this; }
45
46        osg::ref_ptr<osgGA::EventQueue> _eventQueue;
47       
48};
49
50}
51
52#endif
Note: See TracBrowser for help on using the browser.