From db46d18e71522eb63331ef8a7ba67ffe8bd93dc6 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 20 Oct 2017 09:08:49 +0200 Subject: [PATCH] No GLEW on OSX necessary (untested) --- other/glew.lua | 2 +- src/engine/client/backend_sdl.cpp | 9 ++++++++- src/engine/client/opengl_sl.h | 6 +++++- src/engine/client/opengl_sl_program.h | 6 +++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/other/glew.lua b/other/glew.lua index 009fbbde4..fc690e9cf 100644 --- a/other/glew.lua +++ b/other/glew.lua @@ -36,7 +36,7 @@ Glew = { settings.link.libs:Add("glew32") elseif option.use_macosxframwork > 0 then - --todo + -- no glew else settings.link.libs:Add("GLEW") end diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 36ad6b17e..4eb52be89 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -6,7 +6,12 @@ #define WINVER 0x0501 #endif +#if defined(CONF_PLATFORM_MACOSX) +#include +#else #include "GL/glew.h" +#endif + #include #include #include @@ -1675,11 +1680,13 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt dbg_msg("gfx", "unable to create OpenGL context: %s", SDL_GetError()); return -1; } - + +#if defined(CONF_PLATFORM_MACOSX) //support graphic cards that are pretty old(and linux) glewExperimental = GL_TRUE; if (GLEW_OK != glewInit()) return -1; +#endif SDL_GL_GetDrawableSize(m_pWindow, pWidth, pHeight); SDL_GL_SetSwapInterval(Flags&IGraphicsBackend::INITFLAG_VSYNC ? 1 : 0); diff --git a/src/engine/client/opengl_sl.h b/src/engine/client/opengl_sl.h index aec85c05a..8adf1619f 100644 --- a/src/engine/client/opengl_sl.h +++ b/src/engine/client/opengl_sl.h @@ -1,6 +1,10 @@ #pragma once +#if defined(CONF_PLATFORM_MACOSX) +#include +#else #include "GL/glew.h" +#endif class CGLSL { public: @@ -16,4 +20,4 @@ private: GLuint m_ShaderID; int m_Type; bool m_IsLoaded; -}; \ No newline at end of file +}; diff --git a/src/engine/client/opengl_sl_program.h b/src/engine/client/opengl_sl_program.h index 810243dbb..2af42d4c3 100644 --- a/src/engine/client/opengl_sl_program.h +++ b/src/engine/client/opengl_sl_program.h @@ -1,6 +1,10 @@ #pragma once +#if defined(CONF_PLATFORM_MACOSX) +#include +#else #include "GL/glew.h" +#endif class CGLSL; @@ -73,4 +77,4 @@ class CGLSLBorderTileLineProgram : public CGLSLTileProgram { public: int m_LocDir; int m_LocNum; -}; \ No newline at end of file +};