From cd71e036dd4369bd3840d66fb9719c337be02445 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 11 Nov 2024 16:47:31 -0500 Subject: [PATCH] binary tree --- CMakeLists.txt | 2 +- lib/blt-with-graphics | 2 +- src/main.cpp | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52a7b2d..f61e2cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.25) -project(COSC-4P80-Assignment-3 VERSION 0.0.10) +project(COSC-4P80-Assignment-3 VERSION 0.0.11) include(FetchContent) option(ENABLE_ADDRSAN "Enable the address sanitizer" OFF) diff --git a/lib/blt-with-graphics b/lib/blt-with-graphics index a933928..de45494 160000 --- a/lib/blt-with-graphics +++ b/lib/blt-with-graphics @@ -1 +1 @@ -Subproject commit a9339280a05f432e41005c2a964767cb37f692a7 +Subproject commit de454940bcf53d2de091bc4b8e3e86c1a03cf85b diff --git a/src/main.cpp b/src/main.cpp index ddb2c24..168ad95 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,8 @@ #include "blt/gfx/renderer/resource_manager.h" #include "blt/gfx/renderer/batch_2d_renderer.h" #include "blt/gfx/renderer/camera.h" +#include "blt/std/binary_tree.h" +#include "blt/std/random.h" #include #include #include @@ -68,6 +70,22 @@ void init(const blt::gfx::window_data&) using namespace blt::gfx; BLT_INFO("Hello World!"); + blt::range_tree_t tree{}; + tree.insert(10, "hello there"); + tree.insert(20, "larger"); + tree.insert(5, "smaller"); + tree.insert(7, "middle1"); + tree.insert(15, "middle2"); + tree.insert(25, "really large"); + tree.insert(3, "really small"); + + blt::random::random_t rand{std::random_device{}()}; + + for (blt::size_t i = 0; i < 100; i++) + tree.insert(rand.get_u64(0, 1000), std::to_string(i)); + + tree.print(std::cout, true); + global_matrices.create_internals(); resources.load_resources(); renderer_2d.create();