diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ac296c5a..6e2a5021f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,8 +361,8 @@ target_include_directories(png PRIVATE ${ZLIB_INCLUDEDIR}) set(DEP_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) diff --git a/bam.lua b/bam.lua index 13e2c422d..5409d1a96 100644 --- a/bam.lua +++ b/bam.lua @@ -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() diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 2a15627a0..921ad10cd 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -6,12 +6,7 @@ #define WINVER 0x0501 #endif -#if defined(CONF_PLATFORM_MACOSX) -#include -#include -#else #include "engine/external/glew/GL/glew.h" -#endif #include #include @@ -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); diff --git a/src/engine/client/opengl_sl.h b/src/engine/client/opengl_sl.h index c4d41aa95..d47203285 100644 --- a/src/engine/client/opengl_sl.h +++ b/src/engine/client/opengl_sl.h @@ -1,12 +1,6 @@ #pragma once -#include - -#if defined(CONF_PLATFORM_MACOSX) -#include -#else #include "engine/external/glew/GL/glew.h" -#endif class CGLSL { public: diff --git a/src/engine/client/opengl_sl_program.h b/src/engine/client/opengl_sl_program.h index 7273c7406..3cc04b593 100644 --- a/src/engine/client/opengl_sl_program.h +++ b/src/engine/client/opengl_sl_program.h @@ -1,12 +1,6 @@ #pragma once -#include - -#if defined(CONF_PLATFORM_MACOSX) -#include -#else #include "engine/external/glew/GL/glew.h" -#endif class CGLSL;