Make window in Raylib

This commit is contained in:
2024-07-26 03:17:09 +01:00
parent 66330a9479
commit c96c4630d5
2 changed files with 15 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
CC=g++
OUT=cwtree.out
LIBS=
LIBS=-lm -lraylib
ARGS=
RELEASE=0

View File

@@ -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;
}