glew on macosx as well...

This commit is contained in:
Dennis Felsing 2017-10-20 11:49:00 +02:00
parent 9e6282d470
commit 6c7f6e3a7e
5 changed files with 7 additions and 26 deletions

View file

@ -361,8 +361,8 @@ target_include_directories(png PRIVATE ${ZLIB_INCLUDEDIR})
set(DEP_PNG $<TARGET_OBJECTS:png>)
list(APPEND TARGETS_DEP png)
set_glob(DEP_GLEW_SRC GLOB src/engine/external/glew glew.c GL/glew.h
GL/eglew.h GL/glxew.h GL/wglew.h)
set_glob(DEP_GLEW_SRC GLOB src/engine/external/glew glew.c)
set_glob(DEP_GLEW_INCLUDES GLOB src/engine/external/glew/GL eglew.h glew.h glxew.h wglew.h)
add_library(glew OBJECT EXCLUDE_FROM_ALL ${DEP_GLEW_SRC})
target_compile_definitions(glew PRIVATE GLEW_STATIC)
target_include_directories(glew PRIVATE src/engine/external/glew)

10
bam.lua
View file

@ -289,14 +289,14 @@ function build(settings)
pnglite = Compile(external_settings, Collect("src/engine/external/pnglite/*.c"))
jsonparser = Compile(external_settings, Collect("src/engine/external/json-parser/*.c"))
md5 = Compile(external_settings, "src/engine/external/md5/md5.c")
external_settings.cc.defines:Add("GLEW_STATIC")
external_settings.cc.flags:Add("-I src/engine/external/glew")
glew = Compile(external_settings, Collect("src/engine/external/glew/*.c"))
if config.websockets.value then
libwebsockets = Compile(external_settings, Collect("src/engine/external/libwebsockets/*.c"))
end
if platform ~= "macosx" then
external_settings.cc.defines:Add("GLEW_STATIC")
external_settings.cc.flags:Add("-I src/engine/external/glew")
glew = Compile(external_settings, Collect("src/engine/external/glew/*.c"))
end
-- build game components
engine_settings = settings:Copy()

View file

@ -6,12 +6,7 @@
#define WINVER 0x0501
#endif
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#include <OpenGL/gl3ext.h>
#else
#include "engine/external/glew/GL/glew.h"
#endif
#include <base/detect.h>
#include <base/math.h>
@ -1682,12 +1677,10 @@ int CGraphicsBackend_SDL_OpenGL::Init(const char *pName, int *Screen, int *pWidt
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,12 +1,6 @@
#pragma once
#include <base/detect.h>
#if defined(CONF_PLATFORM_MACOSX)
#include <OpenGL/gl3.h>
#else
#include "engine/external/glew/GL/glew.h"
#endif
class CGLSL {
public:

View file

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