Skip to content

Commit

Permalink
Remove the last remains of GLEW in other platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
vanfanel committed Feb 10, 2024
1 parent 825bd12 commit 728ac56
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
6 changes: 2 additions & 4 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,9 @@ else()
endif()

if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
find_package(GLEW REQUIRED)
target_link_libraries(ImGui PUBLIC opengl32 GLEW::GLEW)
target_link_libraries(ImGui PUBLIC opengl32)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_package(GLEW REQUIRED)
target_link_libraries(ImGui PUBLIC ${OPENGL_opengl_LIBRARY} GLEW::GLEW)
target_link_libraries(ImGui PUBLIC ${OPENGL_opengl_LIBRARY})
set_target_properties(ImGui PROPERTIES
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
)
Expand Down
14 changes: 1 addition & 13 deletions src/graphic/Fast3D/gfx_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,10 @@
#define FOR_WINDOWS 0
#endif

#ifdef _MSC_VER
#include <SDL2/SDL.h>
// #define GL_GLEXT_PROTOTYPES 1
#include <GL/glew.h>
#elif FOR_WINDOWS
#include <GL/glew.h>
#ifdef FOR_WINDOWS
#include "SDL.h"
#define GL_GLEXT_PROTOTYPES 1
#include "SDL_opengl.h"
#elif __APPLE__
#include <SDL2/SDL.h>
#include <GL/glew.h>
#elif __SWITCH__
#include <SDL2/SDL.h>
#include <glad/glad.h>
Expand Down Expand Up @@ -846,10 +838,6 @@ static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_
}

static void gfx_opengl_init(void) {
#if !defined(__SWITCH__) && !defined(__linux__)
glewInit();
#endif

glGenBuffers(1, &opengl_vbo);
glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo);

Expand Down
12 changes: 4 additions & 8 deletions src/graphic/Fast3D/gfx_sdl2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,11 @@
#define FOR_WINDOWS 0
#endif

#if FOR_WINDOWS
#include <GL/glew.h>
#include "SDL.h"
#define GL_GLEXT_PROTOTYPES 1
#include "SDL_opengl.h"
#elif __APPLE__
#include <SDL.h>
#ifdef __APPLE__
#include "gfx_metal.h"
#elif __SWITCH__
#endif

#ifdef __SWITCH__
#include <SDL2/SDL.h>
#include <switch.h>
#include <glad/glad.h>
Expand Down

0 comments on commit 728ac56

Please sign in to comment.