Removes unused code about GL version from OGL

This commit is contained in:
Vladislav Belov
2026-07-08 20:54:11 +02:00
parent 11f78e5c1a
commit 63b4b35bd3
2 changed files with 0 additions and 57 deletions
-43
View File
@@ -32,13 +32,6 @@
#include <cstring>
static int GLVersion;
bool ogl_HaveVersion(int major, int minor)
{
return GLAD_MAKE_VERSION(major, minor) <= GLVersion;
}
const char* ogl_GetErrorName(GLenum err)
{
#define E(e) case e: return #e;
@@ -86,39 +79,3 @@ void ogl_WarnIfErrorLoc(const char *file, int line)
if(error_enountered)
debug_printf("%s:%d: OpenGL error(s) occurred: %s (%04x)\n", file, line, ogl_GetErrorName(first_error), (unsigned int)first_error);
}
//----------------------------------------------------------------------------
// feature and limit detect
//----------------------------------------------------------------------------
bool ogl_Init(void* (load)(const char*))
{
GLADloadfunc loadFunc = reinterpret_cast<GLADloadfunc>(load);
if (!loadFunc)
return false;
#define LOAD_ERROR(ERROR_STRING) \
if (g_Logger) \
LOGERROR(ERROR_STRING); \
else \
debug_printf(ERROR_STRING); \
#if !CONFIG2_GLES
GLVersion = gladLoadGL(loadFunc);
if (!GLVersion)
{
LOAD_ERROR("Failed to load OpenGL functions.");
return false;
}
#else
GLVersion = gladLoadGLES2(loadFunc);
if (!GLVersion)
{
LOAD_ERROR("Failed to load GLES2 functions.");
return false;
}
#endif
#undef LOAD_ERROR
return true;
}
-14
View File
@@ -37,20 +37,6 @@
# include <glad/gl.h>
#endif
/**
* initialization: import extension function pointers and do feature detect.
* call before using any other function.
* fails if OpenGL not ready for use.
* TODO: move loading functionality to GL backend.
**/
extern bool ogl_Init(void* (load)(const char*));
/**
* make sure the OpenGL implementation version matches or is newer than
* the given version.
*/
extern bool ogl_HaveVersion(int major, int minor);
//-----------------------------------------------------------------------------
// errors