MOved VertexProgram and FragmentProgram::Extensions into GL2Extensions.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14580 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-12-08 16:08:44 +00:00
parent 35cfbfdb8c
commit a8804e2366
7 changed files with 33 additions and 362 deletions

View File

@@ -234,62 +234,6 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
State object pointer == NULL.*/
virtual void releaseGLObjects(State* state=0) 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 setFragmentProgramSupported(bool flag) { _isFragmentProgramSupported=flag; }
bool isFragmentProgramSupported() const { return _isFragmentProgramSupported; }
void glBindProgram(GLenum target, GLuint id) const;
void glGenPrograms(GLsizei n, GLuint *programs) const;
void glDeletePrograms(GLsizei n, GLuint *programs) const;
void glProgramString(GLenum target, GLenum format, GLsizei len, const void *string) const;
void glProgramLocalParameter4fv(GLenum target, GLuint index, const GLfloat *params) const;
protected:
~Extensions() {}
bool _isFragmentProgramSupported;
typedef void (GL_APIENTRY * BindProgramProc) (GLenum target, GLuint id);
typedef void (GL_APIENTRY * GenProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * DeleteProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string);
typedef void (GL_APIENTRY * ProgramLocalParameter4fvProc) (GLenum target, GLuint index, const GLfloat *params);
BindProgramProc _glBindProgram;
GenProgramsProc _glGenPrograms;
DeleteProgramsProc _glDeletePrograms;
ProgramStringProc _glProgramString;
ProgramLocalParameter4fvProc _glProgramLocalParameter4fv;
};
/** 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 has 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);
/** setExtensions 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:
@@ -304,8 +248,6 @@ class OSG_EXPORT FragmentProgram : public StateAttribute
MatrixList _matrixList;
};
}
#endif

View File

@@ -780,7 +780,6 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
// Vertex Array extensions
bool isVertexProgramSupported;
bool isSecondaryColorSupported;
bool isFogCoordSupported;
bool isMultiTexSupported;
@@ -835,6 +834,17 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void (GL_APIENTRY * glSampleMaski) (GLuint maskNumber, GLbitfield mask);
// Vertex/Fragment Programs
bool isVertexProgramSupported;
bool isFragmentProgramSupported;
void (GL_APIENTRY * glBindProgram) (GLenum target, GLuint id);
void (GL_APIENTRY * glGenPrograms) (GLsizei n, GLuint *programs);
void (GL_APIENTRY * glDeletePrograms) (GLsizei n, GLuint *programs);
void (GL_APIENTRY * glProgramString) (GLenum target, GLenum format, GLsizei len, const void *string);
void (GL_APIENTRY * glProgramLocalParameter4fv) (GLenum target, GLuint index, const GLfloat *params);
};
}

View File

@@ -237,66 +237,6 @@ class OSG_EXPORT VertexProgram : public StateAttribute
*/
virtual void releaseGLObjects(State* state=0) 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 setVertexProgramSupported(bool flag) { _isVertexProgramSupported=flag; }
bool isVertexProgramSupported() const { return _isVertexProgramSupported; }
void glBindProgram(GLenum target, GLuint id) const;
void glGenPrograms(GLsizei n, GLuint *programs) const;
void glDeletePrograms(GLsizei n, GLuint *programs) const;
void glProgramString(GLenum target, GLenum format, GLsizei len, const void *string) const;
void glProgramLocalParameter4fv(GLenum target, GLuint index, const GLfloat *params) const;
protected:
~Extensions() {}
bool _isVertexProgramSupported;
typedef void (GL_APIENTRY * BindProgramProc) (GLenum target, GLuint id);
typedef void (GL_APIENTRY * GenProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * DeleteProgramsProc) (GLsizei n, GLuint *programs);
typedef void (GL_APIENTRY * ProgramStringProc) (GLenum target, GLenum format, GLsizei len, const void *string);
typedef void (GL_APIENTRY * ProgramLocalParameter4fvProc) (GLenum target, GLuint index, const GLfloat *params);
BindProgramProc _glBindProgram;
GenProgramsProc _glGenPrograms;
DeleteProgramsProc _glDeletePrograms;
ProgramStringProc _glProgramString;
ProgramLocalParameter4fvProc _glProgramLocalParameter4fv;
};
/** 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:
@@ -312,8 +252,6 @@ class OSG_EXPORT VertexProgram : public StateAttribute
MatrixList _matrixList;
};
}
#endif