Compare commits

..

No commits in common. "3f91ad256a76ef1e1651a825049c527955e8d484" and "a4727881c5b2300df3640f4d77d68a139df4b190" have entirely different histories.

2 changed files with 10 additions and 13 deletions

Binary file not shown.

View file

@ -3,6 +3,7 @@
#include <glm/ext/vector_uint2.hpp>
#include <glm/ext/vector_uint3.hpp>
#include <glm/glm.hpp>
#include <iostream>
#include <raylib.h>
#include <vector>
@ -39,7 +40,7 @@ struct kdtree
void draw()
{
DrawRectangleLines(aabb_min.x, aabb_min.y, aabb_size.x, aabb_size.y, WHITE);
DrawRectangleLines(aabb_min.x, aabb_min.y, aabb_size.x, aabb_size.y, BLACK);
if(left && right)
{
left->draw();
@ -67,14 +68,13 @@ struct kdtree
int main (int argc, char *argv[])
{
auto img = LoadImage(argv[1]);
auto img = LoadImage("data/img.jpg");
InitWindow(img.width, img.height, "");
SetTargetFPS(60);
std::vector<glm::uvec2> pts;
for (int i = 0; i < img.width * img.height; ++i)
{
int x = i % img.width;
@ -115,16 +115,13 @@ int main (int argc, char *argv[])
kdtree tree(pts);
auto target = LoadRenderTexture(img.width, img.height);
BeginTextureMode(target);
ClearBackground(BLACK);
tree.draw();
EndTextureMode();
auto t = LoadImageFromTexture(target.texture);
ImageFlipVertical(&t);
ExportImage(t, argv[2]);
while (!WindowShouldClose())
{
BeginDrawing();
ClearBackground(WHITE);
tree.draw();
EndDrawing();
}
CloseWindow();