mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
2da1c1c10e
We now generate all LibGL API wrappers from a single API method definition list stored in `GLAPI.json`. Since a significant portion of the OpenGL API methods are relatively consistent variants, we take advantage of this to generate a lot of these variants at once. The autogenerated methods check for the non-nullness of the current `GLContext`, and only perform an action if a `GLContext` is present. This prevents a crash in ports like GLTron, who assume you can still call the OpenGL API without an active context. This increases our API wrapper method count from 211 to 356. Fixes #15814.
14 lines
451 B
CMake
14 lines
451 B
CMake
function (generate_libgl_implementation)
|
|
set(LIBGL_INPUT_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
|
|
invoke_generator(
|
|
"GLAPI.cpp"
|
|
Lagom::GenerateGLAPIWrapper
|
|
"${LIBGL_INPUT_FOLDER}/GLAPI.json"
|
|
"GL/glapi.h"
|
|
"GLAPI.cpp"
|
|
arguments -j "${LIBGL_INPUT_FOLDER}/GLAPI.json"
|
|
)
|
|
|
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/GL/glapi.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/LibGL/GL/")
|
|
endfunction()
|