diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index fbc6df7863..15ec7f8a11 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -349,12 +349,24 @@ reset() { _supports_3d_texture = has_extension("GL_EXT_texture3D") || is_at_least_version(1, 2); - if (_supports_3d_texture) { + if (is_at_least_version(1, 2)) { + _supports_3d_texture = true; + _glTexImage3D = (PFNGLTEXIMAGE3DPROC) get_extension_func(GLPREFIX_QUOTED, "TexImage3D"); _glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) get_extension_func(GLPREFIX_QUOTED, "TexSubImage3D"); + } else if (has_extension("GL_EXT_texture3D")) { + _supports_3d_texture = true; + + _glTexImage3D = (PFNGLTEXIMAGE3DPROC) + get_extension_func(GLPREFIX_QUOTED, "TexImage3DEXT"); + _glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) + get_extension_func(GLPREFIX_QUOTED, "TexSubImage3DEXT"); + } + + if (_supports_3d_texture) { if (_glTexImage3D == NULL || _glTexSubImage3D == NULL) { GLCAT.warning() << "3-D textures advertised as supported by OpenGL runtime, but could not get pointers to extension functions.\n"; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index c151dd4d1d..a8530fe719 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -48,6 +48,8 @@ class Light; // system GL version matches or exceeds the GL version in which these // functions are defined, and the system gl.h sometimes doesn't // declare these typedefs. +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);