Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Sort out header situation for non-SDL builds
Browse files Browse the repository at this point in the history
...by vendoring them
  • Loading branch information
sfan5 committed Feb 17, 2024
1 parent 487a9d6 commit f8e7d2a
Show file tree
Hide file tree
Showing 5 changed files with 15,014 additions and 30 deletions.
1 change: 0 additions & 1 deletion source/Irrlicht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ if(ENABLE_OPENGL)
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_)
elseif(DEVICE STREQUAL "OSX")
add_definitions(-D_IRR_COMPILE_WITH_NSOGL_MANAGER_)
# FIXME broken due to missing glext.h now!
endif()
endif()

Expand Down
22 changes: 2 additions & 20 deletions source/Irrlicht/COpenGLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,11 @@

#ifdef _IRR_COMPILE_WITH_OPENGL_

#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define GL_GLEXT_LEGACY 1
#include <GL/gl.h>
#include <GL/glext.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#define GL_GLEXT_LEGACY 1
#include <OpenGL/gl.h>
#error glext.h missing on OSX
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#define GL_GLEXT_LEGACY 1
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#include <SDL_video.h>
#include <SDL_opengl.h>
#ifdef __APPLE__
#include <SDL_opengl_glext.h>
#else
#include <GL/glext.h>
#endif
#else
#define GL_GLEXT_LEGACY 1
#include <GL/gl.h>
#include <GL/glext.h>
#include "vendor/gl.h"
#endif

#ifndef GL_ARB_shader_objects
Expand Down
11 changes: 2 additions & 9 deletions source/Irrlicht/OpenGL/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@

#include "irrTypes.h"
// even though we have mt_opengl.h our driver code still uses GL_* constants
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#include <GL/gl.h>
#include <GL/glext.h>
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
#include <OpenGL/gl.h>
// not sure if this works without glext.h?
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#if defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
#include <SDL_video.h>
#include <SDL_opengl.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
#include "vendor/gl.h"
#endif

namespace irr
Expand Down
Loading

0 comments on commit f8e7d2a

Please sign in to comment.