Set OpenGL (ES) minimum version without force-disabling other renderers (#74)

This commit is contained in:
pezcode
2020-05-04 06:04:03 +02:00
committed by GitHub
parent 037cef04a7
commit 4264cca1f6
2 changed files with 7 additions and 2 deletions

View File

@@ -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." )

View File

@@ -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