From 6b8af9cf83851c075c6c9514b1deaa931c2b19a4 Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Fri, 16 Jan 2026 23:02:32 +0100 Subject: Initial commit --- 09-september/main.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 09-september/main.c (limited to '09-september/main.c') diff --git a/09-september/main.c b/09-september/main.c new file mode 100644 index 0000000..0f6ee58 --- /dev/null +++ b/09-september/main.c @@ -0,0 +1,61 @@ +#include "game.h" + +/** + TODO: Shadows + Fix timing + Scenes + Materials + Text + Fix particle emission rate + + +improve skybox + | + +->fog + +->day/night + + +mouse picking (is it working perfectly?) + + +add cell shading? + + improve math package + repair gui on renderer.c + improve shape loading (normal generation) (support other formats) +**/ + +int main(int args, char *argv[]) +{ + SDL_Init(SDL_INIT_EVERYTHING); + + Game game; + game.gameState = RUNNING; + game.window = window_new("Test", WINDOW_WIDTH, WINDOW_HEIGHT); + + game.camera = camera_new(); + game.camera->projectionMatrix = mat4_perspective(60.0f, WINDOW_ASPECT_RATIO, 0.1f, 900.0f); + + LoadResources(&game); + + Time_Init(); + SDL_GL_SetSwapInterval(1); + Time_SetMaxFramesPerSecond(60); + while(game.gameState != EXIT) + { + Time_Begin(); + ProcessInput(&game); + Player_Update(&game.player, game.terrain); + Particles_Update(&game.camera->position); + Draw(&game); + + float FPS = Time_End(); + + if( !( Time_GetCountedFrames() % (int)FPS ) ) + { + fprintf(stderr, "FPS: %.4f\n", FPS); + } + } + + window_destroy(game.window); + CleanUp(&game); + SDL_Quit(); + return 0; +} -- cgit v1.2.3