39 lines
807 B
C++
39 lines
807 B
C++
#include "raylib.h"
|
|
#include "Tree.hpp"
|
|
|
|
int main(void)
|
|
{
|
|
char name[] = "treender";
|
|
int screenWidth = 800;
|
|
int screenHeight = 800;
|
|
|
|
#ifdef MY_ANDROID
|
|
InitWindow(0, 0, name);
|
|
screenWidth = GetScreenWidth();
|
|
screenHeight = GetScreenHeight();
|
|
#else
|
|
InitWindow(screenWidth, screenHeight, name);
|
|
#endif
|
|
SetTargetFPS(60);
|
|
{
|
|
Tree tree(800);
|
|
tree.newTree();
|
|
|
|
int yPos = (screenHeight - screenWidth) / 2;
|
|
Rectangle dest = {0, (float)yPos, (float)screenWidth, (float)screenWidth};
|
|
float rotation = 0.0f;
|
|
while (!WindowShouldClose())
|
|
{
|
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
|
{
|
|
tree.newTree();
|
|
}
|
|
BeginDrawing();
|
|
ClearBackground(WHITE);
|
|
tree.draw(dest, rotation);
|
|
EndDrawing();
|
|
}
|
|
}
|
|
CloseWindow();
|
|
return 0;
|
|
} |