Make window in Raylib
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
|||||||
CC=g++
|
CC=g++
|
||||||
OUT=cwtree.out
|
OUT=cwtree.out
|
||||||
LIBS=
|
LIBS=-lm -lraylib
|
||||||
ARGS=
|
ARGS=
|
||||||
|
|
||||||
RELEASE=0
|
RELEASE=0
|
||||||
|
|||||||
21
src/main.cpp
21
src/main.cpp
@@ -15,19 +15,26 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <raylib.h>
|
||||||
|
|
||||||
#include "./numerics.hpp"
|
#include "./numerics.hpp"
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
NodeAllocator allocator{256};
|
// NodeAllocator allocator{256};
|
||||||
std::queue<word_t> to_iterate;
|
// std::queue<word_t> to_iterate;
|
||||||
word_t root = allocator.alloc_node({{1, 2}});
|
// Fraction best_frac{1, 2};
|
||||||
to_iterate.push(root);
|
// word_t root = allocator.alloc_node({best_frac});
|
||||||
for (int i = 0; i < 10; ++i)
|
// to_iterate.push(root);
|
||||||
|
|
||||||
|
InitWindow(800, 600, "Calkin-Wilf Trees");
|
||||||
|
while (!WindowShouldClose())
|
||||||
{
|
{
|
||||||
iterate(to_iterate, allocator);
|
ClearBackground(BLACK);
|
||||||
printf("step[%d]:\n%s\n\n", i, to_string(allocator, root).c_str());
|
BeginDrawing();
|
||||||
|
DrawText("Hello, world!", 50, 50, 25, WHITE);
|
||||||
|
EndDrawing();
|
||||||
}
|
}
|
||||||
|
CloseWindow();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user