diplomska_naloga/main.cpp
Nikola Petrov 1755c18496 Addapt for android
Center the tree texture on the screen
2024-03-03 22:36:53 +01:00

38 lines
755 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 = {yPos, 0, screenWidth, screenWidth};
float rotation = 0.0f;
while (!WindowShouldClose())
{
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
tree.newTree();
}
BeginDrawing();
tree.draw(dest, rotation);
EndDrawing();
}
}
CloseWindow();
return 0;
}