mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Improvement] (GL_Getter.*): Code improvement.
This commit is contained in:
@@ -73,9 +73,6 @@ namespace MG_GL::GL {
|
|||||||
} StringCache;
|
} StringCache;
|
||||||
static StringCache caches[] = {
|
static StringCache caches[] = {
|
||||||
{GL_EXTENSIONS, nullptr, 0},
|
{GL_EXTENSIONS, nullptr, 0},
|
||||||
{GL_VENDOR, nullptr, 0},
|
|
||||||
{GL_VERSION, nullptr, 0},
|
|
||||||
{GL_SHADING_LANGUAGE_VERSION, nullptr, 0}
|
|
||||||
};
|
};
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
@@ -124,8 +121,7 @@ namespace MG_GL::GL {
|
|||||||
case GL_NUM_EXTENSIONS:
|
case GL_NUM_EXTENSIONS:
|
||||||
static GLint num_extensions = -1;
|
static GLint num_extensions = -1;
|
||||||
if (num_extensions == -1) {
|
if (num_extensions == -1) {
|
||||||
const GLubyte* ext_str = glGetString(GL_EXTENSIONS);
|
const GLubyte* ext_str = MG_GL::GL::GetString(GL_EXTENSIONS);
|
||||||
if (ext_str) {
|
|
||||||
char *copy = strdup((const char *) ext_str);
|
char *copy = strdup((const char *) ext_str);
|
||||||
char *token = strtok(copy, " ");
|
char *token = strtok(copy, " ");
|
||||||
num_extensions = 0;
|
num_extensions = 0;
|
||||||
@@ -134,9 +130,6 @@ namespace MG_GL::GL {
|
|||||||
token = strtok(nullptr, " ");
|
token = strtok(nullptr, " ");
|
||||||
}
|
}
|
||||||
free(copy);
|
free(copy);
|
||||||
} else {
|
|
||||||
num_extensions = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
(*params) = num_extensions;
|
(*params) = num_extensions;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
#include "../../../../Includes.h"
|
#include "../../../../Includes.h"
|
||||||
|
|
||||||
namespace MG_GL::GL {
|
namespace MG_GL::GL {
|
||||||
const ::GLubyte* GetString(GLenum name);
|
const GLubyte* GetString(GLenum name);
|
||||||
const ::GLubyte* GetStringi(GLenum name, GLuint index);
|
const GLubyte* GetStringi(GLenum name, GLuint index);
|
||||||
::GLenum GetError();
|
GLenum GetError();
|
||||||
void GetIntegerv(GLenum pname, GLint *params);
|
void GetIntegerv(GLenum pname, GLint *params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user