aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-07-26 03:17:09 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-07-26 03:17:09 +0100
commitc96c4630d54ce4bff1e6786b4c882c50505fea21 (patch)
treea2516e677b297187a279300bf43ef557659142a2
parent66330a94799c1fbab299bf125a08abc3d6ed0167 (diff)
downloadcw_tree-c96c4630d54ce4bff1e6786b4c882c50505fea21.tar.gz
cw_tree-c96c4630d54ce4bff1e6786b4c882c50505fea21.tar.bz2
cw_tree-c96c4630d54ce4bff1e6786b4c882c50505fea21.zip
Make window in Raylib
-rw-r--r--Makefile2
-rw-r--r--src/main.cpp21
2 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index ba015d3..9fc08c9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
CC=g++
OUT=cwtree.out
-LIBS=
+LIBS=-lm -lraylib
ARGS=
RELEASE=0
diff --git a/src/main.cpp b/src/main.cpp
index 6c51f49..440e4e1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -15,19 +15,26 @@
*/
#include <cstdio>
+#include <raylib.h>
#include "./numerics.hpp"
int main(void)
{
- NodeAllocator allocator{256};
- std::queue<word_t> to_iterate;
- word_t root = allocator.alloc_node({{1, 2}});
- to_iterate.push(root);
- for (int i = 0; i < 10; ++i)
+ // NodeAllocator allocator{256};
+ // std::queue<word_t> to_iterate;
+ // Fraction best_frac{1, 2};
+ // word_t root = allocator.alloc_node({best_frac});
+ // to_iterate.push(root);
+
+ InitWindow(800, 600, "Calkin-Wilf Trees");
+ while (!WindowShouldClose())
{
- iterate(to_iterate, allocator);
- printf("step[%d]:\n%s\n\n", i, to_string(allocator, root).c_str());
+ ClearBackground(BLACK);
+ BeginDrawing();
+ DrawText("Hello, world!", 50, 50, 25, WHITE);
+ EndDrawing();
}
+ CloseWindow();
return 0;
}