Moveved Stencil/StencilTwoSided::Extensions into GL2Extensions

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14583 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-12-09 11:14:33 +00:00
parent ec4f898bce
commit 3f1e77d479
6 changed files with 39 additions and 303 deletions

View File

@@ -599,9 +599,6 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
bool isCubeMapSupported;
void (GL_APIENTRY * glDrawBuffers)(GLsizei n, const GLenum *bufs);
void (GL_APIENTRY * glStencilOpSeparate)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
void (GL_APIENTRY * glStencilFuncSeparate)(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
void (GL_APIENTRY * glStencilMaskSeparate)(GLenum face, GLuint mask);
void (GL_APIENTRY * glAttachShader)(GLuint program, GLuint shader);
void (GL_APIENTRY * glBindAttribLocation)(GLuint program, GLuint index, const GLchar *name);
void (GL_APIENTRY * glCompileShader)(GLuint shader);
@@ -930,6 +927,20 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void (GL_APIENTRY * glEnablei) (GLenum capability, GLuint buf);
void (GL_APIENTRY * glDisablei) (GLenum capability, GLuint buf);
// Stencil
bool isStencilWrapSupported;
bool isStencilTwoSidedSupported;
bool isOpenGL20Supported;
bool isSeparateStencilSupported;
void (GL_APIENTRY * glActiveStencilFace) (GLenum face);
void (GL_APIENTRY * glStencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
void (GL_APIENTRY * glStencilMaskSeparate) (GLenum face, GLuint mask);
void (GL_APIENTRY * glStencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask);
void (GL_APIENTRY * glStencilFuncSeparateATI) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
};
}

View File

@@ -166,47 +166,6 @@ class OSG_EXPORT Stencil : public StateAttribute
virtual void apply(State& state) const;
/** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.
*/
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setStencilWrapSupported(bool flag) { _isStencilWrapSupported = flag; }
bool isStencilWrapSupported() const { return _isStencilWrapSupported; }
protected:
~Extensions() {}
bool _isStencilWrapSupported;
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object
* will only be created with the graphics context associated with ContextID.
*/
static Extensions* getExtensions(unsigned int contextID, bool createIfNotInitalized);
/** The setExtensions method allows users to override the extensions across graphics contexts.
* Typically used when you have different extensions supported across graphics pipes
* but need to ensure that they all use the same low common denominator extensions.
*/
static void setExtensions(unsigned int contextID, Extensions* extensions);
protected:
virtual ~Stencil();

View File

@@ -140,76 +140,9 @@ class OSG_EXPORT StencilTwoSided : public StateAttribute
inline unsigned int getWriteMask(Face face) const { return _writeMask[face]; }
virtual void apply(State& state) const;
public:
/** Extensions class which encapsulates the querying of extensions and
* associated function pointers, and provide convenience wrappers to
* check for the extensions or use the associated functions.
*/
class OSG_EXPORT Extensions : public osg::Referenced
{
public:
Extensions(unsigned int contextID);
Extensions(const Extensions& rhs);
void lowestCommonDenominator(const Extensions& rhs);
void setupGLExtensions(unsigned int contextID);
void setStencilTwoSidedSupported(bool flag) { _isStencilTwoSidedSupported=flag; }
bool isStencilTwoSidedSupported() const { return _isStencilTwoSidedSupported; }
void setOpenGL20Supported(bool flag) { _isOpenGL20Supported=flag; }
bool isOpenGL20Supported() const { return _isOpenGL20Supported; }
void setSeparateStencilSupported(bool flag) { _isSeparateStencilSupported=flag; }
bool isSeparateStencilSupported() const { return _isSeparateStencilSupported; }
void glActiveStencilFace(GLenum face) const;
void glStencilOpSeparate(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass) const;
void glStencilMaskSeparate(GLenum face, GLuint mask) const;
void glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) const;
void glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) const;
protected:
~Extensions() {}
bool _isStencilTwoSidedSupported;
bool _isOpenGL20Supported;
bool _isSeparateStencilSupported;
typedef void (GL_APIENTRY * ActiveStencilFaceProc) (GLenum);
typedef void (GL_APIENTRY * StencilOpSeparate) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (GL_APIENTRY * StencilMaskSeparate) (GLenum face, GLuint mask);
typedef void (GL_APIENTRY * StencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask);
typedef void (GL_APIENTRY * StencilFuncSeparateATI) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
ActiveStencilFaceProc _glActiveStencilFace;
StencilOpSeparate _glStencilOpSeparate;
StencilMaskSeparate _glStencilMaskSeparate;
StencilFuncSeparate _glStencilFuncSeparate;
StencilFuncSeparate _glStencilFuncSeparateATI;
};
/** Function to call to get the extension of a specified context.
* If the Extension object for that context has not yet been created
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object
* will only be created with the graphics context associated with ContextID.
*/
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
/** The setExtensions method allows users to override the extensions across graphics contexts.
* Typically used when you have different extensions supported across graphics pipes
* but need to ensure that they all use the same low common denominator extensions.
*/
static void setExtensions(unsigned int contextID,Extensions* extensions);
protected:
virtual ~StencilTwoSided();