Added osgProducer library to the distribution.

Cleaned up the osgproducer demo, and made it work with the new osgProducer lib.
This commit is contained in:
Robert Osfield 2003-01-17 18:34:35 +00:00
parent 359e0d9c70
commit 619862f8d6
13 changed files with 476 additions and 71 deletions

View File

@ -0,0 +1,26 @@
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef PRODUCERACTIONADAPTER
#define PRODUCERGUIACTIONADAPTER 1
#include <osgGA/GUIActionAdapter>
namespace osgProducer {
class ActionAdapter : public osgGA::GUIActionAdapter
{
public:
void requestRedraw() {}
void requestContinuousUpdate(bool) {}
void requestWarpPointer(int,int) {}
};
}
#endif

View File

@ -0,0 +1,208 @@
//C++ header - Open Producer - Copyright (C) 2002 Don Burns
//Distributed under the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE (LGPL)
//as published by the Free Software Foundation.
#ifndef OSG_CAMERA_GROUP_H
#define OSG_CAMERA_GROUP_H
#include <vector>
#include <Producer/CameraGroup>
#include <osg/Node>
#include <osg/StateSet>
#include <osg/FrameStamp>
#include <osg/DisplaySettings>
#include <osgProducer/SceneHandler>
namespace osgProducer {
class CameraGroup : public Producer::CameraGroup
{
public :
typedef std::vector <osgProducer::SceneHandler *> SceneHandlerList;
CameraGroup() : Producer::CameraGroup()
{ _init(); }
CameraGroup(Producer::CameraConfig *cfg) : Producer::CameraGroup(cfg)
{ _init(); }
CameraGroup(const std::string& configFile) : Producer::CameraGroup(configFile)
{ _init(); }
virtual ~CameraGroup() {}
void setSceneData( osg::Node *scene )
{
_scene_data = scene;
if( _shvec.size() > 0 )
{
SceneHandlerList::iterator p;
for( p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setSceneData( _scene_data );
}
}
}
osg::Node *getSceneData() { return _scene_data; }
void setDisplaySettings( osg::DisplaySettings *ds ) { _ds = ds; }
osg::DisplaySettings *getDisplaySettings() { return _ds.get(); }
const osg::DisplaySettings *getDisplaySettings() const { return _ds.get(); }
void setFrameStamp( osg::FrameStamp* fs )
{
_frameStamp = fs;
for(SceneHandlerList::iterator p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setFrameStamp( fs );
}
}
osg::FrameStamp *getFrameStamp() { return _frameStamp.get(); }
const osg::FrameStamp *getFrameStamp() const { return _frameStamp.get(); }
void setGlobalStateSet( osg::StateSet *sset )
{
_global_stateset = sset;
for(SceneHandlerList::iterator p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setGlobalStateSet( _global_stateset );
}
}
void setBackgroundColor( const osg::Vec4& backgroundColor )
{
_background_color = backgroundColor;
if( _shvec.size() > 0 )
{
SceneHandlerList::iterator p;
for( p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setBackgroundColor( _background_color );
}
}
}
void setLODScale( float bias )
{
if( _shvec.size() > 0 )
{
SceneHandlerList::iterator p;
for( p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setLODScale( bias );
}
}
}
void setFusionDistance( osgUtil::SceneView::FusionDistanceMode mode,float value=1.0f)
{
if( _shvec.size() > 0 )
{
SceneHandlerList::iterator p;
for( p = _shvec.begin(); p != _shvec.end(); p++ )
{
(*p)->setFusionDistance( mode, value );
}
}
}
osg::Vec4& getBackgroundColor() { return _background_color; }
const osg::Vec4& getBackgroundColor() const { return _background_color; }
osg::StateSet *getGlobalStateSet() { return _global_stateset; }
const osg::StateSet *getGlobalStateSet() const { return _global_stateset; }
void advance()
{
if( !_initialized ) return;
CameraGroup::advance();
}
void realize( ThreadingModel thread_model= SingleThreaded )
{
if( _initialized ) return;
if (!_ds) _ds = osg::DisplaySettings::instance();
_ds->setMaxNumberOfGraphicsContexts( _cfg->getNumberOfCameras() );
for( unsigned int i = 0; i < _cfg->getNumberOfCameras(); i++ )
{
Producer::Camera *cam = _cfg->getCamera(i);
osgProducer::SceneHandler *sh = new osgProducer::SceneHandler(_ds.get());
sh->setDefaults();
if( _global_stateset != NULL )
sh->setGlobalStateSet( _global_stateset );
if( _scene_data != NULL )
sh->setSceneData( _scene_data );
sh->setBackgroundColor( _background_color);
sh->getState()->setContextID(i);
sh->setFrameStamp( _frameStamp.get() );
_shvec.push_back( sh );
cam->setSceneHandler( sh );
}
/// Make all statesets the same as the first.
if( _global_stateset == NULL && _shvec.size() > 0 )
{
SceneHandlerList::iterator p;
p = _shvec.begin();
_global_stateset = (*p)->getGlobalStateSet();
p++;
for( ; p != _shvec.end(); p++ )
(*p)->setGlobalStateSet( _global_stateset );
}
Producer::CameraGroup::realize( thread_model );
_initialized = true;
}
virtual void frame( )
{
Producer::CameraGroup::frame();
_frameStamp->setFrameNumber( _frameStamp->getFrameNumber() + 1 );
}
private :
osg::Node * _scene_data;
osg::StateSet * _global_stateset;
osg::Vec4 _background_color;
SceneHandlerList _shvec;
osg::ref_ptr<osg::DisplaySettings> _ds;
bool _initialized;
osg::ref_ptr<osg::FrameStamp> _frameStamp;
void _init()
{
_scene_data = NULL;
_global_stateset = NULL;
_background_color.set( 0.2f, 0.2f, 0.4f, 1.0f );
_initialized = false;
if (!_frameStamp) _frameStamp = new osg::FrameStamp;
}
};
}
#endif

View File

@ -5,16 +5,21 @@
#ifndef OSGGLUT_ProducerEventAdapter
#define OSGGLUT_ProducerEventAdapter 1
#include <osgProducer/Export>
#include <osgGA/GUIEventAdapter>
#include <Producer/KeyboardMouse>
/** Class for adapting GLUT events so that they can be used as input to osgGA::CameraManipulators.*/
class ProducerEventAdapter : public osgGA::GUIEventAdapter
namespace osgProducer {
/** Class for adapting Producer events so that they can be used as input to osgGA::CameraManipulators.*/
class OSGPRODUCER_EXPORT EventAdapter : public osgGA::GUIEventAdapter
{
public:
ProducerEventAdapter();
virtual ~ProducerEventAdapter() {}
EventAdapter();
virtual ~EventAdapter() {}
/** Get the EventType of the GUI event.*/
virtual EventType getEventType() const { return _eventType; }
@ -113,4 +118,6 @@ class ProducerEventAdapter : public osgGA::GUIEventAdapter
};
}
#endif

View File

@ -0,0 +1,29 @@
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
// The following symbol has a underscore suffix for compatibility.
#ifndef OSGPRODUCER_EXPORT_
#define OSGPRODUCER_EXPORT_ 1
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#pragma warning( disable : 4244 )
#pragma warning( disable : 4251 )
#pragma warning( disable : 4267 )
#pragma warning( disable : 4275 )
#pragma warning( disable : 4290 )
#pragma warning( disable : 4786 )
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# ifdef OSGPRODUCER_LIBRARY
# define OSGPRODUCER_EXPORT __declspec(dllexport)
# else
# define OSGPRODUCER_EXPORT __declspec(dllimport)
#endif /* OSGPRODUCER_LIBRARY */
#else
#define OSGPRODUCER_EXPORT
#endif
#endif

View File

@ -1,26 +1,33 @@
//C++
#ifndef PRODUCEREVENTCALLBACK
#define PRODUCEREVENTCALLBACK
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGPRODUCER_EVENTCALLBACK
#define OSGPRODUCER_EVENTCALLBACK 1
#include <stdio.h>
#include <Producer/RenderSurface> // For definition of KeySymbol
#include <Producer/KeyboardMouse>
#include <Producer/Mutex>
#include "ProducerEventAdapter.h"
#include <osgProducer/EventAdapter>
#include <osg/ref_ptr>
#include <osg/Timer>
class ProducerEventCallback : public Producer::KeyboardMouseCallback
namespace osgProducer {
class OSGPRODUCER_EXPORT KeyboardMouseCallback : public Producer::KeyboardMouseCallback
{
public:
ProducerEventCallback(bool &done) :
KeyboardMouseCallback(bool &done) :
Producer::KeyboardMouseCallback(),
_mx(0.0f),_my(0.0f),_mbutton(0),
_done(done)
{}
virtual ~ProducerEventCallback() {}
virtual ~KeyboardMouseCallback() {}
virtual void keyPress( Producer::KeySymbol key );
@ -32,7 +39,7 @@ class ProducerEventCallback : public Producer::KeyboardMouseCallback
virtual void buttonRelease( float mx, float my, unsigned int mbutton );
typedef std::vector< osg::ref_ptr<ProducerEventAdapter> > EventQueue;
typedef std::vector< osg::ref_ptr<EventAdapter> > EventQueue;
void getEventQueue(EventQueue& queue);
@ -57,4 +64,7 @@ class ProducerEventCallback : public Producer::KeyboardMouseCallback
EventQueue _eventQueue;
};
}
#endif

View File

@ -0,0 +1,67 @@
//C++ header - Open Producer - Copyright (C) 2002 Don Burns
//Distributed under the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGPRODUCER_SCENEHANDLER
#define OSGPRODUCER_SCENEHANDLER 1
#include <osgProducer/Export>
#include <Producer/Camera>
#include <osgUtil/SceneView>
#include <osg/Matrix>
#include <iostream>
namespace osgProducer {
class SceneHandler : public Producer::Camera::SceneHandler, public osgUtil::SceneView
{
public :
SceneHandler( osg::DisplaySettings *ds = NULL) : osgUtil::SceneView(ds)
{
mm = new osg::RefMatrix;
pm = new osg::RefMatrix;
}
void cull(Producer::Camera &cam)
{
pm->set(cam.getProjectionMatrix());
mm->set(cam.getPositionAndAttitudeMatrix());
setProjectionMatrix( pm.get() );
setModelViewMatrix( mm.get() );
int x, y;
unsigned int w, h;
cam.getProjectionRect( x, y, w, h );
setViewport( x, y, w, h );
#ifdef _windows_is_non_standard
SceneView::cull();
#else
osgUtil::SceneView::cull();
#endif
}
void draw(Producer::Camera &)
{
#ifdef _windows_is_non_standard
SceneView::draw();
#else
osgUtil::SceneView::draw();
#endif
}
void setContextID( int id )
{
getState()->setContextID( id );
}
private:
osg::ref_ptr<osg::RefMatrix> mm;
osg::ref_ptr<osg::RefMatrix> pm;
};
}
#endif

View File

@ -0,0 +1,39 @@
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
#ifndef OSGPRODUCER_VERSION
#define OSGPRODUCER_VERSION 1
#include <osgProducer/Export>
extern "C" {
/**
* osgProducerGetVersion() returns the library version number.
* Numbering convention : osg_src-0.8.31 will return 0.8.31.
*
* This C function can be also used to check for the existence of the OpenSceneGraph
* library using autoconf and its m4 macro AC_CHECK_LIB.
*
* Here is the code to add to your configure.in:
\verbatim
#
# Check for the OpenSceneGraph (OSG) GLUT library
#
AC_CHECK_LIB(osg, osgProducerGetVersion, ,
[AC_MSG_ERROR(OpenSceneGraph GLUT library not found. See http://www.openscenegraph.org)],)
\endverbatim
*/
extern OSGPRODUCER_EXPORT const char* osgProducerGetVersion();
/**
* getLibraryName_osgProducer() returns the library name in human friendly form.
*/
extern OSGPRODUCER_EXPORT const char* osgProducerGetLibraryName();
}
#endif

View File

@ -2,11 +2,9 @@ TOPDIR = ../../..
include $(TOPDIR)/Make/makedefs
CXXFILES =\
ProducerEventCallback.cpp\
ProducerEventAdapter.cpp\
osgproducer.cpp\
LIBS += -lProducer $(OSG_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
LIBS += -losgProducer $(OSG_LIBS) $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS)
INSTFILES = \
$(CXXFILES)\

View File

@ -9,8 +9,6 @@
#include <Producer/Camera>
#include <Producer/CameraConfig>
#include <Producer/OsgCameraGroup>
#include <Producer/OsgSceneHandler>
#include <Producer/InputArea>
#include <Producer/KeyboardMouse>
@ -27,12 +25,10 @@
#include <osgGA/KeySwitchCameraManipulator>
#include <osgGA/StateSetManipulator>
#if USE_MY_KEYBOARD_MOUSE_CALLBACK
#include "MyKeyboardMouseCallback"
#else
#include "ProducerEventCallback.h"
#include "ProducerActionAdapter.h"
#endif
#include <osgProducer/CameraGroup>
#include <osgProducer/SceneHandler>
#include <osgProducer/KeyboardMouseCallback>
#include <osgProducer/ActionAdapter>
#include <list>
@ -90,19 +86,19 @@ int main( int argc, char **argv )
// create the camera group.
Producer::OsgCameraGroup *cg = 0;
osgProducer::CameraGroup *cg = 0;
#define USE_BUILD_CONFIG
#ifdef USE_BUILD_CONFIG
Producer::CameraConfig *cfg = BuildConfig();
cg = new Producer::OsgCameraGroup(cfg);
cg = new osgProducer::CameraGroup(cfg);
#else
cg = configFile.empty() ?
(new Producer::OsgCameraGroup()):
(new Producer::OsgCameraGroup(configFile));
(new osgProducer::CameraGroup()):
(new osgProducer::CameraGroup(configFile));
#endif
@ -132,7 +128,7 @@ int main( int argc, char **argv )
// set the keyboard mouse callback to catch the events from the windows.
bool done = false;
ProducerEventCallback kbmcb(done);
osgProducer::KeyboardMouseCallback kbmcb(done);
kbmcb.setStartTick(start_tick);
// register the callback with the keyboard mouse manger.
@ -205,9 +201,9 @@ int main( int argc, char **argv )
eventHandlerList.push_back(statesetManipulator.get());
// create a dummy action adapter right now.
ProducerActionAdapter actionAdapter;
osgProducer::ActionAdapter actionAdapter;
osg::ref_ptr<ProducerEventAdapter> init_event = new ProducerEventAdapter;
osg::ref_ptr<osgProducer::EventAdapter> init_event = new osgProducer::EventAdapter;
init_event->adaptFrame(0.0);
keyswitchManipulator->getCurrentCameraManipulator()->home(*init_event,actionAdapter);
@ -222,16 +218,16 @@ int main( int argc, char **argv )
frameStamp->setReferenceTime(time_since_start);
// get the event since the last frame.
ProducerEventCallback::EventQueue queue;
osgProducer::KeyboardMouseCallback::EventQueue queue;
kbmcb.getEventQueue(queue);
// create an event to signal the new frame.
osg::ref_ptr<ProducerEventAdapter> frame_event = new ProducerEventAdapter;
osg::ref_ptr<osgProducer::EventAdapter> frame_event = new osgProducer::EventAdapter;
frame_event->adaptFrame(frameStamp->getReferenceTime());
queue.push_back(frame_event);
// dispatch the events in order of arrival.
for(ProducerEventCallback::EventQueue::iterator event_itr=queue.begin();
for(osgProducer::KeyboardMouseCallback::EventQueue::iterator event_itr=queue.begin();
event_itr!=queue.end();
++event_itr)
{
@ -250,11 +246,7 @@ int main( int argc, char **argv )
// update the main producer camera
#if USE_MY_KEYBOARD_MOUSE_CALLBACK
cg->setView(tb.getMatrix().ptr());
#else
cg->setView(old_style_osg_camera->getModelViewMatrix().ptr());
#endif
// fire off the cull and draw traversals of the scene.
cg->frame();

View File

@ -1,18 +1,20 @@
#include "ProducerEventAdapter.h"
#include <osgProducer/EventAdapter>
using namespace osgProducer;
// default to no mouse buttons being pressed.
unsigned int ProducerEventAdapter::_s_accumulatedButtonMask = 0;
unsigned int EventAdapter::_s_accumulatedButtonMask = 0;
int ProducerEventAdapter::_s_button = 0;
int ProducerEventAdapter::_s_modKeyMask = 0;
int ProducerEventAdapter::_s_Xmin = 0;
int ProducerEventAdapter::_s_Xmax = 1280;
int ProducerEventAdapter::_s_Ymin = 0;
int ProducerEventAdapter::_s_Ymax = 1024;
int ProducerEventAdapter::_s_mx = 0;
int ProducerEventAdapter::_s_my = 0;
int EventAdapter::_s_button = 0;
int EventAdapter::_s_modKeyMask = 0;
int EventAdapter::_s_Xmin = 0;
int EventAdapter::_s_Xmax = 1280;
int EventAdapter::_s_Ymin = 0;
int EventAdapter::_s_Ymax = 1024;
int EventAdapter::_s_mx = 0;
int EventAdapter::_s_my = 0;
ProducerEventAdapter::ProducerEventAdapter()
EventAdapter::EventAdapter()
{
_eventType = NONE; // adaptor does not encapsulate any events.
_key = -1; // set to 'invalid' key value.
@ -28,7 +30,7 @@ ProducerEventAdapter::ProducerEventAdapter()
}
void ProducerEventAdapter::copyStaticVariables()
void EventAdapter::copyStaticVariables()
{
_buttonMask = _s_accumulatedButtonMask;
_modKeyMask = _s_modKeyMask;
@ -42,7 +44,7 @@ void ProducerEventAdapter::copyStaticVariables()
}
void ProducerEventAdapter::setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax)
void EventAdapter::setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax)
{
_s_Xmin = Xmin;
_s_Xmax = Xmax;
@ -51,13 +53,13 @@ void ProducerEventAdapter::setWindowSize(int Xmin, int Ymin, int Xmax, int Ymax)
}
void ProducerEventAdapter::setButtonMask(unsigned int buttonMask)
void EventAdapter::setButtonMask(unsigned int buttonMask)
{
_s_accumulatedButtonMask = buttonMask;
}
void ProducerEventAdapter::adaptResize(double time, int Xmin, int Ymin, int Xmax, int Ymax)
void EventAdapter::adaptResize(double time, int Xmin, int Ymin, int Xmax, int Ymax)
{
setWindowSize(Xmin,Ymin,Xmax,Ymax);
_eventType = RESIZE;
@ -65,7 +67,7 @@ void ProducerEventAdapter::adaptResize(double time, int Xmin, int Ymin, int Xmax
copyStaticVariables();
}
void ProducerEventAdapter::adaptButtonPress(double time,float x, float y, unsigned int button)
void EventAdapter::adaptButtonPress(double time,float x, float y, unsigned int button)
{
_time = time;
@ -97,7 +99,7 @@ void ProducerEventAdapter::adaptButtonPress(double time,float x, float y, unsign
copyStaticVariables();
}
void ProducerEventAdapter::adaptButtonRelease(double time,float x, float y, unsigned int button)
void EventAdapter::adaptButtonRelease(double time,float x, float y, unsigned int button)
{
_time = time;
@ -130,7 +132,7 @@ void ProducerEventAdapter::adaptButtonRelease(double time,float x, float y, unsi
}
/** method for adapting mouse motion events whilst mouse buttons are pressed.*/
void ProducerEventAdapter::adaptMouseMotion(double time, float x, float y)
void EventAdapter::adaptMouseMotion(double time, float x, float y)
{
_eventType = DRAG;
_time = time;
@ -141,7 +143,7 @@ void ProducerEventAdapter::adaptMouseMotion(double time, float x, float y)
/** method for adapting keyboard events.*/
void ProducerEventAdapter::adaptKeyPress( double time, Producer::KeySymbol key)
void EventAdapter::adaptKeyPress( double time, Producer::KeySymbol key)
{
_eventType = KEYDOWN;
_time = time;
@ -150,7 +152,7 @@ void ProducerEventAdapter::adaptKeyPress( double time, Producer::KeySymbol key)
copyStaticVariables();
}
void ProducerEventAdapter::adaptKeyRelease( double time, Producer::KeySymbol key)
void EventAdapter::adaptKeyRelease( double time, Producer::KeySymbol key)
{
// we won't handle this correctly right now.. GUIEventAdapter isn't up to it
_eventType = KEYUP;
@ -163,7 +165,7 @@ void ProducerEventAdapter::adaptKeyRelease( double time, Producer::KeySymbol key
/** method for adapting frame events, i.e. iddle/display callback.*/
void ProducerEventAdapter::adaptFrame(double time)
void EventAdapter::adaptFrame(double time)
{
_eventType = FRAME;
_time = time;

View File

@ -1,4 +1,4 @@
#include "ProducerEventCallback.h"
#include <osgProducer/KeyboardMouseCallback>
#ifdef WIN32
#include <windows.h>
@ -7,7 +7,9 @@
#endif
void ProducerEventCallback::keyPress( Producer::KeySymbol key )
using namespace osgProducer;
void KeyboardMouseCallback::keyPress( Producer::KeySymbol key )
{
switch( key )
@ -24,7 +26,7 @@ void ProducerEventCallback::keyPress( Producer::KeySymbol key )
#endif
}
osg::ref_ptr<ProducerEventAdapter> event = new ProducerEventAdapter;
osg::ref_ptr<EventAdapter> event = new EventAdapter;
event->adaptKeyPress(getTime(),key);
_eventQueueMutex.lock();
@ -32,10 +34,10 @@ void ProducerEventCallback::keyPress( Producer::KeySymbol key )
_eventQueueMutex.unlock();
}
void ProducerEventCallback::keyRelease( Producer::KeySymbol key )
void KeyboardMouseCallback::keyRelease( Producer::KeySymbol key )
{
osg::ref_ptr<ProducerEventAdapter> event = new ProducerEventAdapter;
osg::ref_ptr<EventAdapter> event = new EventAdapter;
event->adaptKeyRelease(getTime(),key);
_eventQueueMutex.lock();
@ -43,13 +45,13 @@ void ProducerEventCallback::keyRelease( Producer::KeySymbol key )
_eventQueueMutex.unlock();
}
void ProducerEventCallback::mouseMotion( float mx, float my)
void KeyboardMouseCallback::mouseMotion( float mx, float my)
{
_mx = mx;
_my = my;
osg::ref_ptr<ProducerEventAdapter> event = new ProducerEventAdapter;
osg::ref_ptr<EventAdapter> event = new EventAdapter;
event->adaptMouseMotion(getTime(),mx,my);
_eventQueueMutex.lock();
@ -58,14 +60,14 @@ void ProducerEventCallback::mouseMotion( float mx, float my)
}
void ProducerEventCallback::buttonPress( float mx, float my, unsigned int mbutton )
void KeyboardMouseCallback::buttonPress( float mx, float my, unsigned int mbutton )
{
_mx = mx;
_my = my;
_mbutton |= (1<<(mbutton-1));
osg::ref_ptr<ProducerEventAdapter> event = new ProducerEventAdapter;
osg::ref_ptr<EventAdapter> event = new EventAdapter;
event->adaptButtonPress(getTime(),mx,my,mbutton);
_eventQueueMutex.lock();
@ -73,14 +75,14 @@ void ProducerEventCallback::buttonPress( float mx, float my, unsigned int mbutto
_eventQueueMutex.unlock();
}
void ProducerEventCallback::buttonRelease( float mx, float my, unsigned int mbutton )
void KeyboardMouseCallback::buttonRelease( float mx, float my, unsigned int mbutton )
{
_mx = mx;
_my = my;
_mbutton &= ~(1<<(mbutton-1));
osg::ref_ptr<ProducerEventAdapter> event = new ProducerEventAdapter;
osg::ref_ptr<EventAdapter> event = new EventAdapter;
event->adaptButtonRelease(getTime(),mx,my,mbutton);
_eventQueueMutex.lock();
@ -88,7 +90,7 @@ void ProducerEventCallback::buttonRelease( float mx, float my, unsigned int mbut
_eventQueueMutex.unlock();
}
void ProducerEventCallback::getEventQueue(EventQueue& queue)
void KeyboardMouseCallback::getEventQueue(EventQueue& queue)
{
queue.clear();
_eventQueueMutex.lock();

13
src/osgProducer/Makefile Normal file
View File

@ -0,0 +1,13 @@
TOPDIR = ../..
include $(TOPDIR)/Make/makedefs
CXXFILES =\
EventAdapter.cpp\
KeyboardMouseCallback.cpp\
LIBS += -lProducer $(GL_LIBS) -losgGA -losgUtil -losgDB -losg $(OTHER_LIBS)
DEF += -DOSGPRODUCER_LIBRARY
TARGET_BASENAME = osgProducer
LIB = $(LIB_PREFIX)$(TARGET_BASENAME).$(LIB_EXT)
include $(TOPDIR)/Make/makerules

View File

@ -0,0 +1,12 @@
#include <osgProducer/Version>
const char* osgProducerGetVersion()
{
return "0.9.2";
}
const char* osgProducerGetLibraryName()
{
return "Open Scene Graph Producer Library";
}