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")
elseif option.use_macosxframwork > 0 then
--todo
-- no glew
else
settings.link.libs:Add("GLEW")
end

View file

@ -6,7 +6,12 @@
#define WINVER 0x0501
#endif
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h"
#endif
#include <base/detect.h>
#include <base/math.h>
#include <stdlib.h>
@ -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);

View file

@ -1,6 +1,10 @@
#pragma once
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h"
#endif
class CGLSL {
public:
@ -16,4 +20,4 @@ private:
GLuint m_ShaderID;
int m_Type;
bool m_IsLoaded;
};
};

View file

@ -1,6 +1,10 @@
#pragma once
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "GL/glew.h"
#endif
class CGLSL;
@ -73,4 +77,4 @@ class CGLSLBorderTileLineProgram : public CGLSLTileProgram {
public:
int m_LocDir;
int m_LocNum;
};
};