Remove all !_IRR_OGLES1_USE_EXTPOINTER_ code

This commit is contained in:
sfan5 2024-01-16 21:03:52 +01:00
parent f28e442bfa
commit b7bb4b5958
3 changed files with 2 additions and 44 deletions

@ -210,7 +210,7 @@ if(ENABLE_GLES1)
add_definitions(-D_IRR_COMPILE_WITH_OGLES1_) add_definitions(-D_IRR_COMPILE_WITH_OGLES1_)
set(OPENGLES_DIRECT_LINK TRUE) set(OPENGLES_DIRECT_LINK TRUE)
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$") if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$")
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES1_USE_EXTPOINTER_) add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_)
endif() endif()
endif() endif()

@ -12,13 +12,11 @@
#include "SMaterial.h" #include "SMaterial.h"
#include "fast_atof.h" #include "fast_atof.h"
#if defined(_IRR_OGLES1_USE_EXTPOINTER_) #if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#include <EGL/egl.h> #include <EGL/egl.h>
#else #else
#include <GLES/egl.h> #include <GLES/egl.h>
#endif #endif
#endif
namespace irr namespace irr
{ {
@ -27,12 +25,10 @@ namespace video
COGLES1ExtensionHandler::COGLES1ExtensionHandler() : COGLESCoreExtensionHandler(), COGLES1ExtensionHandler::COGLES1ExtensionHandler() : COGLESCoreExtensionHandler(),
MaxUserClipPlanes(0), MaxLights(0) MaxUserClipPlanes(0), MaxLights(0)
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
, pGlBlendEquationOES(0), pGlBlendFuncSeparateOES(0), , pGlBlendEquationOES(0), pGlBlendFuncSeparateOES(0),
pGlBindFramebufferOES(0), pGlDeleteFramebuffersOES(0), pGlBindFramebufferOES(0), pGlDeleteFramebuffersOES(0),
pGlGenFramebuffersOES(0), pGlCheckFramebufferStatusOES(0), pGlGenFramebuffersOES(0), pGlCheckFramebufferStatusOES(0),
pGlFramebufferTexture2DOES(0), pGlGenerateMipmapOES(0) pGlFramebufferTexture2DOES(0), pGlGenerateMipmapOES(0)
#endif
{ {
} }
@ -84,7 +80,6 @@ namespace video
Feature.MaxTextureUnits = core::min_(Feature.MaxTextureUnits, static_cast<u8>(MATERIAL_MAX_TEXTURES)); Feature.MaxTextureUnits = core::min_(Feature.MaxTextureUnits, static_cast<u8>(MATERIAL_MAX_TEXTURES));
Feature.ColorAttachment = 1; Feature.ColorAttachment = 1;
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
pGlBlendEquationOES = (PFNGLBLENDEQUATIONOESPROC)eglGetProcAddress("glBlendEquationOES"); pGlBlendEquationOES = (PFNGLBLENDEQUATIONOESPROC)eglGetProcAddress("glBlendEquationOES");
pGlBlendFuncSeparateOES = (PFNGLBLENDFUNCSEPARATEOESPROC)eglGetProcAddress("glBlendFuncSeparateOES"); pGlBlendFuncSeparateOES = (PFNGLBLENDFUNCSEPARATEOESPROC)eglGetProcAddress("glBlendFuncSeparateOES");
pGlBindFramebufferOES = (PFNGLBINDFRAMEBUFFEROESPROC)eglGetProcAddress("glBindFramebufferOES"); pGlBindFramebufferOES = (PFNGLBINDFRAMEBUFFEROESPROC)eglGetProcAddress("glBindFramebufferOES");
@ -93,7 +88,6 @@ namespace video
pGlCheckFramebufferStatusOES = (PFNGLCHECKFRAMEBUFFERSTATUSOESPROC)eglGetProcAddress("glCheckFramebufferStatusOES"); pGlCheckFramebufferStatusOES = (PFNGLCHECKFRAMEBUFFERSTATUSOESPROC)eglGetProcAddress("glCheckFramebufferStatusOES");
pGlFramebufferTexture2DOES = (PFNGLFRAMEBUFFERTEXTURE2DOESPROC)eglGetProcAddress("glFramebufferTexture2DOES"); pGlFramebufferTexture2DOES = (PFNGLFRAMEBUFFERTEXTURE2DOESPROC)eglGetProcAddress("glFramebufferTexture2DOES");
pGlGenerateMipmapOES = (PFNGLGENERATEMIPMAPOESPROC)eglGetProcAddress("glGenerateMipmapOES"); pGlGenerateMipmapOES = (PFNGLGENERATEMIPMAPOESPROC)eglGetProcAddress("glGenerateMipmapOES");
#endif
} }
} // end namespace video } // end namespace video

@ -83,66 +83,40 @@ namespace video
inline void irrGlBindFramebuffer(GLenum target, GLuint framebuffer) inline void irrGlBindFramebuffer(GLenum target, GLuint framebuffer)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlBindFramebufferOES) if (pGlBindFramebufferOES)
pGlBindFramebufferOES(target, framebuffer); pGlBindFramebufferOES(target, framebuffer);
#elif defined(GL_OES_framebuffer_object)
glBindFramebufferOES(target, framebuffer);
#endif
} }
inline void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers) inline void irrGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlDeleteFramebuffersOES) if (pGlDeleteFramebuffersOES)
pGlDeleteFramebuffersOES(n, framebuffers); pGlDeleteFramebuffersOES(n, framebuffers);
#elif defined(GL_OES_framebuffer_object)
glDeleteFramebuffersOES(n, framebuffers);
#endif
} }
inline void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers) inline void irrGlGenFramebuffers(GLsizei n, GLuint *framebuffers)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlGenFramebuffersOES) if (pGlGenFramebuffersOES)
pGlGenFramebuffersOES(n, framebuffers); pGlGenFramebuffersOES(n, framebuffers);
#elif defined(GL_OES_framebuffer_object)
glGenFramebuffersOES(n, framebuffers);
#endif
} }
inline GLenum irrGlCheckFramebufferStatus(GLenum target) inline GLenum irrGlCheckFramebufferStatus(GLenum target)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlCheckFramebufferStatusOES) if (pGlCheckFramebufferStatusOES)
return pGlCheckFramebufferStatusOES(target); return pGlCheckFramebufferStatusOES(target);
else else
return 0; return 0;
#elif defined(GL_OES_framebuffer_object)
return glCheckFramebufferStatusOES(target);
#else
return 0;
#endif
} }
inline void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) inline void irrGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlFramebufferTexture2DOES) if (pGlFramebufferTexture2DOES)
pGlFramebufferTexture2DOES(target, attachment, textarget, texture, level); pGlFramebufferTexture2DOES(target, attachment, textarget, texture, level);
#elif defined(GL_OES_framebuffer_object)
glFramebufferTexture2DOES(target, attachment, textarget, texture, level);
#endif
} }
inline void irrGlGenerateMipmap(GLenum target) inline void irrGlGenerateMipmap(GLenum target)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlGenerateMipmapOES) if (pGlGenerateMipmapOES)
pGlGenerateMipmapOES(target); pGlGenerateMipmapOES(target);
#elif defined(GL_OES_framebuffer_object)
glGenerateMipmapOES(target);
#endif
} }
inline void irrGlActiveStencilFace(GLenum face) inline void irrGlActiveStencilFace(GLenum face)
@ -159,22 +133,14 @@ namespace video
inline void irrGlBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) inline void irrGlBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlBlendFuncSeparateOES) if (pGlBlendFuncSeparateOES)
pGlBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha); pGlBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
#elif defined(GL_OES_blend_func_separate)
glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha);
#endif
} }
inline void irrGlBlendEquation(GLenum mode) inline void irrGlBlendEquation(GLenum mode)
{ {
#ifdef _IRR_OGLES1_USE_EXTPOINTER_
if (pGlBlendEquationOES) if (pGlBlendEquationOES)
pGlBlendEquationOES(mode); pGlBlendEquationOES(mode);
#elif defined(GL_OES_blend_subtract)
glBlendEquationOES(mode);
#endif
} }
inline void irrGlEnableIndexed(GLenum target, GLuint index) inline void irrGlEnableIndexed(GLenum target, GLuint index)
@ -210,7 +176,6 @@ namespace video
u8 MaxUserClipPlanes; u8 MaxUserClipPlanes;
u8 MaxLights; u8 MaxLights;
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
PFNGLBLENDEQUATIONOESPROC pGlBlendEquationOES; PFNGLBLENDEQUATIONOESPROC pGlBlendEquationOES;
PFNGLBLENDFUNCSEPARATEOESPROC pGlBlendFuncSeparateOES; PFNGLBLENDFUNCSEPARATEOESPROC pGlBlendFuncSeparateOES;
PFNGLBINDFRAMEBUFFEROESPROC pGlBindFramebufferOES; PFNGLBINDFRAMEBUFFEROESPROC pGlBindFramebufferOES;
@ -219,7 +184,6 @@ namespace video
PFNGLCHECKFRAMEBUFFERSTATUSOESPROC pGlCheckFramebufferStatusOES; PFNGLCHECKFRAMEBUFFERSTATUSOESPROC pGlCheckFramebufferStatusOES;
PFNGLFRAMEBUFFERTEXTURE2DOESPROC pGlFramebufferTexture2DOES; PFNGLFRAMEBUFFERTEXTURE2DOESPROC pGlFramebufferTexture2DOES;
PFNGLGENERATEMIPMAPOESPROC pGlGenerateMipmapOES; PFNGLGENERATEMIPMAPOESPROC pGlGenerateMipmapOES;
#endif
}; };
} }