summaryrefslogtreecommitdiff
path: root/examples/game_demo/game_demo.c
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-07-17 14:45:31 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-07-17 14:45:31 +1000
commitf8641a5cc4c8baf1f0a7be3685afc219d90143d9 (patch)
tree6f6edf43f88b456933330ec83a203bf2f414bea4 /examples/game_demo/game_demo.c
parentb9315f9cb625db09c3c41d8adf5230a67510bef7 (diff)
whole thing is compiling and running again
Diffstat (limited to 'examples/game_demo/game_demo.c')
-rw-r--r--examples/game_demo/game_demo.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/examples/game_demo/game_demo.c b/examples/game_demo/game_demo.c
index a9f91ea..ef72cc6 100644
--- a/examples/game_demo/game_demo.c
+++ b/examples/game_demo/game_demo.c
@@ -22,36 +22,42 @@ static const char* faces[6] = { "assets/demo/skybox/left.jpg", "assets/demo/sky
int main() {
Core_Bringup();
- Vec3 camera_pos = vec3(0.0, 4.0, 8.0);
- Camera cam = Camera_Create(camera_pos, vec3_negate(camera_pos), VEC3_Y, 45.0);
- SetCamera(cam); // update the camera in RenderScene
-
// TODO: Load humanoid model + weapon
// TODO: Animate it with WASD keys
// TODO: Skybox
// TODO: Add a ground terrain
// TODO: Move camera with model
+ // --- Render Scene
+ Vec3 camera_pos = vec3(0.0, 4.0, 8.0);
+ Camera cam = Camera_Create(camera_pos, vec3_negate(camera_pos), VEC3_Y, 45.0);
+ SetCamera(cam); // update the camera in RenderScene
+
+ DirectionalLight sun = {
+ .ambient = vec3(1.0, 1.0, 1.0),
+ };
+ SetMainLight(sun);
+
// --- Terrain
- Heightmap terrain = Heightmap_FromImage(str8("assets/demo/heightmap.png"));
- Terrain_LoadHeightmap(terrain, true);
- assert(Terrain_IsActive());
+ // Heightmap terrain = Heightmap_FromImage(str8("assets/demo/heightmap.png"));
+ // Terrain_LoadHeightmap(terrain, true);
+ // assert(Terrain_IsActive());
// --- Skybox
- Skybox skybox = Skybox_Create(faces, 6);
+ // Skybox skybox = Skybox_Create(faces, 6);
// --- Models
- ModelHandle player_model = ModelLoad("Player Model", "assets/demo/player.gltf");
- ModelHandle sword_model = ModelLoad("Sword Model", "assets/demo/sword.gltf");
+ // ModelHandle player_model = ModelLoad("Player Model", "assets/demo/player.gltf");
+ // ModelHandle sword_model = ModelLoad("Sword Model", "assets/demo/sword.gltf");
// --- Transforms
// TransformHierarchy* scene_tree = TransformHierarchy_Create();
// TODO: parent camera to model - to start with I can just manually update it every frame
// TODO: query joints of the gltf to get the hand bone to parent a sword to
- RenderEnt player_r = { .model = player_model, .affine = mat4_ident(), .casts_shadows = true };
+ // RenderEnt player_r = { .model = player_model, .affine = mat4_ident(), .casts_shadows = true };
- RenderEnt entities[] = { player_r };
+ // RenderEnt entities[] = { player_r };
while (!ShouldExit()) {
Frame_Begin();
@@ -59,9 +65,9 @@ int main() {
// BEGIN Draw calls
// draw the player model with shadows
- Render_RenderEntities(entities, 1);
- Render_DrawTerrain();
- Skybox_Draw(&skybox);
+ // Render_RenderEntities(entities, 1);
+ // Render_DrawTerrain();
+ // Skybox_Draw(&skybox);
// END Draw calls
Frame_Draw();