GraphicsContext
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_GRAPHICSCONTEXT
#define OSG_GRAPHICSCONTEXT 1
#include <osg/State>
#include <osg/GraphicsThread>
#include <osg/Timer>
#include <vector>
namespace osg {
// forward declare osg::Camera
class Camera;
class OSG_EXPORT GraphicsContext : public Object
{
public:
struct OSG_EXPORT ScreenIdentifier
{
ScreenIdentifier();
ScreenIdentifier(int in_screenNum);
ScreenIdentifier(const std::string& in_hostName,int in_displayNum, int in_screenNum);
std::string displayName() const;
void readDISPLAY();
void setScreenIdentifier(const std::string& displayName);
void setUndefinedScreenDetailsToDefaultScreen()
{
if (displayNum<0) displayNum = 0;
if (screenNum<0) screenNum = 0;
}
std::string hostName;
int displayNum;
int screenNum;
};
struct OSG_EXPORT Traits : public osg::Referenced, public ScreenIdentifier
{
Traits(DisplaySettings* ds=0);
// graphics context original and size
int x;
int y;
int width;
int height;
// provide a hint as to which WindowingSystemInterface implementation to use, i.e. "X11", "Win32", "Cocoa", "Carbon" etc.
// if the windowingSystemPreference string is empty (default) then return the first available WindowingSystemInterface that
// has been registered with the osg::GraphiccsContext::WindowingSystemInterfaces singleton
// if the windowingSystemPreference string is not empty then return the first WindowingSystemInterface that matches
std::string windowingSystemPreference;
// window decoration and behaviour
std::string windowName;
bool windowDecoration;
bool supportsResize;
// buffer depths, 0 equals off.
unsigned int red;
unsigned int blue;
unsigned int green;
unsigned int alpha;
unsigned int depth;
unsigned int stencil;
// multi sample parameters
unsigned int sampleBuffers;
unsigned int samples;
// buffer configuration
bool pbuffer;
bool quadBufferStereo;
bool doubleBuffer;
// render to texture
GLenum target;
GLenum format;
unsigned int level;
unsigned int face;
unsigned int mipMapGeneration;
// V-sync
bool vsync;
// Swap Group
bool swapGroupEnabled;
GLuint swapGroup;
GLuint swapBarrier;
// use multithreaded OpenGL-engine (OS X only)
bool useMultiThreadedOpenGLEngine;
// enable cursor
bool useCursor;
// settings used in set up of graphics context, only presently used by GL3 build of OSG.
std::string glContextVersion;
unsigned int glContextFlags;
unsigned int glContextProfileMask;
bool getContextVersion(unsigned int& major, unsigned int& minor) const;
// shared context
osg::observer_ptr<GraphicsContext> sharedContext;
osg::ref_ptr<osg::Referenced> inheritedWindowData;
// ask the GraphicsWindow implementation to set the pixel format of an inherited window
bool setInheritedWindowPixelFormat;
// X11 hint whether to override the window managers window size/position redirection
bool overrideRedirect;
DisplaySettings::SwapMethod swapMethod;
// hint of what affinity to use for any thrads associated with the graphics context created using these Traits
OpenThreads::Affinity affinity;
};
struct ScreenSettings {
ScreenSettings() :
width(0),
height(0),
refreshRate(0),
colorDepth(0)
{}
ScreenSettings(int in_width, int in_height, double in_refreshRate=0, unsigned int in_colorDepth=0) :
width(in_width),
height(in_height),
refreshRate(in_refreshRate),
colorDepth(in_colorDepth)
{}
int width;
int height;
double refreshRate;
unsigned int colorDepth;
};
typedef std::vector<ScreenSettings> ScreenSettingsList;
struct WindowingSystemInterface : public osg::Referenced
{
void setName(const std::string& name) { _name = name; }
const std::string& getName() const { return _name; }
virtual unsigned int getNumScreens(const ScreenIdentifier& screenIdentifier = ScreenIdentifier()) = 0;
virtual void getScreenSettings(const ScreenIdentifier& screenIdentifier, ScreenSettings & resolution) = 0;
virtual bool setScreenSettings(const ScreenIdentifier& /*screenIdentifier*/, const ScreenSettings & /*resolution*/) { return false; }
virtual void enumerateScreenSettings(const ScreenIdentifier& screenIdentifier, ScreenSettingsList & resolutionList) = 0;
virtual void setDisplaySettings(DisplaySettings*) {}
virtual osg::DisplaySettings* getDisplaySettings() const { return 0; }
virtual GraphicsContext* createGraphicsContext(Traits* traits) = 0;
inline void getScreenResolution(const ScreenIdentifier& screenIdentifier, unsigned int& width, unsigned int& height)
{
ScreenSettings settings;
getScreenSettings(screenIdentifier, settings);
width = settings.width;
height = settings.height;
}
inline bool setScreenResolution(const ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height)
{
return setScreenSettings(screenIdentifier, ScreenSettings(width, height));
}
inline bool setScreenRefreshRate(const ScreenIdentifier& screenIdentifier, double refreshRate)
{
ScreenSettings settings;
getScreenSettings(screenIdentifier, settings);
settings.refreshRate = refreshRate;
return setScreenSettings(screenIdentifier, settings);
}
protected:
WindowingSystemInterface() {}
virtual ~WindowingSystemInterface() {}
std::string _name;
};
class OSG_EXPORT WindowingSystemInterfaces : public osg::Referenced
{
public:
WindowingSystemInterfaces();
typedef std::vector< osg::ref_ptr<GraphicsContext::WindowingSystemInterface> > Interfaces;
Interfaces& getInterfaces() { return _interfaces; }
void addWindowingSystemInterface(WindowingSystemInterface* wsInterface);
void removeWindowingSystemInterface(WindowingSystemInterface* wsInterface);
WindowingSystemInterface* getWindowingSystemInterface(const std::string& name = "");
private:
virtual ~WindowingSystemInterfaces();
Interfaces _interfaces;
};
static osg::ref_ptr<WindowingSystemInterfaces>& getWindowingSystemInterfaces();
static WindowingSystemInterface* getWindowingSystemInterface(const std::string& name = "");
static GraphicsContext* createGraphicsContext(Traits* traits);
static unsigned int createNewContextID();
static unsigned int getMaxContextID();
static void incrementContextIDUsageCount(unsigned int contextID);
static void decrementContextIDUsageCount(unsigned int contextID);
typedef std::vector<GraphicsContext*> GraphicsContexts;
static GraphicsContexts getAllRegisteredGraphicsContexts();
static GraphicsContexts getRegisteredGraphicsContexts(unsigned int contextID);
static void setCompileContext(unsigned int contextID, GraphicsContext* gc);
static GraphicsContext* getOrCreateCompileContext(unsigned int contextID);
static GraphicsContext* getCompileContext(unsigned int contextID);
public:
void add(Operation* operation);
void remove(Operation* operation);
void remove(const std::string& name);
void removeAllOperations();
virtual void runOperations();
typedef std::list< ref_ptr<Operation> > GraphicsOperationQueue;
GraphicsOperationQueue& getOperationsQueue() { return _operations; }
OpenThreads::Mutex* getOperationsMutex() { return &_operationsMutex; }
osg::RefBlock* getOperationsBlock() { return _operationsBlock.get(); }
Operation* getCurrentOperation() { return _currentOperation.get(); }
public:
inline const Traits* getTraits() const { return _traits.get(); }
virtual bool valid() const = 0;
inline void setState(State* state) { _state = state; }
inline State* getState() { return _state.get(); }
inline const State* getState() const { return _state.get(); }
inline void setClearColor(const Vec4& color) { _clearColor = color; }
inline const Vec4& getClearColor() const { return _clearColor; }
inline void setClearMask(GLbitfield mask) { _clearMask = mask; }
inline GLbitfield getClearMask() const { return _clearMask; }
virtual void clear();
double getTimeSinceLastClear() const { return osg::Timer::instance()->delta_s(_lastClearTick, osg::Timer::instance()->tick()); }
bool realize();
void close(bool callCloseImplementation=true);
void swapBuffers();
inline bool isRealized() const { return isRealizedImplementation(); }
bool makeCurrent();
bool makeContextCurrent(GraphicsContext* readContext);
bool releaseContext();
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThreadId(); }
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
void createGraphicsThread();
void setGraphicsThread(GraphicsThread* gt);
GraphicsThread* getGraphicsThread() { return _graphicsThread.get(); }
const GraphicsThread* getGraphicsThread() const { return _graphicsThread.get(); }
virtual bool realizeImplementation() = 0;
virtual bool isRealizedImplementation() const = 0;
virtual void closeImplementation() = 0;
virtual bool makeCurrentImplementation() = 0;
virtual bool makeContextCurrentImplementation(GraphicsContext* readContext) = 0;
virtual bool releaseContextImplementation() = 0;
virtual void bindPBufferToTextureImplementation(GLenum buffer) = 0;
struct SwapCallback : public osg::Referenced
{
virtual void swapBuffersImplementation(GraphicsContext* gc) = 0;
};
void setSwapCallback(SwapCallback* rc) { _swapCallback = rc; }
SwapCallback* getSwapCallback() { return _swapCallback.get(); }
const SwapCallback* getSwapCallback() const { return _swapCallback.get(); }
void swapBuffersCallbackOrImplementation()
{
if (_state.valid()) _state->frameCompleted();
if (_swapCallback.valid()) _swapCallback->swapBuffersImplementation(this);
else swapBuffersImplementation();
}
virtual void swapBuffersImplementation() = 0;
void resized(int x, int y, int width, int height)
{
if (_resizedCallback.valid()) _resizedCallback->resizedImplementation(this, x, y, width, height);
else resizedImplementation(x, y, width, height);
}
struct ResizedCallback : public osg::Referenced
{
virtual void resizedImplementation(GraphicsContext* gc, int x, int y, int width, int height) = 0;
};
void setResizedCallback(ResizedCallback* rc) { _resizedCallback = rc; }
ResizedCallback* getResizedCallback() { return _resizedCallback.get(); }
const ResizedCallback* getResizedCallback() const { return _resizedCallback.get(); }
virtual void resizedImplementation(int x, int y, int width, int height);
typedef std::list< osg::Camera* > Cameras;
Cameras& getCameras() { return _cameras; }
const Cameras& getCameras() const { return _cameras; }
void setDefaultFboId(GLuint i) { _defaultFboId = i; }
GLuint getDefaultFboId() const { return _defaultFboId; }
public:
virtual bool isSameKindAs(const Object* object) const { return dynamic_cast<const GraphicsContext*>(object)!=0; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "GraphicsContext"; }
protected:
GraphicsContext();
GraphicsContext(const GraphicsContext&, const osg::CopyOp&);
virtual ~GraphicsContext();
virtual Object* cloneType() const { return 0; }
virtual Object* clone(const CopyOp&) const { return 0; }
static void registerGraphicsContext(GraphicsContext* gc);
static void unregisterGraphicsContext(GraphicsContext* gc);
void addCamera(osg::Camera* camera);
void removeCamera(osg::Camera* camera);
Cameras _cameras;
friend class osg::Camera;
ref_ptr<Traits> _traits;
ref_ptr<State> _state;
Vec4 _clearColor;
GLbitfield _clearMask;
size_t _threadOfLastMakeCurrent;
OpenThreads::Mutex _operationsMutex;
osg::ref_ptr<osg::RefBlock> _operationsBlock;
GraphicsOperationQueue _operations;
osg::ref_ptr<Operation> _currentOperation;
ref_ptr<GraphicsThread> _graphicsThread;
ref_ptr<ResizedCallback> _resizedCallback;
ref_ptr<SwapCallback> _swapCallback;
Timer_t _lastClearTick;
GLuint _defaultFboId;
};
//#include <osg/GLExtensions>
class OSG_EXPORT SyncSwapBuffersCallback : public GraphicsContext::SwapCallback
{
public:
SyncSwapBuffersCallback();
virtual void swapBuffersImplementation(GraphicsContext* gc);
GLsync _previousSync;
};
template<class T>
struct WindowingSystemInterfaceProxy
{
WindowingSystemInterfaceProxy(const std::string& name)
{
_wsi = new T;
_wsi->setName(name);
osg::GraphicsContext::getWindowingSystemInterfaces()->addWindowingSystemInterface(_wsi.get());
}
~WindowingSystemInterfaceProxy()
{
osg::GraphicsContext::getWindowingSystemInterfaces()->removeWindowingSystemInterface(_wsi.get());
}
osg::ref_ptr<T> _wsi;
};
#define REGISTER_WINDOWINGSYSTEMINTERFACE(ext, classname) \
extern "C" void graphicswindow_##ext(void) {} \
static osg::WindowingSystemInterfaceProxy<classname> s_proxy_##classname(#ext);
}
#endif
GraphicsThread
State
Timer
OpenThreads::Affinity
Simple container for specifying which CPU a thread should have affinity with. An empty Affinity....
Definition Affinity:34
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
OpenThreads::Thread::CurrentThreadId
static size_t CurrentThreadId()
osg::Camera
Definition Camera:45
osg::CopyOp
Definition CopyOp:41
osg::DisplaySettings
Definition DisplaySettings:34
osg::DisplaySettings::SwapMethod
SwapMethod
Definition DisplaySettings:257
osg::GraphicsContext::WindowingSystemInterfaces::getWindowingSystemInterface
WindowingSystemInterface * getWindowingSystemInterface(const std::string &name="")
osg::GraphicsContext::WindowingSystemInterfaces::WindowingSystemInterfaces
WindowingSystemInterfaces()
osg::GraphicsContext::WindowingSystemInterfaces::getInterfaces
Interfaces & getInterfaces()
Definition GraphicsContext:237
osg::GraphicsContext::WindowingSystemInterfaces::Interfaces
std::vector< osg::ref_ptr< GraphicsContext::WindowingSystemInterface > > Interfaces
Definition GraphicsContext:235
osg::GraphicsContext::WindowingSystemInterfaces::removeWindowingSystemInterface
void removeWindowingSystemInterface(WindowingSystemInterface *wsInterface)
osg::GraphicsContext::WindowingSystemInterfaces::addWindowingSystemInterface
void addWindowingSystemInterface(WindowingSystemInterface *wsInterface)
osg::GraphicsContext
Definition GraphicsContext:30
osg::GraphicsContext::removeAllOperations
void removeAllOperations()
osg::GraphicsContext::isSameKindAs
virtual bool isSameKindAs(const Object *object) const
Definition GraphicsContext:516
osg::GraphicsContext::isRealized
bool isRealized() const
Definition GraphicsContext:375
osg::GraphicsContext::getTimeSinceLastClear
double getTimeSinceLastClear() const
Definition GraphicsContext:358
osg::GraphicsContext::getState
const State * getState() const
Definition GraphicsContext:337
osg::GraphicsContext::_clearColor
Vec4 _clearColor
Definition GraphicsContext:547
osg::GraphicsContext::isCurrent
bool isCurrent() const
Definition GraphicsContext:393
osg::GraphicsContext::resized
void resized(int x, int y, int width, int height)
Definition GraphicsContext:476
osg::GraphicsContext::_state
ref_ptr< State > _state
Definition GraphicsContext:545
osg::GraphicsContext::setSwapCallback
void setSwapCallback(SwapCallback *rc)
Definition GraphicsContext:449
osg::GraphicsContext::setDefaultFboId
void setDefaultFboId(GLuint i)
Definition GraphicsContext:510
osg::GraphicsContext::decrementContextIDUsageCount
static void decrementContextIDUsageCount(unsigned int contextID)
osg::GraphicsContext::_operationsBlock
osg::ref_ptr< osg::RefBlock > _operationsBlock
Definition GraphicsContext:553
osg::GraphicsContext::_lastClearTick
Timer_t _lastClearTick
Definition GraphicsContext:562
osg::GraphicsContext::_defaultFboId
GLuint _defaultFboId
Definition GraphicsContext:564
osg::GraphicsContext::bindPBufferToTextureImplementation
virtual void bindPBufferToTextureImplementation(GLenum buffer)=0
osg::GraphicsContext::getRegisteredGraphicsContexts
static GraphicsContexts getRegisteredGraphicsContexts(unsigned int contextID)
osg::GraphicsContext::GraphicsOperationQueue
std::list< ref_ptr< Operation > > GraphicsOperationQueue
Definition GraphicsContext:306
osg::GraphicsContext::makeCurrentImplementation
virtual bool makeCurrentImplementation()=0
osg::GraphicsContext::_currentOperation
osg::ref_ptr< Operation > _currentOperation
Definition GraphicsContext:555
osg::GraphicsContext::Cameras
std::list< osg::Camera * > Cameras
Definition GraphicsContext:501
osg::GraphicsContext::registerGraphicsContext
static void registerGraphicsContext(GraphicsContext *gc)
osg::GraphicsContext::clear
virtual void clear()
osg::GraphicsContext::GraphicsContexts
std::vector< GraphicsContext * > GraphicsContexts
Definition GraphicsContext:272
osg::GraphicsContext::getSwapCallback
SwapCallback * getSwapCallback()
Definition GraphicsContext:452
osg::GraphicsContext::_traits
ref_ptr< Traits > _traits
Definition GraphicsContext:544
osg::GraphicsContext::createNewContextID
static unsigned int createNewContextID()
osg::GraphicsContext::remove
void remove(const std::string &name)
osg::GraphicsContext::getCameras
Cameras & getCameras()
Definition GraphicsContext:504
osg::GraphicsContext::setCompileContext
static void setCompileContext(unsigned int contextID, GraphicsContext *gc)
osg::GraphicsContext::~GraphicsContext
virtual ~GraphicsContext()
osg::GraphicsContext::getDefaultFboId
GLuint getDefaultFboId() const
Definition GraphicsContext:512
osg::GraphicsContext::add
void add(Operation *operation)
osg::GraphicsContext::ScreenSettingsList
std::vector< ScreenSettings > ScreenSettingsList
Definition GraphicsContext:176
osg::GraphicsContext::_resizedCallback
ref_ptr< ResizedCallback > _resizedCallback
Definition GraphicsContext:559
osg::GraphicsContext::closeImplementation
virtual void closeImplementation()=0
osg::GraphicsContext::_threadOfLastMakeCurrent
size_t _threadOfLastMakeCurrent
Definition GraphicsContext:550
osg::GraphicsContext::getOperationsQueue
GraphicsOperationQueue & getOperationsQueue()
Definition GraphicsContext:309
osg::GraphicsContext::getGraphicsThread
GraphicsThread * getGraphicsThread()
Definition GraphicsContext:407
osg::GraphicsContext::bindPBufferToTexture
void bindPBufferToTexture(GLenum buffer)
Definition GraphicsContext:396
osg::GraphicsContext::getOperationsBlock
osg::RefBlock * getOperationsBlock()
Definition GraphicsContext:315
osg::GraphicsContext::getGraphicsThread
const GraphicsThread * getGraphicsThread() const
Definition GraphicsContext:410
osg::GraphicsContext::makeContextCurrentImplementation
virtual bool makeContextCurrentImplementation(GraphicsContext *readContext)=0
osg::GraphicsContext::isRealizedImplementation
virtual bool isRealizedImplementation() const =0
osg::GraphicsContext::GraphicsContext
GraphicsContext()
osg::GraphicsContext::getClearMask
GLbitfield getClearMask() const
Definition GraphicsContext:352
osg::GraphicsContext::runOperations
virtual void runOperations()
osg::GraphicsContext::_cameras
Cameras _cameras
Definition GraphicsContext:540
osg::GraphicsContext::libraryName
virtual const char * libraryName() const
Definition GraphicsContext:517
osg::GraphicsContext::getMaxContextID
static unsigned int getMaxContextID()
osg::GraphicsContext::setClearMask
void setClearMask(GLbitfield mask)
Definition GraphicsContext:349
osg::GraphicsContext::incrementContextIDUsageCount
static void incrementContextIDUsageCount(unsigned int contextID)
osg::GraphicsContext::valid
virtual bool valid() const =0
osg::GraphicsContext::realizeImplementation
virtual bool realizeImplementation()=0
osg::GraphicsContext::setGraphicsThread
void setGraphicsThread(GraphicsThread *gt)
osg::GraphicsContext::getResizedCallback
ResizedCallback * getResizedCallback()
Definition GraphicsContext:492
osg::GraphicsContext::getCameras
const Cameras & getCameras() const
Definition GraphicsContext:507
osg::GraphicsContext::setClearColor
void setClearColor(const Vec4 &color)
Definition GraphicsContext:341
osg::GraphicsContext::_operationsMutex
OpenThreads::Mutex _operationsMutex
Definition GraphicsContext:552
osg::GraphicsContext::getWindowingSystemInterface
static WindowingSystemInterface * getWindowingSystemInterface(const std::string &name="")
osg::GraphicsContext::_swapCallback
ref_ptr< SwapCallback > _swapCallback
Definition GraphicsContext:560
osg::GraphicsContext::swapBuffersCallbackOrImplementation
void swapBuffersCallbackOrImplementation()
Definition GraphicsContext:460
osg::GraphicsContext::realize
bool realize()
osg::GraphicsContext::releaseContextImplementation
virtual bool releaseContextImplementation()=0
osg::GraphicsContext::_operations
GraphicsOperationQueue _operations
Definition GraphicsContext:554
osg::GraphicsContext::remove
void remove(Operation *operation)
osg::GraphicsContext::createGraphicsThread
void createGraphicsThread()
osg::GraphicsContext::getTraits
const Traits * getTraits() const
Definition GraphicsContext:324
osg::GraphicsContext::getResizedCallback
const ResizedCallback * getResizedCallback() const
Definition GraphicsContext:495
osg::GraphicsContext::unregisterGraphicsContext
static void unregisterGraphicsContext(GraphicsContext *gc)
osg::GraphicsContext::setState
void setState(State *state)
Definition GraphicsContext:331
osg::GraphicsContext::getCurrentOperation
Operation * getCurrentOperation()
Definition GraphicsContext:318
osg::GraphicsContext::getSwapCallback
const SwapCallback * getSwapCallback() const
Definition GraphicsContext:455
osg::GraphicsContext::getState
State * getState()
Definition GraphicsContext:334
osg::GraphicsContext::removeCamera
void removeCamera(osg::Camera *camera)
osg::GraphicsContext::resizedImplementation
virtual void resizedImplementation(int x, int y, int width, int height)
osg::GraphicsContext::className
virtual const char * className() const
Definition GraphicsContext:518
osg::GraphicsContext::GraphicsContext
GraphicsContext(const GraphicsContext &, const osg::CopyOp &)
osg::GraphicsContext::createGraphicsContext
static GraphicsContext * createGraphicsContext(Traits *traits)
osg::GraphicsContext::swapBuffers
void swapBuffers()
osg::GraphicsContext::makeContextCurrent
bool makeContextCurrent(GraphicsContext *readContext)
osg::GraphicsContext::_graphicsThread
ref_ptr< GraphicsThread > _graphicsThread
Definition GraphicsContext:557
osg::GraphicsContext::getClearColor
const Vec4 & getClearColor() const
Definition GraphicsContext:344
osg::GraphicsContext::getOperationsMutex
OpenThreads::Mutex * getOperationsMutex()
Definition GraphicsContext:312
osg::GraphicsContext::getOrCreateCompileContext
static GraphicsContext * getOrCreateCompileContext(unsigned int contextID)
osg::GraphicsContext::cloneType
virtual Object * cloneType() const
Definition GraphicsContext:527
osg::GraphicsContext::_clearMask
GLbitfield _clearMask
Definition GraphicsContext:548
osg::GraphicsContext::releaseContext
bool releaseContext()
osg::GraphicsContext::close
void close(bool callCloseImplementation=true)
osg::GraphicsContext::getCompileContext
static GraphicsContext * getCompileContext(unsigned int contextID)
osg::GraphicsContext::getWindowingSystemInterfaces
static osg::ref_ptr< WindowingSystemInterfaces > & getWindowingSystemInterfaces()
osg::GraphicsContext::clone
virtual Object * clone(const CopyOp &) const
Definition GraphicsContext:528
osg::GraphicsContext::swapBuffersImplementation
virtual void swapBuffersImplementation()=0
osg::GraphicsContext::makeCurrent
bool makeCurrent()
osg::GraphicsContext::setResizedCallback
void setResizedCallback(ResizedCallback *rc)
Definition GraphicsContext:489
osg::GraphicsContext::getAllRegisteredGraphicsContexts
static GraphicsContexts getAllRegisteredGraphicsContexts()
osg::GraphicsContext::addCamera
void addCamera(osg::Camera *camera)
osg::GraphicsThread
Definition GraphicsThread:26
osg::Object::Object
Object()
Definition Object:69
osg::Operation
Definition OperationThread:51
osg::RefBlock
Definition OperationThread:31
osg::Referenced
Definition Referenced:44
osg::State
Definition State:80
osg::SyncSwapBuffersCallback::swapBuffersImplementation
virtual void swapBuffersImplementation(GraphicsContext *gc)
osg::SyncSwapBuffersCallback::_previousSync
GLsync _previousSync
Definition GraphicsContext:577
osg::SyncSwapBuffersCallback::SyncSwapBuffersCallback
SyncSwapBuffersCallback()
osg::Timer::instance
static Timer * instance()
osg::Timer::delta_s
double delta_s(Timer_t t1, Timer_t t2) const
Definition Timer:59
osg::observer_ptr
Definition observer_ptr:39
osg::ref_ptr
Definition ref_ptr:32
osg
Definition AlphaFunc:19
osg::GLsync
struct __GLsync * GLsync
Definition GLDefines:680
osg::Vec4
Vec4f Vec4
Definition Vec4:21
osg::Timer_t
unsigned long long Timer_t
Definition Timer:24
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
osg::GraphicsContext::ResizedCallback
Definition GraphicsContext:483
osg::GraphicsContext::ResizedCallback::resizedImplementation
virtual void resizedImplementation(GraphicsContext *gc, int x, int y, int width, int height)=0
osg::GraphicsContext::ScreenIdentifier
Definition GraphicsContext:34
osg::GraphicsContext::ScreenIdentifier::ScreenIdentifier
ScreenIdentifier(const std::string &in_hostName, int in_displayNum, int in_screenNum)
osg::GraphicsContext::ScreenIdentifier::setUndefinedScreenDetailsToDefaultScreen
void setUndefinedScreenDetailsToDefaultScreen()
Definition GraphicsContext:57
osg::GraphicsContext::ScreenIdentifier::ScreenIdentifier
ScreenIdentifier(int in_screenNum)
osg::GraphicsContext::ScreenIdentifier::hostName
std::string hostName
Definition GraphicsContext:63
osg::GraphicsContext::ScreenIdentifier::readDISPLAY
void readDISPLAY()
osg::GraphicsContext::ScreenIdentifier::displayName
std::string displayName() const
osg::GraphicsContext::ScreenIdentifier::screenNum
int screenNum
Definition GraphicsContext:65
osg::GraphicsContext::ScreenIdentifier::setScreenIdentifier
void setScreenIdentifier(const std::string &displayName)
osg::GraphicsContext::ScreenIdentifier::displayNum
int displayNum
Definition GraphicsContext:64
osg::GraphicsContext::ScreenIdentifier::ScreenIdentifier
ScreenIdentifier()
osg::GraphicsContext::ScreenSettings
Definition GraphicsContext:155
osg::GraphicsContext::ScreenSettings::colorDepth
unsigned int colorDepth
RGB(A) color buffer depth.
Definition GraphicsContext:173
osg::GraphicsContext::ScreenSettings::height
int height
Definition GraphicsContext:171
osg::GraphicsContext::ScreenSettings::refreshRate
double refreshRate
Screen refresh rate, in Hz.
Definition GraphicsContext:172
osg::GraphicsContext::ScreenSettings::ScreenSettings
ScreenSettings()
Definition GraphicsContext:156
osg::GraphicsContext::ScreenSettings::width
int width
Definition GraphicsContext:170
osg::GraphicsContext::ScreenSettings::ScreenSettings
ScreenSettings(int in_width, int in_height, double in_refreshRate=0, unsigned int in_colorDepth=0)
Definition GraphicsContext:163
osg::GraphicsContext::SwapCallback
Definition GraphicsContext:441
osg::GraphicsContext::SwapCallback::swapBuffersImplementation
virtual void swapBuffersImplementation(GraphicsContext *gc)=0
osg::GraphicsContext::Traits
Definition GraphicsContext:70
osg::GraphicsContext::Traits::width
int width
Definition GraphicsContext:76
osg::GraphicsContext::Traits::target
GLenum target
Definition GraphicsContext:108
osg::GraphicsContext::Traits::face
unsigned int face
Definition GraphicsContext:111
osg::GraphicsContext::Traits::vsync
bool vsync
Definition GraphicsContext:115
osg::GraphicsContext::Traits::y
int y
Definition GraphicsContext:75
osg::GraphicsContext::Traits::glContextProfileMask
unsigned int glContextProfileMask
Definition GraphicsContext:131
osg::GraphicsContext::Traits::doubleBuffer
bool doubleBuffer
Definition GraphicsContext:105
osg::GraphicsContext::Traits::level
unsigned int level
Definition GraphicsContext:110
osg::GraphicsContext::Traits::getContextVersion
bool getContextVersion(unsigned int &major, unsigned int &minor) const
osg::GraphicsContext::Traits::red
unsigned int red
Definition GraphicsContext:91
osg::GraphicsContext::Traits::pbuffer
bool pbuffer
Definition GraphicsContext:103
osg::GraphicsContext::Traits::inheritedWindowData
osg::ref_ptr< osg::Referenced > inheritedWindowData
Definition GraphicsContext:139
osg::GraphicsContext::Traits::samples
unsigned int samples
Definition GraphicsContext:100
osg::GraphicsContext::Traits::useCursor
bool useCursor
Definition GraphicsContext:126
osg::GraphicsContext::Traits::windowingSystemPreference
std::string windowingSystemPreference
Definition GraphicsContext:83
osg::GraphicsContext::Traits::swapBarrier
GLuint swapBarrier
Definition GraphicsContext:120
osg::GraphicsContext::Traits::setInheritedWindowPixelFormat
bool setInheritedWindowPixelFormat
Definition GraphicsContext:142
osg::GraphicsContext::Traits::sampleBuffers
unsigned int sampleBuffers
Definition GraphicsContext:99
osg::GraphicsContext::Traits::swapGroupEnabled
bool swapGroupEnabled
Definition GraphicsContext:118
osg::GraphicsContext::Traits::green
unsigned int green
Definition GraphicsContext:93
osg::GraphicsContext::Traits::useMultiThreadedOpenGLEngine
bool useMultiThreadedOpenGLEngine
Definition GraphicsContext:123
osg::GraphicsContext::Traits::windowDecoration
bool windowDecoration
Definition GraphicsContext:87
osg::GraphicsContext::Traits::overrideRedirect
bool overrideRedirect
Definition GraphicsContext:145
osg::GraphicsContext::Traits::supportsResize
bool supportsResize
Definition GraphicsContext:88
osg::GraphicsContext::Traits::sharedContext
osg::observer_ptr< GraphicsContext > sharedContext
Definition GraphicsContext:137
osg::GraphicsContext::Traits::glContextFlags
unsigned int glContextFlags
Definition GraphicsContext:130
osg::GraphicsContext::Traits::height
int height
Definition GraphicsContext:77
osg::GraphicsContext::Traits::swapMethod
DisplaySettings::SwapMethod swapMethod
Definition GraphicsContext:147
osg::GraphicsContext::Traits::affinity
OpenThreads::Affinity affinity
Definition GraphicsContext:150
osg::GraphicsContext::Traits::swapGroup
GLuint swapGroup
Definition GraphicsContext:119
osg::GraphicsContext::Traits::depth
unsigned int depth
Definition GraphicsContext:95
osg::GraphicsContext::Traits::quadBufferStereo
bool quadBufferStereo
Definition GraphicsContext:104
osg::GraphicsContext::Traits::x
int x
Definition GraphicsContext:74
osg::GraphicsContext::Traits::stencil
unsigned int stencil
Definition GraphicsContext:96
osg::GraphicsContext::Traits::format
GLenum format
Definition GraphicsContext:109
osg::GraphicsContext::Traits::windowName
std::string windowName
Definition GraphicsContext:86
osg::GraphicsContext::Traits::mipMapGeneration
unsigned int mipMapGeneration
Definition GraphicsContext:112
osg::GraphicsContext::Traits::alpha
unsigned int alpha
Definition GraphicsContext:94
osg::GraphicsContext::Traits::glContextVersion
std::string glContextVersion
Definition GraphicsContext:129
osg::GraphicsContext::Traits::Traits
Traits(DisplaySettings *ds=0)
osg::GraphicsContext::Traits::blue
unsigned int blue
Definition GraphicsContext:92
osg::GraphicsContext::WindowingSystemInterface
Definition GraphicsContext:180
osg::GraphicsContext::WindowingSystemInterface::setScreenResolution
bool setScreenResolution(const ScreenIdentifier &screenIdentifier, unsigned int width, unsigned int height)
Definition GraphicsContext:210
osg::GraphicsContext::WindowingSystemInterface::WindowingSystemInterface
WindowingSystemInterface()
Definition GraphicsContext:224
osg::GraphicsContext::WindowingSystemInterface::setName
void setName(const std::string &name)
Definition GraphicsContext:181
osg::GraphicsContext::WindowingSystemInterface::_name
std::string _name
Definition GraphicsContext:227
osg::GraphicsContext::WindowingSystemInterface::setScreenRefreshRate
bool setScreenRefreshRate(const ScreenIdentifier &screenIdentifier, double refreshRate)
Definition GraphicsContext:216
osg::GraphicsContext::WindowingSystemInterface::getNumScreens
virtual unsigned int getNumScreens(const ScreenIdentifier &screenIdentifier=ScreenIdentifier())=0
osg::GraphicsContext::WindowingSystemInterface::getDisplaySettings
virtual osg::DisplaySettings * getDisplaySettings() const
Definition GraphicsContext:194
osg::GraphicsContext::WindowingSystemInterface::getScreenResolution
void getScreenResolution(const ScreenIdentifier &screenIdentifier, unsigned int &width, unsigned int &height)
Definition GraphicsContext:200
osg::GraphicsContext::WindowingSystemInterface::setDisplaySettings
virtual void setDisplaySettings(DisplaySettings *)
Definition GraphicsContext:192
osg::GraphicsContext::WindowingSystemInterface::getName
const std::string & getName() const
Definition GraphicsContext:182
osg::GraphicsContext::WindowingSystemInterface::createGraphicsContext
virtual GraphicsContext * createGraphicsContext(Traits *traits)=0
osg::GraphicsContext::WindowingSystemInterface::getScreenSettings
virtual void getScreenSettings(const ScreenIdentifier &screenIdentifier, ScreenSettings &resolution)=0
osg::GraphicsContext::WindowingSystemInterface::enumerateScreenSettings
virtual void enumerateScreenSettings(const ScreenIdentifier &screenIdentifier, ScreenSettingsList &resolutionList)=0
osg::GraphicsContext::WindowingSystemInterface::setScreenSettings
virtual bool setScreenSettings(const ScreenIdentifier &, const ScreenSettings &)
Definition GraphicsContext:188
osg::GraphicsContext::WindowingSystemInterface::~WindowingSystemInterface
virtual ~WindowingSystemInterface()
Definition GraphicsContext:225
osg::WindowingSystemInterfaceProxy::_wsi
osg::ref_ptr< T > _wsi
Definition GraphicsContext:597
osg::WindowingSystemInterfaceProxy::WindowingSystemInterfaceProxy
WindowingSystemInterfaceProxy(const std::string &name)
Definition GraphicsContext:584
osg::WindowingSystemInterfaceProxy::~WindowingSystemInterfaceProxy
~WindowingSystemInterfaceProxy()
Definition GraphicsContext:592