You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple data structures such as hashmap and array list (vector)
How to include in a project
Seika uses cmake to build. To include in your project, add the following to your CMakeLists.txt:
# Include old_seika framework as a dependencyinclude(FetchContent)
FetchContent_Declare(
seika
GIT_REPOSITORY https://github.com/Chukobyte/seika.git
GIT_TAG v0.2.0
)
FetchContent_MakeAvailable(seika)
Make sure to link seika to the target with target_link_libraries.
target_link_libraries(${PROJECT_NAME} seika)
Example
A simple example of creating a window and querying for inputs.
#include<stdio.h>#include<seika/seika.h>#include<seika/input/input.h>intmain(intargv, char**args) {
ska_window_initialize((SkaWindowProperties){
.title="Simple Window",
.windowWidth=800,
.windowHeight=600,
.resolutionWidth=800,
.resolutionHeight=600,
.maintainAspectRatio= true,
});
ska_input_initialize();
while (true) {
// TODO: Need to update thisska_update();
if (ska_input_is_key_just_pressed(SkaInputKey_KEYBOARD_ESCAPE, 0)) {
break;
}
if (ska_input_is_key_just_pressed(SkaInputKey_KEYBOARD_SPACE, 0)) {
printf("space just pressed\n");
}
if (ska_input_is_key_pressed(SkaInputKey_KEYBOARD_SPACE, 0)) {
printf("space pressed\n");
}
if (ska_input_is_key_just_released(SkaInputKey_KEYBOARD_SPACE, 0)) {
printf("space just released\n");
}
staticSkaColorwindowBackgroundColor= (SkaColor){ 0.2f, 0.2f, 0.2f, 1.0f };
ska_window_render(&windowBackgroundColor);
}
ska_window_finalize();
ska_input_finalize();
return0;
}