Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Mar 25, 2024
1 parent 0cb0c27 commit 0f6e3c7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ else()
endif()

if (SK_IS_MAIN)
add_subdirectory(examples)

Check failure on line 57 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build

add_subdirectory given source "examples" which is not an existing

Check failure on line 57 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build

add_subdirectory given source "examples" which is not an existing

Check failure on line 57 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build

add_subdirectory given source "examples" which is not an existing

Check failure on line 57 in CMakeLists.txt

View workflow job for this annotation

GitHub Actions / build

add_subdirectory given source "examples" which is not an existing

# Create seika test exe
add_executable(${PROJECT_NAME}_test test/test.c)
target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME} unity)
Expand Down
2 changes: 1 addition & 1 deletion seika/input/sdl_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ SkaInputKey ska_sdl_gamepad_axis_to_input_key(SDL_GamepadAxis axis) {
}
}

static bool ska_sdl_load_gamepad_mappings() {
bool ska_sdl_load_gamepad_mappings() {
const int loadResult = SDL_AddGamepadMapping(SKA_GAMEPAD_DB_STR);
return loadResult >= 0;
}
Expand Down
13 changes: 13 additions & 0 deletions seika/seika.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ void ska_update() {
case SDL_EVENT_WINDOW_RESIZED: {
const Sint32 windowWidth = event.window.data1;
const Sint32 windowHeight = event.window.data2;
ska_renderer_update_window_size(windowWidth, windowHeight);
break;
}
default: {
Expand All @@ -116,6 +117,14 @@ void ska_update() {
}
}

void ska_fixed_update(f32 deltaTime) {
SKA_ASSERT(SKA_HAS_FLAG(SkaSystemFlag_CORE, skaState.runningSystems));

static f32 globalTime = 0.0f;
globalTime += deltaTime;
ska_renderer_set_global_shader_param_time(globalTime);
}

bool ska_is_running() {
return !skaState.shutdownRequested;
}
Expand Down Expand Up @@ -213,6 +222,10 @@ bool ska_input_init() {
return false;
}

if (!ska_sdl_load_gamepad_mappings()) {
return false;
}

return true;
}

Expand Down
1 change: 1 addition & 0 deletions seika/seika.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ bool ska_init_all(const char* title, int32 windowWidth, int32 windowHeight, int3
bool ska_init_all2(const char* title, int32 windowWidth, int32 windowHeight, int32 resolutionWidth, int32 resolutionHeight, uint32 audioWavSampleRate, bool maintainAspectRatio);
void ska_shutdown_all();
void ska_update();
void ska_fixed_update(f32 deltaTime);
bool ska_is_running();
uint64 ska_get_ticks();
void ska_delay(uint32 timeToWait);
Expand Down

0 comments on commit 0f6e3c7

Please sign in to comment.