diff --git a/resources/block.svg b/resources/block.svg index be9e339..1e028bc 100644 --- a/resources/block.svg +++ b/resources/block.svg @@ -7,7 +7,7 @@ viewBox="0 0 512 512" version="1.1" id="svg1" - inkscape:export-filename="blocker_open.png" + inkscape:export-filename="blocker_closed.png" inkscape:export-xdpi="24" inkscape:export-ydpi="24" inkscape:version="1.4.4 (dcaf3e7d9e, 2026-05-05)" diff --git a/resources/blocker_closed.png b/resources/blocker_closed.png deleted file mode 100644 index 27d304e..0000000 Binary files a/resources/blocker_closed.png and /dev/null differ diff --git a/resources/blocker_open.png b/resources/blocker_open.png deleted file mode 100644 index 488e189..0000000 Binary files a/resources/blocker_open.png and /dev/null differ diff --git a/resources/split.svg b/resources/split.svg index ea23a2a..43fb713 100644 --- a/resources/split.svg +++ b/resources/split.svg @@ -27,9 +27,9 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="px" showguides="true" - inkscape:zoom="1.6119415" - inkscape:cx="67.930503" - inkscape:cy="246.59703" + inkscape:zoom="0.80597077" + inkscape:cx="-42.805522" + inkscape:cy="129.65731" inkscape:window-width="2560" inkscape:window-height="1414" inkscape:window-x="2560" @@ -60,28 +60,37 @@ id="rect1" width="282.46313" height="512" - x="114.76843" + x="-1027.9529" y="0" ry="141.23157" /> - + r="213.01056" /> + + diff --git a/resources/textures/blocker_closed.png b/resources/textures/blocker_closed.png new file mode 100644 index 0000000..65ad1ab Binary files /dev/null and b/resources/textures/blocker_closed.png differ diff --git a/resources/textures/blocker_closed_hover.png b/resources/textures/blocker_closed_hover.png new file mode 100644 index 0000000..aad6299 Binary files /dev/null and b/resources/textures/blocker_closed_hover.png differ diff --git a/resources/textures/blocker_closed_pressed.png b/resources/textures/blocker_closed_pressed.png new file mode 100644 index 0000000..549d0bc Binary files /dev/null and b/resources/textures/blocker_closed_pressed.png differ diff --git a/resources/textures/blocker_open.png b/resources/textures/blocker_open.png new file mode 100644 index 0000000..77a11c0 Binary files /dev/null and b/resources/textures/blocker_open.png differ diff --git a/resources/textures/blocker_open_hover.png b/resources/textures/blocker_open_hover.png new file mode 100644 index 0000000..1901cf2 Binary files /dev/null and b/resources/textures/blocker_open_hover.png differ diff --git a/resources/textures/blocker_open_pressed.png b/resources/textures/blocker_open_pressed.png new file mode 100644 index 0000000..c4ea2e0 Binary files /dev/null and b/resources/textures/blocker_open_pressed.png differ diff --git a/resources/textures/connector.png b/resources/textures/connector.png new file mode 100644 index 0000000..1755aef Binary files /dev/null and b/resources/textures/connector.png differ diff --git a/resources/textures/connector_connected.png b/resources/textures/connector_connected.png new file mode 100644 index 0000000..9a872e2 Binary files /dev/null and b/resources/textures/connector_connected.png differ diff --git a/resources/textures/connector_hover.png b/resources/textures/connector_hover.png new file mode 100644 index 0000000..cfe0a54 Binary files /dev/null and b/resources/textures/connector_hover.png differ diff --git a/resources/textures/connector_pressed.png b/resources/textures/connector_pressed.png new file mode 100644 index 0000000..f6e56c9 Binary files /dev/null and b/resources/textures/connector_pressed.png differ diff --git a/resources/textures/delete.png b/resources/textures/delete.png index 53298e6..08a5d50 100644 Binary files a/resources/textures/delete.png and b/resources/textures/delete.png differ diff --git a/resources/textures/delete_hover.png b/resources/textures/delete_hover.png new file mode 100644 index 0000000..e8ed298 Binary files /dev/null and b/resources/textures/delete_hover.png differ diff --git a/resources/textures/delete_pressed.png b/resources/textures/delete_pressed.png new file mode 100644 index 0000000..ca846e2 Binary files /dev/null and b/resources/textures/delete_pressed.png differ diff --git a/resources/textures/split.png b/resources/textures/split.png index a5bb9b5..c42ef50 100644 Binary files a/resources/textures/split.png and b/resources/textures/split.png differ diff --git a/resources/textures/split_hover.png b/resources/textures/split_hover.png new file mode 100644 index 0000000..1e21724 Binary files /dev/null and b/resources/textures/split_hover.png differ diff --git a/resources/textures/split_pressed.png b/resources/textures/split_pressed.png new file mode 100644 index 0000000..3dc68d6 Binary files /dev/null and b/resources/textures/split_pressed.png differ diff --git a/src/app-manager.cpp b/src/app-manager.cpp index 6f0a0d4..a386a0c 100644 --- a/src/app-manager.cpp +++ b/src/app-manager.cpp @@ -1,5 +1,6 @@ #include "app-manager.h" +#include "datatypes.h" #include "interaction-manager.h" #include "nlohmann/json.hpp" #include "graph-manager.h" @@ -10,6 +11,7 @@ #include #include +#include namespace VISEQ::APP{ void AppManager::init(){ @@ -19,6 +21,25 @@ namespace VISEQ::APP{ canvas->camera.zoom = 1.0f; } + void AppManager::loadTextures(){ + TEXTURES::tex_connector = LoadTexture("resources/textures/connector.png"); + TEXTURES::tex_connector_hover = LoadTexture("resources/textures/connector_hover.png"); + TEXTURES::tex_connector_pressed = LoadTexture("resources/textures/connector_pressed.png"); + TEXTURES::tex_connector_connected = LoadTexture("resources/textures/connector_connected.png"); + TEXTURES::tex_delete = LoadTexture("resources/textures/delete.png"); + TEXTURES::tex_split = LoadTexture("resources/textures/split.png"); + TEXTURES::tex_blocker_open = LoadTexture("resources/textures/blocker_open.png"); + TEXTURES::tex_blocker_closed= LoadTexture("resources/textures/blocker_closed.png"); + TEXTURES::tex_delete_hover = LoadTexture("resources/textures/delete_hover.png"); + TEXTURES::tex_split_hover = LoadTexture("resources/textures/split_hover.png"); + TEXTURES::tex_blocker_open_hover = LoadTexture("resources/textures/blocker_open_hover.png"); + TEXTURES::tex_blocker_closed_hover = LoadTexture("resources/textures/blocker_closed_hover.png"); + TEXTURES::tex_delete_pressed = LoadTexture("resources/textures/delete_pressed.png"); + TEXTURES::tex_split_pressed = LoadTexture("resources/textures/split_pressed.png"); + TEXTURES::tex_blocker_open_pressed = LoadTexture("resources/textures/blocker_open_pressed.png"); + TEXTURES::tex_blocker_closed_pressed = LoadTexture("resources/textures/blocker_closed_pressed.png"); + } + void AppManager::close(){ std::ofstream file("state.json"); file << json(*this); diff --git a/src/app-manager.h b/src/app-manager.h index c0f80f3..34ad12b 100644 --- a/src/app-manager.h +++ b/src/app-manager.h @@ -30,6 +30,7 @@ namespace VISEQ::APP { UI::AppUI ui; void init(); + void loadTextures(); void close(); void startSignals(); void loadState(); diff --git a/src/button.h b/src/button.h index c71e7fb..383bb7a 100644 --- a/src/button.h +++ b/src/button.h @@ -12,12 +12,43 @@ inline bool ViButton(Vec2Df mp, float x, float y, float radius, Color color){ return (Vector2Distance(mp, (Vector2){x,y}) < radius && IsMouseButtonPressed(MOUSE_BUTTON_LEFT)); } +inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Texture2D tex_hover, Texture2D tex_pressed, Color color){ + float scale = (radius*2.0f) / (float)tex.width; + Vec2Df start_position = position - Vec2Df((tex.width*scale) / 2.0f, (tex.height*scale) / 2.0f); + Vec2Df center_pos = start_position.rotateAround(position, rotation); + bool hover = Vector2Distance(mp, position) < radius; + bool pressed = hover && IsMouseButtonPressed(MOUSE_BUTTON_LEFT); + + if(!hover && !pressed) DrawTexturePro(tex, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); + if(hover) DrawTexturePro(tex_hover, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); + if(pressed) DrawTexturePro(tex_pressed, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); + + return pressed; +} + +inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Texture2D tex_hover, Color color){ + float scale = (radius*2.0f) / (float)tex.width; + Vec2Df start_position = position - Vec2Df((tex.width*scale) / 2.0f, (tex.height*scale) / 2.0f); + Vec2Df center_pos = start_position.rotateAround(position, rotation); + bool hover = Vector2Distance(mp, position) < radius; + bool pressed = hover && IsMouseButtonPressed(MOUSE_BUTTON_LEFT); + + if(!hover) DrawTexturePro(tex, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); + if(hover) DrawTexturePro(tex_hover, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); + + return pressed; +} + inline bool ViTexButton(Vec2Df mp, Vec2Df position, float rotation, float radius, Texture2D tex, Color color){ float scale = (radius*2.0f) / (float)tex.width; Vec2Df start_position = position - Vec2Df((tex.width*scale) / 2.0f, (tex.height*scale) / 2.0f); Vec2Df center_pos = start_position.rotateAround(position, rotation); + bool hover = Vector2Distance(mp, position) < radius; + bool pressed = hover && IsMouseButtonPressed(MOUSE_BUTTON_LEFT); + DrawTexturePro(tex, Rectangle(0.0, 0.0, tex.width, tex.height), Rectangle(center_pos.x, center_pos.y, tex.width*scale, tex.height*scale), Vec2Df(0.0f,tex.height*scale/2.0f), rotation, color); - return (Vector2Distance(mp, position) < radius && IsMouseButtonPressed(MOUSE_BUTTON_LEFT)); + + return pressed; } inline bool ViButton(Vec2Df mp, Vec2Df position, float radius, Color color){ diff --git a/src/connector.h b/src/connector.h index 8323a58..1bae51a 100644 --- a/src/connector.h +++ b/src/connector.h @@ -3,10 +3,12 @@ #include "connectable.h" #include "datatypes.h" #include "graph-item.h" +#include "helper.h" //#include "interaction-event.h" #include "raymath.h" #include "state.h" #include "vmath.h" +#include "button.h" #include #include @@ -27,7 +29,8 @@ namespace VISEQ::GRAPH { float radius = 8.0f; float orbit = 20.0f; Vec2Df center_position; - + Vec2Df parent_position; + GraphItemType getType() override{ return GraphItemType::CONNECTOR; } @@ -46,7 +49,9 @@ namespace VISEQ::GRAPH { void setPosition(Vec2Df pos) override { center_position = pos; + parent_position = pos; } + void setOrbit(float r) { orbit = r; } @@ -71,14 +76,25 @@ namespace VISEQ::GRAPH { void draw() override { BASE::Connectable::draw(); - float opacity = 150.0f - Clamp(position.dist(SCREEN_MOUSE), 0.0f, 150.0f); - - if(hovering()){ - DrawCircle(position.x, position.y, 8.0f, (Color){108, 203, 237, 255}); - } else { - DrawCircle(position.x, position.y, 8.0f, (Color){108, 153, 187, (unsigned char)opacity}); - } + float opacity = Clamp((400.0f - Clamp(position.dist(SCREEN_MOUSE), 0.0f, 400.0f)) / 400.0f, 0.0f, 1.0f); + + float rotation; + if(partner.expired()) rotation = HELPER::GetRotation(parent_position, SCREEN_MOUSE) + 90.0f; + if(!partner.expired()) { + rotation = HELPER::GetRotation(position, partner.lock()->position) + 90.0f; + opacity = 1.0f; + } + if(connecting) opacity = 1.0f; + if(partner.expired() && !connecting) ViTexButton(SCREEN_MOUSE, position, rotation, 8.0f, + TEXTURES::tex_connector, TEXTURES::tex_connector_hover, TEXTURES::tex_connector_pressed, + ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity)); + + if(!partner.expired() || connecting) ViTexButton(SCREEN_MOUSE, position, rotation, 8.0f, + TEXTURES::tex_connector_connected, TEXTURES::tex_connector_hover, + ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity)); + } + }; } diff --git a/src/datatypes.h b/src/datatypes.h index 116eb0f..44ca79b 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -23,13 +23,32 @@ #include "nlohmann/json.hpp" using json = nlohmann::json; +#include -#include #include #include "libremidi/libremidi.hpp" #define RANGE_FILTER(L) std::ranges::views::filter(L) +namespace VISEQ::TEXTURES { + inline Texture2D tex_connector; + inline Texture2D tex_connector_hover; + inline Texture2D tex_connector_pressed; + inline Texture2D tex_connector_connected; + inline Texture2D tex_delete; + inline Texture2D tex_split; + inline Texture2D tex_blocker_open; + inline Texture2D tex_blocker_closed; + inline Texture2D tex_delete_hover; + inline Texture2D tex_split_hover; + inline Texture2D tex_blocker_open_hover; + inline Texture2D tex_blocker_closed_hover; + inline Texture2D tex_delete_pressed; + inline Texture2D tex_split_pressed; + inline Texture2D tex_blocker_open_pressed; + inline Texture2D tex_blocker_closed_pressed; +} + namespace VISEQ::GRAPH::NODES { enum Distribution {GEOMETRIC, ROUNDROBIN, RANDOM}; } diff --git a/src/graph-manager.cpp b/src/graph-manager.cpp index 4b26acf..ceeec7f 100644 --- a/src/graph-manager.cpp +++ b/src/graph-manager.cpp @@ -30,13 +30,6 @@ namespace VISEQ::GRAPH{ return shared_from_this(); } - void GraphManager::loadTextures(){ - tex_delete = LoadTexture("resources/textures/delete.png"); - tex_split = LoadTexture("resources/textures/split.png"); - tex_blocker_open = LoadTexture("resources/textures/blocker_open.png"); - tex_blocker_closed= LoadTexture("resources/textures/blocker_closed.png"); - } - int GraphManager::getNodesSize(){ return nodes.size(); } @@ -352,7 +345,6 @@ namespace VISEQ::GRAPH{ void GraphManager::update(){ if(!remove_edges.empty()) removeEdges(); if(!split_edges.empty()) splitEdges(); - if(tex_delete.width == 0 && IsWindowReady()) loadTextures(); } void GraphManager::drawEdges(Vec2Df mouse_pos, Camera2D cam){ @@ -362,13 +354,16 @@ namespace VISEQ::GRAPH{ float v1_v2_distance = v1_position.dist(&v2_position); if(v1_v2_distance < 100) c->switches_offset = v1_v2_distance/2.3f; - Vec2Df from_to_handle = c->start.lock()->position - ((c->start.lock()->position - c->end.lock()->position)).norm()*40.0f; //.norm() * (c->start.lock()->radius + c->switches_offset); - Vec2Df to_from_handle = c->end.lock()->position - ((c->end.lock()->position - c->start.lock()->position)).norm()*40.0f; //.norm() * (c->end.lock()->radius + c->switches_offset); - Vec2Df middle_handle_2 = c->end.lock()->position - ((c->end.lock()->position - c->start.lock()->position)).norm()*60.0f; - Vec2Df middle_handle = c->start.lock()->position - ((c->start.lock()->position - c->end.lock()->position)).norm()*60.0f; + Vec2Df from_to_handle = c->start.lock()->position - ((c->start.lock()->position - c->end.lock()->position)).norm()*45.0f; //.norm() * (c->start.lock()->radius + c->switches_offset); + Vec2Df to_from_handle = c->end.lock()->position - ((c->end.lock()->position - c->start.lock()->position)).norm()*45.0f; //.norm() * (c->end.lock()->radius + c->switches_offset); + Vec2Df middle_handle_2 = c->end.lock()->position - ((c->end.lock()->position - c->start.lock()->position)).norm()*65.0f; + Vec2Df middle_handle = c->start.lock()->position - ((c->start.lock()->position - c->end.lock()->position)).norm()*65.0f; Vec2Df center_handle = c->end.lock()->position - ((c->end.lock()->position - c->start.lock()->position))*0.5f; - Vec2Df flip_handle = middle_handle + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*0.2, 0.f, 20.f) : 1.0f); - Vec2Df flip_handle_2 = middle_handle_2 + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*-0.2, -20.f, 0.f) : 1.0f); + //Vec2Df flip_handle = middle_handle + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*0.2, 0.f, 20.f) : 1.0f); + //Vec2Df flip_handle_2 = middle_handle_2 + (v1_position - v2_position).norm().orth() * (v1_v2_distance < 120.0f ? Clamp((120.0f - v1_v2_distance)*-0.2, -20.f, 0.f) : 1.0f); + + Vec2Df delete_position = center_handle + (c->start.lock()->position - c->end.lock()->position).norm().orth() * 12.0f; + Vec2Df split_position = center_handle - (c->start.lock()->position - c->end.lock()->position).norm().orth() * 12.0f; // Dynamic opacity by distance to mouse unsigned char opacity = 150.0f - Clamp(center_handle.dist(mouse_pos), 0.0f, 130.0f); @@ -418,30 +413,30 @@ namespace VISEQ::GRAPH{ if(!c->start.lock()->picked_up && !c->end.lock()->picked_up){ // On/Off switches on both sides - Texture2D tex_forward; - Texture2D tex_backward; - if(c->pass_forward) tex_forward = tex_blocker_open; - if(!c->pass_forward) tex_forward = tex_blocker_closed; + if(ViTexButton(mouse_pos, from_to_handle, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, + c->pass_forward ? TEXTURES::tex_blocker_open : TEXTURES::tex_blocker_closed, + c->pass_forward ? TEXTURES::tex_blocker_open_hover : TEXTURES::tex_blocker_closed_hover, + c->pass_forward ? TEXTURES::tex_blocker_open_pressed : TEXTURES::tex_blocker_closed_pressed, + ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized))) c->pass_forward = !c->pass_forward; - if(c->pass_backward) tex_backward = tex_blocker_open; - if(!c->pass_backward) tex_backward = tex_blocker_closed; - if(IsWindowReady()){ + if(ViTexButton(mouse_pos, to_from_handle, HELPER::GetRotation(to_from_handle, from_to_handle) + 90.0f, 8.0f, + c->pass_backward ? TEXTURES::tex_blocker_open : TEXTURES::tex_blocker_closed, + c->pass_backward ? TEXTURES::tex_blocker_open_hover : TEXTURES::tex_blocker_closed_hover, + c->pass_backward ? TEXTURES::tex_blocker_open_pressed : TEXTURES::tex_blocker_closed_pressed, + ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized))) c->pass_backward = !c->pass_backward; - if(ViTexButton(mouse_pos, from_to_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_forward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized))) c->pass_forward = !c->pass_forward; - - if(ViTexButton(mouse_pos, to_from_handle, HELPER::GetRotation(to_from_handle, from_to_handle), 8.0f, tex_backward, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized))) c->pass_backward = !c->pass_backward; - - if(ViTexButton(mouse_pos, center_handle, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, tex_split, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) splitEdge(c); - } + if(ViTexButton(mouse_pos, split_position, HELPER::GetRotation(from_to_handle, to_from_handle) + 90.0f, 8.0f, + TEXTURES::tex_split, TEXTURES::tex_split_hover, TEXTURES::tex_split_pressed, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) splitEdge(c); } } if(c->start.lock()->getNodeType() == NodeType::CONFIGNODE || c->end.lock()->getNodeType() == NodeType::CONFIGNODE){ DrawLine(v1_position.x, v1_position.y, v2_position.x, v2_position.y, VS_COLOR_BLUE); } if(IsWindowReady()){ - if(ViTexButton(mouse_pos, middle_handle, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_from_normalized) )) removeEdge(c); - if(ViTexButton(mouse_pos, middle_handle_2, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, tex_delete, ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_to_normalized) )) removeEdge(c); + if(ViTexButton(mouse_pos, delete_position, HELPER::GetRotation(from_to_handle, to_from_handle), 8.0f, + TEXTURES::tex_delete, TEXTURES::tex_delete_hover, TEXTURES::tex_delete_pressed, + ColorLerp(Fade(VS_COLOR_WHITE, .0f), Fade(VS_COLOR_WHITE, 1.0f), opacity_normalized) )) removeEdge(c); } } } diff --git a/src/graph-manager.h b/src/graph-manager.h index 1eeb9a6..1292080 100644 --- a/src/graph-manager.h +++ b/src/graph-manager.h @@ -40,7 +40,6 @@ namespace VISEQ::GRAPH { GraphManager() {} std::shared_ptr getPtr(); - void loadTextures(); int getNodesSize(); void createMidiNode(Vec2Df position); void createConfigNode(Vec2Df position); @@ -85,11 +84,6 @@ namespace VISEQ::GRAPH { friend void from_json(const json& j, std::shared_ptr& G); friend void to_json(json& j, const std::shared_ptr& G); - - Texture2D tex_delete; - Texture2D tex_split; - Texture2D tex_blocker_open; - Texture2D tex_blocker_closed; }; } diff --git a/src/main.cpp b/src/main.cpp index 9839b5f..9157204 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -51,6 +51,8 @@ int main(){ app.init(); app.ui.init(); + + app.loadTextures(); app.loadState(); @@ -58,7 +60,7 @@ int main(){ while(!WindowShouldClose()){ app.update(); - app.draw(); + if(IsWindowReady()) app.draw(); } app.close();