From 4264cca1f6d7b1e6d50c18dfe8ca67898e2faa98 Mon Sep 17 00:00:00 2001 From: pezcode Date: Mon, 4 May 2020 06:04:03 +0200 Subject: [PATCH] Set OpenGL (ES) minimum version without force-disabling other renderers (#74) --- CMakeLists.txt | 3 ++- cmake/bgfx.cmake | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcd50ae..a6d963c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,8 @@ option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OF option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF ) option( BGFX_CONFIG_DEBUG "Enables debug configuration on all builds" OFF ) option( BGFX_USE_DEBUG_SUFFIX "Add 'd' suffix to debug output targets" ON ) -set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" ) +set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum OpenGL version" ) +set( BGFX_OPENGLES_VERSION "" CACHE STRING "Specify minimum OpenGL ES version" ) if( NOT BX_DIR ) set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." ) diff --git a/cmake/bgfx.cmake b/cmake/bgfx.cmake index d40a33b..4bbdb28 100755 --- a/cmake/bgfx.cmake +++ b/cmake/bgfx.cmake @@ -49,7 +49,11 @@ if(BGFX_CONFIG_DEBUG) endif() if( NOT ${BGFX_OPENGL_VERSION} STREQUAL "" ) - target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGL=${BGFX_OPENGL_VERSION}) + target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGL_MIN_VERSION=${BGFX_OPENGL_VERSION} ) +endif() + +if( NOT ${BGFX_OPENGLES_VERSION} STREQUAL "" ) + target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION=${BGFX_OPENGLES_VERSION} ) endif() # Special Visual Studio Flags