Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object.

Moved the #defines into new include/osg/GLDefines
Converted all GL2Extensions usage to GLExtensions usage


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14593 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-12-10 10:38:12 +00:00
parent 09205544b7
commit 485709f708
66 changed files with 1355 additions and 155 deletions

View File

@@ -132,7 +132,7 @@ void EXTQuerySupport::endQuery(osg::State* /*state*/)
void OpenGLQuerySupport::initialize(osg::State* state, osg::Timer_t /*startTick*/)
{
_extensions = state->get<osg::GL2Extensions>();
_extensions = state->get<osg::GLExtensions>();
}
void EXTQuerySupport::initialize(osg::State* state, osg::Timer_t startTick)
@@ -464,7 +464,7 @@ void Renderer::initialize(osg::State* state)
if (!_initialized)
{
_initialized = true;
osg::GL2Extensions* ext = state->get<osg::GL2Extensions>();
osg::GLExtensions* ext = state->get<osg::GLExtensions>();
if (ext->isARBTimerQuerySupported && state->getTimestampBits() > 0)
_querySupport = new ARBQuerySupport();
else if (ext->isTimerQuerySupported)

View File

@@ -72,8 +72,8 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
void read();
void readPixels();
void singlePBO(osg::GL2Extensions* ext);
void multiPBO(osg::GL2Extensions* ext);
void singlePBO(osg::GLExtensions* ext);
void multiPBO(osg::GLExtensions* ext);
typedef std::vector< osg::ref_ptr<osg::Image> > ImageBuffer;
typedef std::vector< GLuint > PBOBuffer;
@@ -218,7 +218,7 @@ void WindowCaptureCallback::ContextData::updateTimings(osg::Timer_t tick_start,
void WindowCaptureCallback::ContextData::read()
{
osg::GL2Extensions* ext = osg::GL2Extensions::Get(_gc->getState()->getContextID(),true);
osg::GLExtensions* ext = osg::GLExtensions::Get(_gc->getState()->getContextID(),true);
if (ext->isPBOSupported && !_pboBuffer.empty())
{
@@ -275,7 +275,7 @@ void WindowCaptureCallback::ContextData::readPixels()
_currentPboIndex = nextPboIndex;
}
void WindowCaptureCallback::ContextData::singlePBO(osg::GL2Extensions* ext)
void WindowCaptureCallback::ContextData::singlePBO(osg::GLExtensions* ext)
{
unsigned int nextImageIndex = (_currentImageIndex+1)%_imageBuffer.size();
@@ -350,7 +350,7 @@ void WindowCaptureCallback::ContextData::singlePBO(osg::GL2Extensions* ext)
_currentImageIndex = nextImageIndex;
}
void WindowCaptureCallback::ContextData::multiPBO(osg::GL2Extensions* ext)
void WindowCaptureCallback::ContextData::multiPBO(osg::GLExtensions* ext)
{
unsigned int nextImageIndex = (_currentImageIndex+1)%_imageBuffer.size();
unsigned int nextPboIndex = (_currentPboIndex+1)%_pboBuffer.size();

View File

@@ -1102,7 +1102,7 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase* viewer)
if ((*citr)->getGraphicsContext())
{
const osg::State* state = (*citr)->getGraphicsContext()->getState();
const osg::GL2Extensions* extensions = state->get<osg::GL2Extensions>();
const osg::GLExtensions* extensions = state->get<osg::GLExtensions>();
if (extensions &&
(((extensions->isARBTimerQuerySupported && state->getTimestampBits() > 0)) || extensions->isTimerQuerySupported))
{