Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GLVND OpenGL detection as a GLX(X11) alternative and remove the glut header #581

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,17 @@ IF (APPLE)
find_package(SDL2_ttf REQUIRED)
find_package(IOKit REQUIRED)
ELSE (APPLE)
find_package(OpenGL REQUIRED)

find_package(OpenGL QUIET)
IF(OpenGL_FOUND)
message(STATUS "Using OpenGL GLX for OpenGL")
ELSE(OpenGL_FOUND)
# If we couldn't find old GLX package, try to use modern libglvnd libOpenGL.so instead.
message(STATUS "Using GLVND for OpenGL")
FIND_LIBRARY(OpenGL_LIBRARY OpenGL)
SET(EXTRA_LIBS ${OpenGL_LIBRARY})
ENDIF(OpenGL_FOUND)

IF(NOT WIN32)
INCLUDE(FindPkgConfig)
PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
Expand Down
1 change: 0 additions & 1 deletion src/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ extern bool autoLimbReload;
#ifndef NINTENDO
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#include <GL/glext.h>
#include "SDL_opengl.h"
Expand Down