Added a font registry, a text rendering helper, and an FPS counter function
This commit is contained in:
@@ -7,6 +7,7 @@ find_package(PkgConfig REQUIRED)
|
||||
find_package(SDL3 REQUIRED)
|
||||
find_package(SDL3_image REQUIRED)
|
||||
find_package(SDL3_mixer REQUIRED)
|
||||
find_package(SDL3_ttf REQUIRED)
|
||||
find_package(akerror REQUIRED)
|
||||
find_package(jansson REQUIRED)
|
||||
find_package(box2d REQUIRED)
|
||||
@@ -36,6 +37,7 @@ include_directories(${SDL3_INCLUDE_DIRS})
|
||||
add_library(sdl3game SHARED
|
||||
src/actor.c
|
||||
src/actor_state_string_names.c
|
||||
src/text.c
|
||||
src/assets.c
|
||||
src/character.c
|
||||
src/draw.c
|
||||
@@ -81,23 +83,25 @@ target_link_libraries(sdl3game
|
||||
SDL3::SDL3
|
||||
SDL3_image::SDL3_image
|
||||
SDL3_mixer::SDL3_mixer
|
||||
SDL3_ttf::SDL3_ttf
|
||||
)
|
||||
|
||||
target_link_libraries(test_actor PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_bitmasks PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_character PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_registry PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_sprite PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_staticstring PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_tilemap PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_util PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_actor PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_bitmasks PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_character PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_registry PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_sprite PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_staticstring PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_tilemap PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(test_util PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
|
||||
target_link_libraries(charviewer PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
target_link_libraries(charviewer PRIVATE akerror::akerror sdl3game SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm)
|
||||
|
||||
set(main_lib_dest "lib/sdl3game-${MY_LIBRARY_VERSION}")
|
||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/sdl3game.pc DESTINATION "lib/pkgconfig/")
|
||||
install(TARGETS sdl3game DESTINATION "lib/")
|
||||
install(FILES "include/sdl3game/actor.h" DESTINATION "include/sdl3game/")
|
||||
install(FILES "include/sdl3game/text.h" DESTINATION "include/sdl3game/")
|
||||
install(FILES "include/sdl3game/assets.h" DESTINATION "include/sdl3game/")
|
||||
install(FILES "include/sdl3game/character.h" DESTINATION "include/sdl3game/")
|
||||
install(FILES "include/sdl3game/error.h" DESTINATION "include/sdl3game/")
|
||||
|
||||
Reference in New Issue
Block a user