Add more GlTextureParameter wrapper to COpenGLExtensionHandler

Sorry, just a hack to make it easier to work around Irrlicht :-(
Would be nice to have a general mechanism to load native gl functions in Irrlicht from apps...


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6074 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2020-02-11 14:14:59 +00:00
parent 7b1ee6468d
commit 9c837aa41b
2 changed files with 37 additions and 3 deletions

View File

@ -88,7 +88,8 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
pGlBlendEquationIndexedAMD(0), pGlBlendEquationiARB(0), pGlBlendEquationSeparateIndexedAMD(0), pGlBlendEquationSeparateiARB(0), pGlBlendEquationIndexedAMD(0), pGlBlendEquationiARB(0), pGlBlendEquationSeparateIndexedAMD(0), pGlBlendEquationSeparateiARB(0),
// DSA // DSA
pGlTextureStorage2D(0), pGlTextureStorage3D(0), pGlTextureSubImage2D(0), pGlGetTextureImage(0), pGlNamedFramebufferTexture(0), pGlTextureStorage2D(0), pGlTextureStorage3D(0), pGlTextureSubImage2D(0), pGlGetTextureImage(0), pGlNamedFramebufferTexture(0),
pGlTextureParameteri(0), pGlCreateTextures(0), pGlCreateFramebuffers(0), pGlBindTextures(0), pGlGenerateTextureMipmap(0), pGlTextureParameteri(0), pGlTextureParameterf(0), pGlTextureParameteriv(0), pGlTextureParameterfv(0),
pGlCreateTextures(0), pGlCreateFramebuffers(0), pGlBindTextures(0), pGlGenerateTextureMipmap(0),
// DSA with EXT or functions to simulate it // DSA with EXT or functions to simulate it
pGlTextureStorage2DEXT(0), pGlTexStorage2D(0), pGlTextureStorage3DEXT(0), pGlTexStorage3D(0), pGlTextureSubImage2DEXT(0), pGlGetTextureImageEXT(0), pGlTextureStorage2DEXT(0), pGlTexStorage2D(0), pGlTextureStorage3DEXT(0), pGlTexStorage3D(0), pGlTextureSubImage2DEXT(0), pGlGetTextureImageEXT(0),
pGlNamedFramebufferTextureEXT(0), pGlFramebufferTexture(0), pGlGenerateTextureMipmapEXT(0) pGlNamedFramebufferTextureEXT(0), pGlFramebufferTexture(0), pGlGenerateTextureMipmapEXT(0)
@ -586,6 +587,10 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
pGlGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)IRR_OGL_LOAD_EXTENSION("glGetTextureImage"); pGlGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)IRR_OGL_LOAD_EXTENSION("glGetTextureImage");
pGlNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) IRR_OGL_LOAD_EXTENSION("glNamedFramebufferTexture"); pGlNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) IRR_OGL_LOAD_EXTENSION("glNamedFramebufferTexture");
pGlTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC) IRR_OGL_LOAD_EXTENSION("glTextureParameteri"); pGlTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC) IRR_OGL_LOAD_EXTENSION("glTextureParameteri");
pGlTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameterf");
pGlTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameteriv");
pGlTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameterfv");
pGlCreateTextures = (PFNGLCREATETEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glCreateTextures"); pGlCreateTextures = (PFNGLCREATETEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glCreateTextures");
pGlCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glCreateFramebuffers"); pGlCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glCreateFramebuffers");
pGlBindTextures = (PFNGLBINDTEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glBindTextures"); pGlBindTextures = (PFNGLBINDTEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glBindTextures");

View File

@ -1203,6 +1203,9 @@ class COpenGLExtensionHandler
void extGlGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels); void extGlGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels);
void extGlNamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); void extGlNamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
void extGlTextureParameteri(GLuint texture, GLenum pname, GLint param); void extGlTextureParameteri(GLuint texture, GLenum pname, GLint param);
void extGlTextureParameterf(GLuint texture, GLenum pname, GLfloat param);
void extGlTextureParameteriv(GLuint texture, GLenum pname, const GLint* params);
void extGlTextureParameterfv(GLuint texture, GLenum pname, const GLfloat* params);
void extGlCreateTextures(GLenum target, GLsizei n, GLuint* textures); void extGlCreateTextures(GLenum target, GLsizei n, GLuint* textures);
void extGlCreateFramebuffers(GLsizei n, GLuint* framebuffers); void extGlCreateFramebuffers(GLsizei n, GLuint* framebuffers);
void extGlBindTextures(GLuint first, GLsizei count, const GLuint *textures, const GLenum* targets); void extGlBindTextures(GLuint first, GLsizei count, const GLuint *textures, const GLenum* targets);
@ -1373,6 +1376,10 @@ class COpenGLExtensionHandler
PFNGLGETTEXTUREIMAGEPROC pGlGetTextureImage; PFNGLGETTEXTUREIMAGEPROC pGlGetTextureImage;
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC pGlNamedFramebufferTexture; PFNGLNAMEDFRAMEBUFFERTEXTUREPROC pGlNamedFramebufferTexture;
PFNGLTEXTUREPARAMETERIPROC pGlTextureParameteri; PFNGLTEXTUREPARAMETERIPROC pGlTextureParameteri;
PFNGLTEXTUREPARAMETERFPROC pGlTextureParameterf;
PFNGLTEXTUREPARAMETERIVPROC pGlTextureParameteriv;
PFNGLTEXTUREPARAMETERFVPROC pGlTextureParameterfv;
PFNGLCREATETEXTURESPROC pGlCreateTextures; PFNGLCREATETEXTURESPROC pGlCreateTextures;
PFNGLCREATEFRAMEBUFFERSPROC pGlCreateFramebuffers; PFNGLCREATEFRAMEBUFFERSPROC pGlCreateFramebuffers;
PFNGLBINDTEXTURESPROC pGlBindTextures; PFNGLBINDTEXTURESPROC pGlBindTextures;
@ -3086,8 +3093,30 @@ inline void COpenGLExtensionHandler::extGlTextureParameteri(GLuint texture, GLen
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureParameteri) if (pGlTextureParameteri)
pGlTextureParameteri(texture, pname, param); pGlTextureParameteri(texture, pname, param);
#else #endif//_IRR_OPENGL_USE_EXTPOINTER_
// TODO }
inline void COpenGLExtensionHandler::extGlTextureParameterf(GLuint texture, GLenum pname, GLfloat param)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureParameterf)
pGlTextureParameterf(texture, pname, param);
#endif//_IRR_OPENGL_USE_EXTPOINTER_
}
inline void COpenGLExtensionHandler::extGlTextureParameteriv(GLuint texture, GLenum pname, const GLint* params)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureParameteriv)
pGlTextureParameteriv(texture, pname, params);
#endif//_IRR_OPENGL_USE_EXTPOINTER_
}
inline void COpenGLExtensionHandler::extGlTextureParameterfv(GLuint texture, GLenum pname, const GLfloat* params)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureParameterfv)
pGlTextureParameterfv(texture, pname, params);
#endif//_IRR_OPENGL_USE_EXTPOINTER_ #endif//_IRR_OPENGL_USE_EXTPOINTER_
} }