Skip to content

Commit

Permalink
renderer: Add build option for OpenGL 2.1
Browse files Browse the repository at this point in the history
Add option USE_GL21 which can be activated with „-DUSE_GL21=On“. Use
OpenGL 1.4 by default for backward compatibility.
  • Loading branch information
gizmo98 committed Jun 12, 2022
1 parent c11b9ec commit 1b23914
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ option(PROFILING "Set to ON to enable profiling" ${PROFILING})
option(USE_MESA_GLES "Set to ON to select the MESA OpenGL ES driver" ${USE_MESA_GLES})
option(USE_GLES1 "Set to ON to force usage of the OpenGLES v1 renderer" ${USE_GLES1})

# GL implementation overrides
option(USE_GL21 "Set to ON to force usage of the OpenGL v2.1 renderer" ${USE_GL21})

# OpenGL library preference (https://cmake.org/cmake/help/git-stage/policy/CMP0072.html)
# Set it to OLD to appease older proprietary drivers without libglvnd support
if(POLICY CMP0072)
Expand Down Expand Up @@ -73,7 +76,11 @@ set_property(CACHE GLSystem PROPERTY STRINGS "Desktop OpenGL" "Embedded OpenGL")

if(${GLSystem} MATCHES "Desktop OpenGL")
find_package(OpenGL REQUIRED)
add_definitions(-DUSE_OPENGL_14)
if(NOT USE_GL21)
add_definitions(-DUSE_OPENGL_14)
else()
add_definitions(-DUSE_OPENGL_21)
endif()
else()
if(NOT USE_GLES1)
find_package(OpenGLES2 QUIET REQUIRED)
Expand Down

0 comments on commit 1b23914

Please sign in to comment.