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 16, 2024
1 parent 1e6d3c1 commit 54fa15b
Show file tree
Hide file tree
Showing 4 changed files with 15,020 additions and 31 deletions.
30 changes: 8 additions & 22 deletions source/Irrlicht/COpenGLCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,18 @@

#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>
#include <GL/wglext.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
#define GLX_GLXEXT_LEGACY 1
#include <GL/gl.h>
#include "vendor/gl.h"
#endif

#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
#include <GL/wglext.h>
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
#define GLX_GLXEXT_LEGACY 1
#include <GL/glx.h>
#include <GL/glext.h>
#include <GL/glxext.h>
#endif

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 54fa15b

Please sign in to comment.