From 61656d633b6a5695beb2a4846264c510a93e3f59 Mon Sep 17 00:00:00 2001 From: Amar Takhar Date: Fri, 13 Aug 2010 00:24:35 +0000 Subject: [PATCH] * Make GL_EXT() a noop on OS X, it's not required. * Conditionalise glMultiDrawArraysFallback since it's not used on OS X. * Stub APIENTRY at the top of visual_tool_vector_clip.cpp, this should never be added to a header but at the top of source files. Originally committed to SVN as r4737. --- aegisub/src/gl_wrap.h | 7 ++++++- aegisub/src/visual_tool_vector_clip.cpp | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/aegisub/src/gl_wrap.h b/aegisub/src/gl_wrap.h index 1e6c66162..72eddfea1 100644 --- a/aegisub/src/gl_wrap.h +++ b/aegisub/src/gl_wrap.h @@ -57,12 +57,17 @@ typedef GLuint GLhandleARB; #define glGetProc(a) glXGetProcAddress((const GLubyte *)(a)) #endif +#if defined(__APPLE__) +// Not required on OS X. +#define GL_EXT(type, name) +#else + #define GL_EXT(type, name) \ static type name = reinterpret_cast(glGetProc(#name)); \ if (!name) { \ name = & name ## Fallback; \ } - +#endif /// DOCME diff --git a/aegisub/src/visual_tool_vector_clip.cpp b/aegisub/src/visual_tool_vector_clip.cpp index cb234492e..b11030049 100644 --- a/aegisub/src/visual_tool_vector_clip.cpp +++ b/aegisub/src/visual_tool_vector_clip.cpp @@ -47,6 +47,11 @@ #include #endif +#ifdef __APPLE__ +/// Noop macro, this should never be defined in a header. +#define APIENTRY +#endif + #include "config.h" #include "ass_dialogue.h" @@ -112,11 +117,14 @@ void VisualToolVectorClip::SetMode(int newMode) { } // Substitute for glMultiDrawArrays for sub-1.4 OpenGL +// Not required on OS X. +#ifndef __APPLE__ static void APIENTRY glMultiDrawArraysFallback(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) { for (int i = 0; i < primcount; ++i) { glDrawArrays(mode, *first++, *count++); } } +#endif static bool is_move(SplineCurve const& c) { return c.type == CURVE_POINT;