From 29ceade54cbf0e125f76abf1e2297a652183b476 Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 16 Apr 2024 02:38:16 -0400 Subject: [PATCH] window context --- CMakeLists.txt | 2 +- src/main.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a009e0d..2b99635 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(graphs VERSION 0.0.7) +project(graphs VERSION 0.0.8) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) option(ENABLE_UBSAN "Enable the ub sanitizer" OFF) diff --git a/src/main.cpp b/src/main.cpp index 2a2b9ed..b1f7c16 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,7 +26,7 @@ blt::gfx::resource_manager resources; blt::gfx::batch_renderer_2d renderer_2d(resources); blt::gfx::first_person_camera camera; -void init() +void init(blt::gfx::window_context& context) { using namespace blt::gfx; @@ -40,7 +40,7 @@ float x = 50, y = 50; float sx = 0.5, sy = 0.5; float ax = 0.05, ay = 0.05; -void update(std::int32_t width, std::int32_t height) +void update(blt::gfx::window_context& context, std::int32_t width, std::int32_t height) { global_matrices.update_perspectives(width, height, 90, 0.1, 2000); @@ -59,6 +59,7 @@ void update(std::int32_t width, std::int32_t height) renderer_2d.drawLine(blt::vec4{1, 0, 0, 1}, 0.0f, blt::vec2{0,150}, blt::vec2{240, 0}, 12.0f); renderer_2d.drawPoint(blt::vec4{0, 1, 0, 1}, 1.0f, blt::vec2{500, 500}, 50.0f); renderer_2d.drawPoint(blt::vec4{0, 1, 1, 1}, 1.0f, blt::vec2{800, 500}, 256.0f); + //renderer_2d.drawRectangle(blt::vec4{1,1,1,1}, -1.0f, blt::vec2{width / 2.0, height / 2.0}, blt::vec2{width, height}); camera.update(); camera.update_view(global_matrices);