Expand glutGetProcAddress() to support core GL functions too under Haiku,
now that we do have a way to retrieve such address. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38579 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -221,3 +221,15 @@ int glutGetModifiers() {
|
||||
return gState.modifierKeys;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __HAIKU__
|
||||
|
||||
GLUTproc
|
||||
__glutGetProcAddress(const char* procName)
|
||||
{
|
||||
if (gState.currentWindow)
|
||||
return (GLUTproc) gState.currentWindow->GetGLProcAddress(procName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -176,24 +176,30 @@ static struct name_address_pair glut_functions[] = {
|
||||
};
|
||||
|
||||
|
||||
#ifdef __HAIKU__
|
||||
extern GLUTproc __glutGetProcAddress(const char* procName);
|
||||
#endif
|
||||
|
||||
/* XXX This isn't an official GLUT function, yet */
|
||||
GLUTproc GLUTAPIENTRY
|
||||
glutGetProcAddress(const char *procName)
|
||||
{
|
||||
/* Try GLUT functions first */
|
||||
int i;
|
||||
for (i = 0; glut_functions[i].name; i++) {
|
||||
if (strcmp(glut_functions[i].name, procName) == 0)
|
||||
return glut_functions[i].address;
|
||||
}
|
||||
/* Try GLUT functions first */
|
||||
int i;
|
||||
for (i = 0; glut_functions[i].name; i++) {
|
||||
if (strcmp(glut_functions[i].name, procName) == 0)
|
||||
return glut_functions[i].address;
|
||||
}
|
||||
|
||||
/* Try core GL functions */
|
||||
/* Try core GL functions */
|
||||
#if defined(_WIN32)
|
||||
return (GLUTProc) wglGetProcAddress((LPCSTR) procName);
|
||||
return (GLUTProc) wglGetProcAddress((LPCSTR) procName);
|
||||
#elif defined(GLX_ARB_get_proc_address)
|
||||
return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName);
|
||||
return (GLUTProc) glXGetProcAddressARB((const GLubyte *) procName);
|
||||
#elif defined(__HAIKU__)
|
||||
return __glutGetProcAddress(procName);
|
||||
#else
|
||||
return NULL;
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user