Skip to content

Commit 86a0823

Browse files
authored
Merge pull request #795 from gizmo98/opengl21
renderer: Add build option for OpenGL 2.1
2 parents c11b9ec + 1b23914 commit 86a0823

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ option(PROFILING "Set to ON to enable profiling" ${PROFILING})
1111
option(USE_MESA_GLES "Set to ON to select the MESA OpenGL ES driver" ${USE_MESA_GLES})
1212
option(USE_GLES1 "Set to ON to force usage of the OpenGLES v1 renderer" ${USE_GLES1})
1313

14+
# GL implementation overrides
15+
option(USE_GL21 "Set to ON to force usage of the OpenGL v2.1 renderer" ${USE_GL21})
16+
1417
# OpenGL library preference (https://cmake.org/cmake/help/git-stage/policy/CMP0072.html)
1518
# Set it to OLD to appease older proprietary drivers without libglvnd support
1619
if(POLICY CMP0072)
@@ -73,7 +76,11 @@ set_property(CACHE GLSystem PROPERTY STRINGS "Desktop OpenGL" "Embedded OpenGL")
7376

7477
if(${GLSystem} MATCHES "Desktop OpenGL")
7578
find_package(OpenGL REQUIRED)
76-
add_definitions(-DUSE_OPENGL_14)
79+
if(NOT USE_GL21)
80+
add_definitions(-DUSE_OPENGL_14)
81+
else()
82+
add_definitions(-DUSE_OPENGL_21)
83+
endif()
7784
else()
7885
if(NOT USE_GLES1)
7986
find_package(OpenGLES2 QUIET REQUIRED)

0 commit comments

Comments
 (0)