From 0da0dddf15f83ca74b927b0a67cf7bad92d72e32 Mon Sep 17 00:00:00 2001 From: Ryozuki Date: Wed, 8 Apr 2020 15:55:10 +0200 Subject: [PATCH] drop glu dependency --- CMakeLists.txt | 4 ++-- src/engine/client/backend_sdl.cpp | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a7232ebc..e63ca1a84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -454,7 +454,7 @@ endif() if(TARGET_OS STREQUAL "windows") set(PLATFORM_CLIENT) - set(PLATFORM_CLIENT_LIBS opengl32 glu32 winmm) + set(PLATFORM_CLIENT_LIBS opengl32 winmm) set(PLATFORM_LIBS ws2_32) # Windows sockets elseif(TARGET_OS STREQUAL "mac") find_library(CARBON Carbon) @@ -472,7 +472,7 @@ else() set(PLATFORM_CLIENT) find_package(OpenGL) find_package(X11) - set(PLATFORM_CLIENT_LIBS ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${X11_X11_LIB}) + set(PLATFORM_CLIENT_LIBS ${OPENGL_gl_LIBRARY} ${X11_X11_LIB}) set(PLATFORM_CLIENT_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH}) if(TARGET_OS STREQUAL "linux") set(PLATFORM_LIBS rt) # clock_gettime for glibc < 2.17 diff --git a/src/engine/client/backend_sdl.cpp b/src/engine/client/backend_sdl.cpp index 31bf253f7..9d6b0b953 100644 --- a/src/engine/client/backend_sdl.cpp +++ b/src/engine/client/backend_sdl.cpp @@ -15,12 +15,7 @@ #include #include "SDL.h" #include "SDL_syswm.h" -#if defined(CONF_PLATFORM_MACOSX) -#include "OpenGL/glu.h" -#else #include "SDL_opengl.h" -#include "GL/glu.h" -#endif #if defined(SDL_VIDEO_DRIVER_X11) #include @@ -353,7 +348,8 @@ void CCommandProcessorFragment_OpenGL::Cmd_Texture_Create(const CCommandBuffer:: { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); - gluBuild2DMipmaps(GL_TEXTURE_2D, StoreOglformat, Width, Height, Oglformat, GL_UNSIGNED_BYTE, pTexData); + glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); + glTexImage2D(GL_TEXTURE_2D, 0, StoreOglformat, Width, Height, 0, Oglformat, GL_UNSIGNED_BYTE, pTexData); } // calculate memory usage