X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fextension.cpp;h=56f96d4ecee2136dcde2d42f5fbdfa7bbf8b421b;hb=055f553b1a75f44e72f3c2b5a1c98c1e1e8f3f30;hp=6ca4f08ce61728da8a1a9c994880be0d85810a97;hpb=6afbace895a7bbcf216ab8e48280ea0303ab5892;p=libs%2Fgl.git diff --git a/source/extension.cpp b/source/extension.cpp index 6ca4f08c..56f96d4e 100644 --- a/source/extension.cpp +++ b/source/extension.cpp @@ -1,5 +1,5 @@ #include -#ifndef WIN32 +#if !defined(WIN32) && !defined(__APPLE__) #define GLX_GLXEXT_PROTOTYPES #include #endif @@ -53,6 +53,13 @@ bool is_supported(const string &ext) extensions.insert(exts.begin(), exts.end()); } + string renderer = reinterpret_cast(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; } @@ -85,10 +92,13 @@ bool is_version_at_least(unsigned a, unsigned b) ExtFunc *get_proc_address(const string &name) { -#ifndef WIN32 - return glXGetProcAddressARB(reinterpret_cast(name.c_str())); -#else +#if defined(WIN32) return reinterpret_cast(wglGetProcAddress(name.c_str())); +#elif defined(__APPLE__) + (void)name; + return 0; // Not supported +#else + return glXGetProcAddressARB(reinterpret_cast(name.c_str())); #endif }