make window resizable
This commit is contained in:
@ -3,13 +3,17 @@
|
||||
|
||||
#include <raylib.h>
|
||||
|
||||
#define VERLET_UPDATE
|
||||
// #define WEB
|
||||
|
||||
// Window
|
||||
constexpr int WIDTH = 1300;
|
||||
constexpr int HEIGHT = 1100;
|
||||
constexpr int INITIAL_WIDTH = 800;
|
||||
constexpr int INITIAL_HEIGHT = 800;
|
||||
constexpr int MENU_HEIGHT = 200;
|
||||
|
||||
// Menu
|
||||
constexpr int MENU_PAD = 10;
|
||||
constexpr int MENU_PAD = 5;
|
||||
constexpr int BUTTON_PAD = 20;
|
||||
constexpr int MENU_ROWS = 3;
|
||||
constexpr int MENU_COLS = 3;
|
||||
|
||||
|
||||
@ -58,9 +58,11 @@ public:
|
||||
Renderer()
|
||||
: camera(OrbitCamera3D(Vector3(0, 0, 0), CAMERA_DISTANCE)),
|
||||
mark_solutions(false), connect_solutions(false) {
|
||||
render_target = LoadRenderTexture(WIDTH, HEIGHT);
|
||||
klotski_target = LoadRenderTexture(WIDTH, HEIGHT);
|
||||
menu_target = LoadRenderTexture(WIDTH * 2, MENU_HEIGHT);
|
||||
render_target = LoadRenderTexture(GetScreenWidth() / 2.0,
|
||||
GetScreenHeight() - MENU_HEIGHT);
|
||||
klotski_target = LoadRenderTexture(GetScreenWidth() / 2.0,
|
||||
GetScreenHeight() - MENU_HEIGHT);
|
||||
menu_target = LoadRenderTexture(GetScreenWidth(), MENU_HEIGHT);
|
||||
}
|
||||
|
||||
Renderer(const Renderer ©) = delete;
|
||||
@ -84,6 +86,8 @@ public:
|
||||
auto UpdateCamera(const MassSpringSystem &masssprings, const State ¤t)
|
||||
-> void;
|
||||
|
||||
auto UpdateTextureSizes() -> void;
|
||||
|
||||
auto DrawMassSprings(const MassSpringSystem &masssprings,
|
||||
const State ¤t) -> void;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user