updated ogre version
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 26 Feb 2023 15:44:52 +0000 (09:44 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sun, 26 Feb 2023 15:44:52 +0000 (09:44 -0600)
onyx-pkg.ini
run_tree/assets/shaders/basic.glsl
run_tree/assets/shaders/crt.glsl
run_tree/run.sh
src/build.onyx
src/entity/scene.onyx
src/game.onyx

index 22bddb888ac769ca10272bc2619f9b13e8e632e8..7dce445b1d2ffdafd9a85630a06bef6b456f16e3 100644 (file)
@@ -18,7 +18,7 @@ library=
 
 [dependencies]
 git://onyxlang.io/repo/openal=0.0.2
-git://onyxlang.io/repo/ogre=0.0.11
+git://onyxlang.io/repo/ogre=0.0.15
 
 [dependency_folders]
 git://onyxlang.io/repo/openal=openal
index e6522e5b3db98699b9fa220ba4d02be53876e9b6..49037a4abeb29d2a443e9f360496aba4bc4199c1 100644 (file)
@@ -7,17 +7,15 @@ COMM vec4 v_col;
 layout(location = 0) in vec2 a_pos;
 layout(location = 1) in vec4 a_col;
 
-layout(std140) uniform u_window_matrix_block {
-    mat4 u_view;
-};
-
-layout(std140) uniform u_world_matrix_block {
+layout(std140) uniform u_ogre_matrix_block {
+    mat4 u_window;
+    mat4 u_camera;
     mat4 u_world;
     mat4 u_model;
 };
 
 void main() {
-    gl_Position = u_view * u_world * u_model * vec4(a_pos, 0, 1);
+    gl_Position = u_window * u_world * u_model * vec4(a_pos, 0, 1);
     v_col = a_col;
 }
 
index 7bf64f1a958fe25fc90c3eaed0be3f745c61ddf5..488605482b4854030b0b6a60b8d8746a10fa0349 100644 (file)
@@ -17,11 +17,9 @@ layout(location = 0) in vec2 a_pos;
 layout(location = 1) in vec2 a_tex;
 layout(location = 2) in vec4 a_col;
 
-layout(std140) uniform u_window_matrix_block {
+layout(std140) uniform u_ogre_matrix_block {
     mat4 u_window;
-};
-
-layout(std140) uniform u_world_matrix_block {
+    mat4 u_camera;
     mat4 u_world;
     mat4 u_model;
 };
index b947b0bdc3a0c6fb985d3c59a7d9771f058e16e9..2932a5be59e5d4371be9a894b6f164a4de15de90 100755 (executable)
@@ -1,9 +1,9 @@
 dest=game.wasm
 
 case "$1" in
-    build) shift; onyx -V --tag -I ../src build -o $dest $@; mv tags .. ;;
+    build) shift; onyx -V -I ../src build -o $dest $@ ;;
     check) shift; onyx check -V -I ../src build  $@ ;;
     run)   onyx-run $dest ;;
     debug) shift; onyx run -V -I ../src build --debug $@ ;;
-    *)     onyx run -V --tag -I ../src build $@; mv tags .. ;;
+    *)     onyx run -V -I ../src build $@ ;;
 esac
index 712befc20af84d493d1d2be79d908c310e11eee0..da15fdb0b58073b5d132fc6247b778a0efc28424 100644 (file)
@@ -7,11 +7,6 @@ MINOR_VERSION :: 1
 DEBUG :: true
 
 
-#if runtime.arch == .X86_64  { #library_path "./lib" }
-#if runtime.arch == .AARCH64 { #library_path "./lib/aarch64" }
-
-#load "core/std"
-
 #load_all "./."
 
 #load_all "./entity"
@@ -20,5 +15,8 @@ DEBUG :: true
 #load_all "./sfx"
 #load_all "./utils"
 
-#load "./../lib/openal/module"
-#load "./../lib/ogre/module"
+#load "./../lib/packages"
+
+#if runtime.arch == .X86_64  { #library_path "./lib" }
+#if runtime.arch == .AARCH64 { #library_path "./lib/aarch64" }
+
index 31e1756819e5558d3b32305a65b1b59e0420c793..f7a8cb35ab3df280b031de90d099f90aae954933 100644 (file)
@@ -1,7 +1,6 @@
 
 use core
 use ogre
-use ogre.ui
 
 Entity_Nothing :: cast(Entity_ID) 0
 Entity_ID :: #distinct u32
index 9450b5be48c6b9681271e1be4a5b97d642695b79..d692f97b9fc884e1273ce8da9c15c80a82c181c4 100644 (file)
@@ -24,6 +24,8 @@ game_init :: () {
     Audio_Manager.set_volume(0.1);
 
     distortion_shader = shader_make("./assets/shaders/crt.glsl");
+    shader_link_ogre_matrix_block(distortion_shader);
+
     scene_canvas      = canvas_make(800, 608);
 
     // This process of queueing the asset bucket should
@@ -68,9 +70,6 @@ game_update :: (dt: f32) {
 }
 
 game_draw :: () {
-    // @REMOVE // @DEBUG
-    // Spritesheet', _ := texture_lookup(#cstr "./assets/images/spritesheet.png");
-
     canvas_use(^scene_canvas);
     immediate_clear(.{0.15, 0.15, 0.2});
     scene->draw();
@@ -109,7 +108,7 @@ game_draw :: () {
     }
     glEnable(GL_CULL_FACE);
 
-    update_world_matrix();
+    update_world_matrix(mat4_identity());
     update_model_matrix(.{0,0});
 
     if editor_shown() {