diff --git a/include/tz/ren/quad.hpp b/include/tz/ren/quad.hpp index 0c735ec29e..d202743273 100644 --- a/include/tz/ren/quad.hpp +++ b/include/tz/ren/quad.hpp @@ -1,6 +1,7 @@ #ifndef TOPAZ_REN_QUAD_HPP #define TOPAZ_REN_QUAD_HPP #include "tz/core/handle.hpp" +#include "tz/core/vector.hpp" #include "tz/gpu/graph.hpp" namespace tz::ren diff --git a/test/tz/ren_quad_test.cpp b/test/tz/ren_quad_test.cpp index 1268321131..f4250e449b 100644 --- a/test/tz/ren_quad_test.cpp +++ b/test/tz/ren_quad_test.cpp @@ -1,14 +1,12 @@ - #include "tz/topaz.hpp" #include "tz/ren/quad.hpp" #include "tz/os/window.hpp" -#include "tz/os/input.hpp" #include "tz/gpu/hardware.hpp" int main() { tz::initialise(); - tz::os::open_window({}); + tz::os::open_window({.flags = tz::os::window_flags::invisible}); tz::gpu::hardware gpu = tz::gpu::find_best_hardware(); tz_must(tz::gpu::use_hardware(gpu)); @@ -19,37 +17,10 @@ int main() tz_must(tz::ren::quad_renderer_create_quad(ren, {.position = {-0.5f, -0.5f}, .scale = {0.15f, 0.15f}, .colour = {0.5f, 0.1f, 0.85f}})); - while(tz::os::window_is_open()) + for(std::size_t i = 0; i < 64; i++) { tz::os::window_update(); tz::gpu::execute(tz::ren::quad_renderer_graph(ren)); - tz::v2f pos = tz::ren::get_quad_position(ren, quad1); - tz::v2f scale = tz::ren::get_quad_scale(ren, quad1); - if(tz::os::is_key_pressed(tz::os::key::a)) - { - tz::ren::set_quad_position(ren, quad1, pos += {-0.002f, 0.0f}); - } - if(tz::os::is_key_pressed(tz::os::key::d)) - { - tz::ren::set_quad_position(ren, quad1, pos += {0.002f, 0.0f}); - } - if(tz::os::is_key_pressed(tz::os::key::w)) - { - tz::ren::set_quad_position(ren, quad1, pos += {0.0f, 0.002f}); - } - if(tz::os::is_key_pressed(tz::os::key::s)) - { - tz::ren::set_quad_position(ren, quad1, pos += {0.0f, -0.002f}); - } - - if(tz::os::is_key_pressed(tz::os::key::i)) - { - tz::ren::set_quad_scale(ren, quad1, scale * 1.001f); - } - if(tz::os::is_key_pressed(tz::os::key::k)) - { - tz::ren::set_quad_scale(ren, quad1, scale * 0.999f); - } } tz_must(tz::ren::destroy_quad_renderer(ren));