Added support for per context extension string.

Note, this required adding a unsigned int context ID to the osg::isGLUExtensionSupported(,)
and osg::isGLExtensionSupported(,) functions.  This may require reimplementation
of end user code to accomodate the new calling convention.
This commit is contained in:
Robert Osfield
2005-04-26 13:15:27 +00:00
parent 59ebf86dd0
commit a1bda0dab8
35 changed files with 191 additions and 162 deletions

View File

@@ -70,13 +70,13 @@ class OSG_EXPORT BlendColor : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setBlendColorSupported(bool flag) { _isBlendColorSupported=flag; }
bool isBlendColorSupported() const { return _isBlendColorSupported; }

View File

@@ -97,13 +97,13 @@ class OSG_EXPORT BlendEquation : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setBlendEquationSupported(bool flag) { _isBlendEquationSupported=flag; }
bool isBlendEquationSupported() const { return _isBlendEquationSupported; }

View File

@@ -144,13 +144,13 @@ class OSG_EXPORT BufferObject : public Object
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
bool isBufferObjectSupported() const { return _glGenBuffers!=0; }

View File

@@ -492,13 +492,13 @@ class OSG_EXPORT Drawable : public Object
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setVertexProgramSupported(bool flag) { _isVertexProgramSupported=flag; }
bool isVertexProgramSupported() const { return _isVertexProgramSupported; }

View File

@@ -231,13 +231,13 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setFragmentProgramSupported(bool flag) { _isFragmentProgramSupported=flag; }
bool isFragmentProgramSupported() const { return _isFragmentProgramSupported; }

View File

@@ -37,7 +37,7 @@ namespace osg {
* Note: Must only be called within a valid OpenGL context,
* undefined behavior may occur otherwise.
*/
extern OSG_EXPORT bool isGLExtensionSupported(const char *extension);
extern OSG_EXPORT bool isGLExtensionSupported(unsigned int contextID, const char *extension);
/** Return the address of the specified OpenGL function.
* Return NULL if function not supported by OpenGL library.
@@ -111,7 +111,7 @@ inline void* getGLExtensionFuncPtr(const char *funcName,const char *fallbackFunc
* Note: Must only be called within a valid OpenGL context,
* undefined behavior may occur otherwise.
*/
extern OSG_EXPORT bool isGLUExtensionSupported(const char *extension);
extern OSG_EXPORT bool isGLUExtensionSupported(unsigned int contextID, const char *extension);
}

View File

@@ -99,13 +99,13 @@ class OSG_EXPORT Multisample : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setMultisampleSupported(bool flag) { _isMultisampleSupported=flag; }
void setMultisampleFilterHintSupported(bool flag) { _isMultisampleFilterHintSupported=flag; }

View File

@@ -83,13 +83,13 @@ class OSG_EXPORT Point : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setPointParametersSupported(bool flag) { _isPointParametersSupported=flag; }
bool isPointParametersSupported() const { return _isPointParametersSupported; }

View File

@@ -37,12 +37,12 @@ class Shader;
class OSG_EXPORT GL2Extensions : public osg::Referenced
{
public:
GL2Extensions();
GL2Extensions(unsigned int contextID);
GL2Extensions(const GL2Extensions& rhs);
void lowestCommonDenominator(const GL2Extensions& rhs);
void setupGL2Extensions();
void setupGL2Extensions(unsigned int contextID);
/** Does the GL driver support OpenGL Shading Language? */
bool isGlslSupported() const;

View File

@@ -414,13 +414,13 @@ class OSG_EXPORT Texture : public osg::StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions();
void setupGLExtensions(unsigned int contextID);
void setMultiTexturingSupported(bool flag) { _isMultiTexturingSupported=flag; }
bool isMultiTexturingSupported() const { return _isMultiTexturingSupported; }

View File

@@ -133,13 +133,13 @@ class OSG_EXPORT Texture3D : public Texture
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setTexture3DSupported(bool flag) { _isTexture3DSupported=flag; }
bool isTexture3DSupported() const { return _isTexture3DSupported; }

View File

@@ -123,13 +123,13 @@ class OSG_EXPORT TextureCubeMap : public Texture
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setCubeMapSupported(bool flag) { _isCubeMapSupported=flag; }
bool isCubeMapSupported() const { return _isCubeMapSupported; }

View File

@@ -234,13 +234,13 @@ class OSG_EXPORT VertexProgram : public StateAttribute
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions();
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtenions();
void setupGLExtenions(unsigned int contextID);
void setVertexProgramSupported(bool flag) { _isVertexProgramSupported=flag; }
bool isVertexProgramSupported() const { return _isVertexProgramSupported; }