summaryrefslogtreecommitdiff
path: root/bindgen
diff options
context:
space:
mode:
authoromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-22 00:19:58 +1000
committeromniscient <17525998+omnisci3nce@users.noreply.github.com>2024-07-22 00:19:58 +1000
commit4f09bcb7dc48dc9b0d97ce3a9f73ffc6eee49045 (patch)
treee94bb84660061941c12eb25455a1a855649416a7 /bindgen
parentda1ddc29ac15e511086b8b5343b735a34be1fcea (diff)
error handling loading pbr textures
Diffstat (limited to 'bindgen')
-rw-r--r--bindgen/rust/examples/main_loop.rs58
1 files changed, 35 insertions, 23 deletions
diff --git a/bindgen/rust/examples/main_loop.rs b/bindgen/rust/examples/main_loop.rs
index a74e11c..8da3e9a 100644
--- a/bindgen/rust/examples/main_loop.rs
+++ b/bindgen/rust/examples/main_loop.rs
@@ -1,32 +1,44 @@
use celeritas::*;
unsafe fn run_game() {
- // init
- Core_Bringup();
-
- // let mut cube_geo = Geo_CreateCuboid(Vec3 { x: 1.0, y: 1.0, z: 1.0 });
- // let cube = Mesh_Create(&mut cube_geo, false);
-
- let camera_pos = Vec3 { x: 0.0, y: 2.0, z: -3.0 };
- let pos_y = Vec3 { x: 0., y: 1.0, z: 0. };
- let camera = Camera_Create(camera_pos, vec3_normalise(vec3_negate(camera_pos)), pos_y, 45.0);
- SetCamera(camera);
- // let camera = Camera_Create(camera_pos, vec3_normalise(vec3_negate(camera_pos)), VEC3_Y, 45.0);
- // SetCamera(cam); // update the camera in RenderScene
-
- let whatever = Vec3 { x: 1.0, y: 1.0, z: 1.0 };
- let sun = DirectionalLight { direction: whatever, ambient: whatever, diffuse: whatever, specular: whatever };
- SetMainLight(sun);
-
- // Skybox skybox = Skybox_Create(faces, 6);
- let skybox = Skybox_Create(face_paths, 6);
-
+ // init
+ Core_Bringup();
+
+ let camera_pos = Vec3 {
+ x: 0.0,
+ y: 2.0,
+ z: -3.0,
+ };
+ let camera = Camera_Create(
+ camera_pos,
+ vec3_normalise(vec3_negate(camera_pos)),
+ VEC3_Y,
+ 45.0,
+ );
+ SetCamera(camera);
+
+ let whatever = Vec3 {
+ x: 1.0,
+ y: 1.0,
+ z: 1.0,
+ };
+ let sun = DirectionalLight {
+ direction: whatever,
+ ambient: whatever,
+ diffuse: whatever,
+ specular: whatever,
+ };
+ SetMainLight(sun);
+
+ let skybox = Skybox_Create(face_paths, 6);
+
+ // main loop
while !ShouldExit() {
- Frame_Begin();
-
+ Frame_Begin();
+ Skybox_Draw(&mut skybox, camera);
- Frame_End();
+ Frame_End();
}
}