added some opengl files TODO: fix up using glew as optional

This commit is contained in:
herbglitch 2024-01-19 01:17:19 -07:00
parent c614c679a9
commit d170a64a41
24 changed files with 164 additions and 93 deletions

26
cmake/archeus_glfw.cmake Normal file
View file

@ -0,0 +1,26 @@
set(ARCHEUS_STD_GLFW_WINDOW_SOURCES
src/graphics/glfw/config.c
src/graphics/glfw/renderer.c
src/graphics/glfw/window.c
)
set(ARCHEUS_STD_GLFW_INPUT_SOURCES
src/input/glfw/keyboard.c
src/input/glfw/mouse.c
)
function(glfw_check_and_init_needed _ARCHEUS_STD_FLAGS _ARCHEUS_STD_SOURCES ARCHEUS_STD_WINDOW_BACKEND ARCHEUS_STD_INPUT_BACKEND)
#add matching files for the selected backends
if(${ARCHEUS_STD_WINDOW_BACKEND} STREQUAL "GLFW")
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -DARC_GLFW_WINDOW ")
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_WINDOW_SOURCES})
endif()
if(${ARCHEUS_STD_INPUT_BACKEND} STREQUAL "GLFW")
string(APPEND ${_ARCHEUS_STD_FLAGS} "-lglfw -lGLEW -DARC_GLFW_INPUT ")
list(APPEND ${_ARCHEUS_STD_SOURCES} ${ARCHEUS_STD_GLFW_INPUT_SOURCES})
endif()
set(${_ARCHEUS_STD_FLAGS} ${${_ARCHEUS_STD_FLAGS}} PARENT_SCOPE)
set(${_ARCHEUS_STD_SOURCES} ${${_ARCHEUS_STD_SOURCES}} PARENT_SCOPE)
endfunction()