No GLEW on OSX necessary (untested)

This commit is contained in:
Dennis Felsing 2017-10-20 09:08:49 +02:00
parent 96bad9f3f2
commit db46d18e71
4 changed files with 19 additions and 4 deletions

View file

@ -36,7 +36,7 @@ Glew = {
settings.link.libs:Add("glew32") settings.link.libs:Add("glew32")
elseif option.use_macosxframwork > 0 then elseif option.use_macosxframwork > 0 then
--todo -- no glew
else else
settings.link.libs:Add("GLEW") settings.link.libs:Add("GLEW")
end end

View file

@ -6,7 +6,12 @@
#define WINVER 0x0501 #define WINVER 0x0501
#endif #endif
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h" #include "GL/glew.h"
#endif
#include <base/detect.h> #include <base/detect.h>
#include <base/math.h> #include <base/math.h>
#include <stdlib.h> #include <stdlib.h>
@ -1676,10 +1681,12 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
return -1; return -1;
} }
#if defined(CONF_PLATFORM_MACOSX)
//support graphic cards that are pretty old(and linux) //support graphic cards that are pretty old(and linux)
glewExperimental = GL_TRUE; glewExperimental = GL_TRUE;
if (GLEW_OK != glewInit()) if (GLEW_OK != glewInit())
return -1; return -1;
#endif
SDL_GL_GetDrawableSize(m_pWindow, pWidth, pHeight); SDL_GL_GetDrawableSize(m_pWindow, pWidth, pHeight);
SDL_GL_SetSwapInterval(Flags&IGraphicsBackend::INITFLAG_VSYNC ? 1 : 0); SDL_GL_SetSwapInterval(Flags&IGraphicsBackend::INITFLAG_VSYNC ? 1 : 0);

View file

@ -1,6 +1,10 @@
#pragma once #pragma once
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h" #include "GL/glew.h"
#endif
class CGLSL { class CGLSL {
public: public:

View file

@ -1,6 +1,10 @@
#pragma once #pragma once
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h" #include "GL/glew.h"
#endif
class CGLSL; class CGLSL;