diff --git a/CMakeLists.txt b/CMakeLists.txt index 332bba3..8a4de6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,10 +82,10 @@ elseif (WIN32) target_link_libraries(${PROJECT_NAME} PUBLIC cglm glad stb_image -lmingw32 -static-libgcc SDL3::SDL3-static freetype -lws2_32) elseif (APPLE) # target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image zip -Xlinker SDL2::SDL2main SDL2::SDL2 freetype m) - target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image zip -Xlinker SDL2::SDL2main SDL2::SDL2 freetype m) + target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image -Xlinker SDL3::SDL3-static freetype m) else () # target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image zip -static-libgcc -Xlinker -export-dynamic SDL2::SDL2main SDL2::SDL2 freetype m) - target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image zip -static-libgcc -Xlinker -export-dynamic SDL2::SDL2main SDL2::SDL2 freetype m) + target_link_libraries(${PROJECT_NAME} PUBLIC glad stb_image -static-libgcc -Xlinker -export-dynamic SDL3::SDL3-static freetype m) endif () target_compile_options(${PROJECT_NAME} PUBLIC ${flags}) diff --git a/test/new_main.c b/test/new_main.c index 17072e3..49d939c 100644 --- a/test/new_main.c +++ b/test/new_main.c @@ -43,4 +43,11 @@ void seika_input_test(void) { TEST_ASSERT_FALSE(ska_input_is_key_pressed(SkaInputKey_KEYBOARD_BACKSPACE, SKA_INPUT_FIRST_PLAYER_DEVICE_INDEX)); TEST_ASSERT_FALSE(ska_input_is_key_just_pressed(SkaInputKey_KEYBOARD_BACKSPACE, SKA_INPUT_FIRST_PLAYER_DEVICE_INDEX)); TEST_ASSERT_TRUE(ska_input_is_key_just_released(SkaInputKey_KEYBOARD_BACKSPACE, SKA_INPUT_FIRST_PLAYER_DEVICE_INDEX)); + + TEST_MESSAGE("Testing input get axis input"); + ska_input_register_input_event(SkaInputSourceType_GAMEPAD, SkaInputKey_GAMEPAD_LEFT_ANALOG_2D_AXIS_Y, SkaInputTriggerType_AXIS_IN_MOTION, SKA_INPUT_FIRST_PLAYER_DEVICE_INDEX, -0.5f); + const SkaVector2 firstAxisInput = ska_input_get_axis_input(SkaInputAxis_LEFT, SKA_INPUT_FIRST_PLAYER_DEVICE_INDEX); + TEST_ASSERT_EQUAL_FLOAT(0.0f, firstAxisInput.x); + TEST_ASSERT_EQUAL_FLOAT(-0.5f, firstAxisInput.y); + }