Save to file
This commit is contained in:
parent
a4727881c5
commit
4b56e3fa71
1 changed files with 12 additions and 8 deletions
18
src/main.cpp
18
src/main.cpp
|
@ -40,7 +40,7 @@ struct kdtree
|
|||
|
||||
void draw()
|
||||
{
|
||||
DrawRectangleLines(aabb_min.x, aabb_min.y, aabb_size.x, aabb_size.y, BLACK);
|
||||
DrawRectangleLines(aabb_min.x, aabb_min.y, aabb_size.x, aabb_size.y, WHITE);
|
||||
if(left && right)
|
||||
{
|
||||
left->draw();
|
||||
|
@ -75,6 +75,7 @@ int main (int argc, char *argv[])
|
|||
|
||||
std::vector<glm::uvec2> pts;
|
||||
|
||||
|
||||
for (int i = 0; i < img.width * img.height; ++i)
|
||||
{
|
||||
int x = i % img.width;
|
||||
|
@ -115,13 +116,16 @@ int main (int argc, char *argv[])
|
|||
|
||||
kdtree tree(pts);
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
BeginDrawing();
|
||||
ClearBackground(WHITE);
|
||||
auto target = LoadRenderTexture(img.width, img.height);
|
||||
|
||||
BeginTextureMode(target);
|
||||
ClearBackground(BLACK);
|
||||
tree.draw();
|
||||
EndDrawing();
|
||||
}
|
||||
EndTextureMode();
|
||||
|
||||
auto t = LoadImageFromTexture(target.texture);
|
||||
ImageFlipVertical(&t);
|
||||
ExportImage(t, "test.jpg");
|
||||
|
||||
CloseWindow();
|
||||
|
||||
|
|
Loading…
Reference in a new issue