Can now build with OpenGL ES 3.1
This commit is contained in:
parent
6cec654d4c
commit
b6b1b895a2
8 changed files with 5961 additions and 3280 deletions
|
|
@ -7,6 +7,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||
# Options to set
|
||||
option(USE_VULKAN "Set to use Vulkan" OFF)
|
||||
option(USE_GRAPHITE "Set to use Skia graphite for backends that support it" OFF)
|
||||
option(USE_OPENGLES "Use OpenGL ES 3.1 instead of OpenGL 3.3" OFF)
|
||||
|
||||
option(USE_ASAN "Enable Address Sanitizer" OFF)
|
||||
option(USE_UBSAN "Enable Undefined Behaviour Sanitizer" OFF)
|
||||
|
|
@ -101,7 +102,11 @@ if(USE_VULKAN)
|
|||
)
|
||||
endif()
|
||||
elseif(NOT EMSCRIPTEN)
|
||||
list(APPEND sources "include/glad.c")
|
||||
if(USE_OPENGLES)
|
||||
list(APPEND sources "include/glad/gles2.c")
|
||||
else()
|
||||
list(APPEND sources "include/glad/gl.c")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
|
|
@ -227,7 +232,11 @@ endif()
|
|||
|
||||
if((NOT USE_VULKAN) AND (NOT EMSCRIPTEN))
|
||||
find_package(OpenGL REQUIRED)
|
||||
target_link_libraries(infinipaint OpenGL::GL)
|
||||
if(USE_OPENGLES)
|
||||
target_link_libraries(infinipaint OpenGL::GLES3)
|
||||
else()
|
||||
target_link_libraries(infinipaint OpenGL::GL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((NOT EMSCRIPTEN) AND (NOT APPLE))
|
||||
|
|
@ -266,6 +275,9 @@ if(USE_VULKAN)
|
|||
target_compile_definitions(infinipaint PRIVATE USE_SKIA_BACKEND_GANESH)
|
||||
endif()
|
||||
else()
|
||||
if(USE_OPENGLES)
|
||||
target_compile_definitions(infinipaint PRIVATE USING_OPENGLES)
|
||||
endif()
|
||||
target_compile_definitions(infinipaint PRIVATE USE_BACKEND_OPENGL USE_SKIA_BACKEND_GANESH)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue