fix macOS build failure of MeshGui
This commit is contained in:
@@ -88,7 +88,9 @@ public:
|
||||
{
|
||||
if (bufferId > 0)
|
||||
return true;
|
||||
#ifdef FC_OS_WIN32
|
||||
PFNGLGENBUFFERSPROC glGenBuffersARB = (PFNGLGENBUFFERSPROC)cc_glglue_getprocaddress(glue, "glGenBuffersARB");
|
||||
#endif
|
||||
glGenBuffersARB(1, &bufferId);
|
||||
context = currentContext;
|
||||
return true;
|
||||
@@ -109,7 +111,9 @@ public:
|
||||
void allocate(const void *data, int count)
|
||||
{
|
||||
if (bufferId > 0) {
|
||||
#ifdef FC_OS_WIN32
|
||||
PFNGLBUFFERDATAPROC glBufferDataARB = (PFNGLBUFFERDATAPROC)cc_glglue_getprocaddress(glue, "glBufferDataARB");
|
||||
#endif
|
||||
glBufferDataARB(target, count, data, GL_STATIC_DRAW);
|
||||
}
|
||||
}
|
||||
@@ -121,7 +125,9 @@ public:
|
||||
"buffer not created");
|
||||
return false;
|
||||
}
|
||||
#ifdef FC_OS_WIN32
|
||||
PFNGLBINDBUFFERPROC glBindBufferARB = (PFNGLBINDBUFFERPROC)cc_glglue_getprocaddress(glue, "glBindBufferARB");
|
||||
#endif
|
||||
glBindBufferARB(target, bufferId);
|
||||
return true;
|
||||
}
|
||||
@@ -130,7 +136,9 @@ public:
|
||||
void release()
|
||||
{
|
||||
if (bufferId) {
|
||||
#ifdef FC_OS_WIN32
|
||||
PFNGLBINDBUFFERPROC glBindBufferARB = (PFNGLBINDBUFFERPROC)cc_glglue_getprocaddress(glue, "glBindBufferARB");
|
||||
#endif
|
||||
glBindBufferARB(target, 0);
|
||||
}
|
||||
}
|
||||
@@ -146,7 +154,9 @@ public:
|
||||
{
|
||||
GLint value = -1;
|
||||
if (bufferId > 0) {
|
||||
#ifdef FC_OS_WIN32
|
||||
PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)cc_glglue_getprocaddress(glue, "glGetBufferParameterivARB");
|
||||
#endif
|
||||
glGetBufferParameteriv(target, GL_BUFFER_SIZE, &value);
|
||||
}
|
||||
return value;
|
||||
@@ -158,8 +168,10 @@ private:
|
||||
CoinOpenGLBuffer * self = static_cast<CoinOpenGLBuffer*>(userdata);
|
||||
|
||||
if (self->context == context && self->bufferId) {
|
||||
#ifdef FC_OS_WIN32
|
||||
const cc_glglue * glue = cc_glglue_instance((int) context);
|
||||
PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)cc_glglue_getprocaddress(glue, "glDeleteBuffersARB");
|
||||
#endif
|
||||
|
||||
GLuint buffer = self->bufferId;
|
||||
glDeleteBuffersARB(1, &buffer);
|
||||
|
||||
Reference in New Issue
Block a user