#include <set>
-#ifndef WIN32
+#if !defined(WIN32) && !defined(__APPLE__)
#define GLX_GLXEXT_PROTOTYPES
#include <GL/glx.h>
#endif
extensions.insert(exts.begin(), exts.end());
}
+ string renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ if(renderer.find("Radeon")!=string::npos)
+ /* Radeon doesn't process NV_primitive_restart correctly and treats
+ the restart index as a normal element if the indices are stored in a
+ buffer. */
+ extensions.erase("GL_NV_primitive_restart");
+
init_done = true;
}
ExtFunc *get_proc_address(const string &name)
{
-#ifndef WIN32
- return glXGetProcAddressARB(reinterpret_cast<const unsigned char *>(name.c_str()));
-#else
+#if defined(WIN32)
return reinterpret_cast<ExtFunc *>(wglGetProcAddress(name.c_str()));
+#elif defined(__APPLE__)
+ (void)name;
+ return 0; // Not supported
+#else
+ return glXGetProcAddressARB(reinterpret_cast<const unsigned char *>(name.c_str()));
#endif
}