Merge pull request #869 from eligovision/OpenSceneGraph-3.6_glext
Added FBO GL extensions (useful for mobile VR etc.)
This commit is contained in:
commit
2e7a7d786a
@ -656,6 +656,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
// FrameBuferObject
|
||||
bool isFrameBufferObjectSupported;
|
||||
bool isPackedDepthStencilSupported;
|
||||
bool isMultisampledRenderToTextureSupported;
|
||||
bool isInvalidateFramebufferSupported;
|
||||
|
||||
bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; }
|
||||
bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; }
|
||||
|
||||
@ -672,6 +675,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture2DMultisample) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||
void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint);
|
||||
void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint);
|
||||
@ -680,6 +684,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
|
||||
void (GL_APIENTRY * glGenerateMipmap) (GLenum);
|
||||
void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||
void (GL_APIENTRY * glInvalidateFramebuffer) (GLenum, GLsizei, const GLenum*); // GL_ARB_invalidate_subdata or GL 4.3 or GLES 3
|
||||
void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*);
|
||||
|
||||
//ARB_framebuffer_no_attachments
|
||||
|
@ -1077,6 +1077,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
|
||||
// FrameBufferObject
|
||||
isMultisampledRenderToTextureSupported = validContext && isGLExtensionSupported(contextID, "GL_EXT_multisampled_render_to_texture");
|
||||
isInvalidateFramebufferSupported = validContext && (isGLExtensionSupported(contextID, "GL_ARB_invalidate_subdata") || (OSG_GLES3_FEATURES && glVersion >= 3.0) || glVersion >= 4.3);
|
||||
|
||||
setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES", validContext);
|
||||
setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES", validContext);
|
||||
setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES", validContext);
|
||||
@ -1090,6 +1093,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
setGLExtensionFuncPtr(glFramebufferTexture1D, "glFramebufferTexture1D", "glFramebufferTexture1DEXT", "glFramebufferTexture1DOES", validContext);
|
||||
setGLExtensionFuncPtr(glFramebufferTexture2D, "glFramebufferTexture2D", "glFramebufferTexture2DEXT", "glFramebufferTexture2DOES", validContext);
|
||||
setGLExtensionFuncPtr(glFramebufferTexture2DMultisample, "glFramebufferTexture2DMultisample", "glFramebufferTexture2DMultisampleEXT", validContext);
|
||||
setGLExtensionFuncPtr(glFramebufferTexture3D, "glFramebufferTexture3D", "glFramebufferTexture3DEXT", "glFramebufferTexture3DOES", validContext);
|
||||
setGLExtensionFuncPtr(glFramebufferTexture, "glFramebufferTexture", "glFramebufferTextureEXT", "glFramebufferTextureOES", validContext);
|
||||
setGLExtensionFuncPtr(glFramebufferTextureLayer, "glFramebufferTextureLayer", "glFramebufferTextureLayerEXT", "glFramebufferTextureLayerOES", validContext);
|
||||
@ -1105,6 +1109,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES", validContext);
|
||||
setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES", validContext);
|
||||
setGLExtensionFuncPtr(glInvalidateFramebuffer, "glInvalidateFramebuffer", "glInvalidateFramebufferEXT", validContext);
|
||||
setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES", validContext);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user