aboutsummaryrefslogtreecommitdiff
path: root/09-september/main.c
diff options
context:
space:
mode:
Diffstat (limited to '09-september/main.c')
-rw-r--r--09-september/main.c61
1 files changed, 61 insertions, 0 deletions
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;
+}