diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-20 21:17:46 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-20 21:17:46 +1000 |
commit | dc8952e6650aae6297915bf118e1f7b1259d235d (patch) | |
tree | 98ef132262fa0e01c7df5cac7f73c825a65d09ed /examples | |
parent | 58a748dcd77d0caacc9d6ef7a7e7e073ac849ad3 (diff) |
fixing shadows.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/game_demo/game_demo.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/examples/game_demo/game_demo.c b/examples/game_demo/game_demo.c index f4cf643..734bff1 100644 --- a/examples/game_demo/game_demo.c +++ b/examples/game_demo/game_demo.c @@ -6,12 +6,15 @@ #include <assert.h> #include "camera.h" #include "core.h" +#include "input.h" +#include "keys.h" #include "maths.h" #include "primitives.h" #include "ral_types.h" #include "render.h" #include "render_scene.h" #include "render_types.h" +#include "shadows.h" #include "skybox.h" static const char* faces[6] = { "assets/demo/skybox/right.jpg", "assets/demo/skybox/left.jpg", @@ -83,17 +86,29 @@ int main() { // RenderEnt entities[] = { player_r }; + bool draw_debug = true; + while (!ShouldExit()) { Frame_Begin(); + if (key_just_released(KEYCODE_TAB)) { + draw_debug = !draw_debug; + } + Camera_Update(&cam); SetCamera(cam); // BEGIN Draw calls - // draw the player model with shadows - Render_RenderEntities(entities, entity_count); - // Render_DrawTerrain(); - Skybox_Draw(&skybox, cam); + Shadow_Run(entities, entity_count); + + if (draw_debug) { + // draw the player model with shadows + Render_RenderEntities(entities, entity_count); + // Render_DrawTerrain(); + Skybox_Draw(&skybox, cam); + } else { + Shadow_DrawDebugQuad(); + } // END Draw calls Frame_Draw(); |