From 9a9af6deaaf5d0dce339b76a3a39c25e04ec4fff Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sun, 26 Feb 2023 09:44:52 -0600 Subject: [PATCH] updated ogre version --- onyx-pkg.ini | 2 +- run_tree/assets/shaders/basic.glsl | 10 ++++------ run_tree/assets/shaders/crt.glsl | 6 ++---- run_tree/run.sh | 4 ++-- src/build.onyx | 12 +++++------- src/entity/scene.onyx | 1 - src/game.onyx | 7 +++---- 7 files changed, 17 insertions(+), 25 deletions(-) diff --git a/onyx-pkg.ini b/onyx-pkg.ini index 22bddb8..7dce445 100644 --- a/onyx-pkg.ini +++ b/onyx-pkg.ini @@ -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 diff --git a/run_tree/assets/shaders/basic.glsl b/run_tree/assets/shaders/basic.glsl index e6522e5..49037a4 100644 --- a/run_tree/assets/shaders/basic.glsl +++ b/run_tree/assets/shaders/basic.glsl @@ -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; } diff --git a/run_tree/assets/shaders/crt.glsl b/run_tree/assets/shaders/crt.glsl index 7bf64f1..4886054 100644 --- a/run_tree/assets/shaders/crt.glsl +++ b/run_tree/assets/shaders/crt.glsl @@ -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; }; diff --git a/run_tree/run.sh b/run_tree/run.sh index b947b0b..2932a5b 100755 --- a/run_tree/run.sh +++ b/run_tree/run.sh @@ -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 diff --git a/src/build.onyx b/src/build.onyx index 712befc..da15fdb 100644 --- a/src/build.onyx +++ b/src/build.onyx @@ -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" } + diff --git a/src/entity/scene.onyx b/src/entity/scene.onyx index 31e1756..f7a8cb3 100644 --- a/src/entity/scene.onyx +++ b/src/entity/scene.onyx @@ -1,7 +1,6 @@ use core use ogre -use ogre.ui Entity_Nothing :: cast(Entity_ID) 0 Entity_ID :: #distinct u32 diff --git a/src/game.onyx b/src/game.onyx index 9450b5b..d692f97 100644 --- a/src/game.onyx +++ b/src/game.onyx @@ -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() { -- 2.25.1