diff --git a/include/widgets.hpp b/include/widgets.hpp index 1201eacd..df3efd65 100644 --- a/include/widgets.hpp +++ b/include/widgets.hpp @@ -16,7 +16,7 @@ namespace rack { //////////////////// // Constructing these directly will load from the disk each time. Use the load() functions to load from disk and cache them as long as the shared_ptr is held. -// Implemented in gui.cpp +// Implemented in window.cpp struct Font { int handle; diff --git a/include/gui.hpp b/include/window.hpp similarity index 59% rename from include/gui.hpp rename to include/window.hpp index fd6c0e77..24432579 100644 --- a/include/gui.hpp +++ b/include/window.hpp @@ -5,9 +5,9 @@ #ifdef ARCH_MAC - #define GUI_MOD_KEY_NAME "Cmd" + #define WINDOW_MOD_KEY_NAME "Cmd" #else - #define GUI_MOD_KEY_NAME "Ctrl" + #define WINDOW_MOD_KEY_NAME "Ctrl" #endif @@ -30,19 +30,19 @@ extern int gGuiFrame; extern Vec gMousePos; -void guiInit(); -void guiDestroy(); -void guiRun(); -void guiClose(); -void guiCursorLock(); -void guiCursorUnlock(); -bool guiIsModPressed(); -bool guiIsShiftPressed(); -Vec guiGetWindowSize(); -void guiSetWindowSize(Vec size); -Vec guiGetWindowPos(); -void guiSetWindowPos(Vec pos); -bool guiIsMaximized(); +void windowInit(); +void windowDestroy(); +void windowRun(); +void windowClose(); +void windowCursorLock(); +void windowCursorUnlock(); +bool windowIsModPressed(); +bool windowIsShiftPressed(); +Vec windowGetWindowSize(); +void windowSetWindowSize(Vec size); +Vec windowGetWindowPos(); +void windowSetWindowPos(Vec pos); +bool windowIsMaximized(); } // namespace rack diff --git a/src/app/Knob.cpp b/src/app/Knob.cpp index 2442d0a4..98859698 100644 --- a/src/app/Knob.cpp +++ b/src/app/Knob.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" #include "engine.hpp" // For GLFW_KEY_LEFT_CONTROL, etc. #include @@ -11,7 +11,7 @@ namespace rack { void Knob::onDragStart(EventDragStart &e) { - guiCursorLock(); + windowCursorLock(); dragValue = value; randomizable = false; } @@ -23,7 +23,7 @@ void Knob::onDragMove(EventDragMove &e) { delta *= range; // Drag slower if Mod is held - if (guiIsModPressed()) + if (windowIsModPressed()) delta /= 16.0; dragValue += delta; if (snap) @@ -33,7 +33,7 @@ void Knob::onDragMove(EventDragMove &e) { } void Knob::onDragEnd(EventDragEnd &e) { - guiCursorUnlock(); + windowCursorUnlock(); randomizable = true; } diff --git a/src/app/ModuleWidget.cpp b/src/app/ModuleWidget.cpp index 564b58cc..358b2523 100644 --- a/src/app/ModuleWidget.cpp +++ b/src/app/ModuleWidget.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include "engine.hpp" #include "plugin.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -220,7 +220,7 @@ void ModuleWidget::onMouseMove(EventMouseMove &e) { if (!gFocusedWidget) { // Instead of checking key-down events, delete the module even if key-repeat hasn't fired yet and the cursor is hovering over the widget. if (glfwGetKey(gWindow, GLFW_KEY_DELETE) == GLFW_PRESS || glfwGetKey(gWindow, GLFW_KEY_BACKSPACE) == GLFW_PRESS) { - if (!guiIsModPressed() && !guiIsShiftPressed()) { + if (!windowIsModPressed() && !windowIsShiftPressed()) { gRackWidget->deleteModule(this); this->finalizeEvents(); delete this; @@ -234,21 +234,21 @@ void ModuleWidget::onMouseMove(EventMouseMove &e) { void ModuleWidget::onHoverKey(EventHoverKey &e) { switch (e.key) { case GLFW_KEY_I: - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { reset(); e.consumed = true; return; } break; case GLFW_KEY_R: - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { randomize(); e.consumed = true; return; } break; case GLFW_KEY_D: - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { gRackWidget->cloneModule(this); e.consumed = true; return; @@ -319,13 +319,13 @@ Menu *ModuleWidget::createContextMenu() { ResetMenuItem *resetItem = new ResetMenuItem(); resetItem->text = "Initialize"; - resetItem->rightText = GUI_MOD_KEY_NAME "+I"; + resetItem->rightText = WINDOW_MOD_KEY_NAME "+I"; resetItem->moduleWidget = this; menu->addChild(resetItem); RandomizeMenuItem *randomizeItem = new RandomizeMenuItem(); randomizeItem->text = "Randomize"; - randomizeItem->rightText = GUI_MOD_KEY_NAME "+R"; + randomizeItem->rightText = WINDOW_MOD_KEY_NAME "+R"; randomizeItem->moduleWidget = this; menu->addChild(randomizeItem); @@ -336,7 +336,7 @@ Menu *ModuleWidget::createContextMenu() { CloneMenuItem *cloneItem = new CloneMenuItem(); cloneItem->text = "Duplicate"; - cloneItem->rightText = GUI_MOD_KEY_NAME "+D"; + cloneItem->rightText = WINDOW_MOD_KEY_NAME "+D"; cloneItem->moduleWidget = this; menu->addChild(cloneItem); diff --git a/src/app/PluginManagerWidget.cpp b/src/app/PluginManagerWidget.cpp index 096eb071..90a825ad 100644 --- a/src/app/PluginManagerWidget.cpp +++ b/src/app/PluginManagerWidget.cpp @@ -1,7 +1,7 @@ #include #include "app.hpp" #include "plugin.hpp" -#include "gui.hpp" +#include "window.hpp" #include "../ext/osdialog/osdialog.h" @@ -24,7 +24,7 @@ struct SyncButton : Button { } if (completed) { if (osdialog_message(OSDIALOG_INFO, OSDIALOG_OK_CANCEL, "All plugins have been updated. Close Rack and re-launch it to load new updates.")) { - guiClose(); + windowClose(); } completed = false; } diff --git a/src/app/Port.cpp b/src/app/Port.cpp index 17424fc1..ed767049 100644 --- a/src/app/Port.cpp +++ b/src/app/Port.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" #include "engine.hpp" #include "componentlibrary.hpp" @@ -65,7 +65,7 @@ void Port::onMouseDown(EventMouseDown &e) { void Port::onDragStart(EventDragStart &e) { // Try to grab wire on top of stack WireWidget *wire = gRackWidget->wireContainer->getTopWire(this); - if (type == OUTPUT && guiIsModPressed()) { + if (type == OUTPUT && windowIsModPressed()) { wire = NULL; } diff --git a/src/app/RackScene.cpp b/src/app/RackScene.cpp index bf1ea0ea..340c13ee 100644 --- a/src/app/RackScene.cpp +++ b/src/app/RackScene.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" #include "util/request.hpp" #include "../ext/osdialog/osdialog.h" #include @@ -75,7 +75,7 @@ void RackScene::step() { if (osdialog_message(OSDIALOG_INFO, OSDIALOG_YES_NO, versionMessage.c_str())) { std::thread t(openBrowser, "https://vcvrack.com/"); t.detach(); - guiClose(); + windowClose(); } newVersion = ""; } @@ -91,33 +91,33 @@ void RackScene::onHoverKey(EventHoverKey &e) { if (!e.consumed) { switch (e.key) { case GLFW_KEY_N: { - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { gRackWidget->reset(); e.consumed = true; return; } } break; case GLFW_KEY_Q: { - if (guiIsModPressed() && !guiIsShiftPressed()) { - guiClose(); + if (windowIsModPressed() && !windowIsShiftPressed()) { + windowClose(); e.consumed = true; return; } } break; case GLFW_KEY_O: { - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { gRackWidget->openDialog(); e.consumed = true; return; } } break; case GLFW_KEY_S: { - if (guiIsModPressed() && !guiIsShiftPressed()) { + if (windowIsModPressed() && !windowIsShiftPressed()) { gRackWidget->saveDialog(); e.consumed = true; return; } - if (guiIsModPressed() && guiIsShiftPressed()) { + if (windowIsModPressed() && windowIsShiftPressed()) { gRackWidget->saveAsDialog(); e.consumed = true; return; diff --git a/src/app/RackScrollWidget.cpp b/src/app/RackScrollWidget.cpp index d206b712..a756ca68 100644 --- a/src/app/RackScrollWidget.cpp +++ b/src/app/RackScrollWidget.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { diff --git a/src/app/RackWidget.cpp b/src/app/RackWidget.cpp index ab32b761..82718573 100644 --- a/src/app/RackWidget.cpp +++ b/src/app/RackWidget.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include "engine.hpp" #include "plugin.hpp" -#include "gui.hpp" +#include "window.hpp" #include "settings.hpp" #include "asset.hpp" #include diff --git a/src/app/SVGPanel.cpp b/src/app/SVGPanel.cpp index ac9a297d..57c5500c 100644 --- a/src/app/SVGPanel.cpp +++ b/src/app/SVGPanel.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { diff --git a/src/app/Toolbar.cpp b/src/app/Toolbar.cpp index 7383406c..951ad2d1 100644 --- a/src/app/Toolbar.cpp +++ b/src/app/Toolbar.cpp @@ -1,5 +1,5 @@ #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" #include "engine.hpp" @@ -32,7 +32,7 @@ struct SaveAsItem : MenuItem { struct QuitItem : MenuItem { void onAction(EventAction &e) override { - guiClose(); + windowClose(); } }; @@ -43,11 +43,11 @@ struct FileChoice : ChoiceButton { menu->box.size.x = box.size.x; { - menu->addChild(construct(&MenuItem::text, "New", &MenuItem::rightText, GUI_MOD_KEY_NAME "+N")); - menu->addChild(construct(&MenuItem::text, "Open", &MenuItem::rightText, GUI_MOD_KEY_NAME "+O")); - menu->addChild(construct(&MenuItem::text, "Save", &MenuItem::rightText, GUI_MOD_KEY_NAME "+S")); - menu->addChild(construct(&MenuItem::text, "Save as", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Shift+S")); - menu->addChild(construct(&MenuItem::text, "Quit", &MenuItem::rightText, GUI_MOD_KEY_NAME "+Q")); + menu->addChild(construct(&MenuItem::text, "New", &MenuItem::rightText, WINDOW_MOD_KEY_NAME "+N")); + menu->addChild(construct(&MenuItem::text, "Open", &MenuItem::rightText, WINDOW_MOD_KEY_NAME "+O")); + menu->addChild(construct(&MenuItem::text, "Save", &MenuItem::rightText, WINDOW_MOD_KEY_NAME "+S")); + menu->addChild(construct(&MenuItem::text, "Save as", &MenuItem::rightText, WINDOW_MOD_KEY_NAME "+Shift+S")); + menu->addChild(construct(&MenuItem::text, "Quit", &MenuItem::rightText, WINDOW_MOD_KEY_NAME "+Q")); } } }; diff --git a/src/app/WireWidget.cpp b/src/app/WireWidget.cpp index 294e9af3..f6b23e55 100644 --- a/src/app/WireWidget.cpp +++ b/src/app/WireWidget.cpp @@ -1,7 +1,7 @@ #include "app.hpp" #include "engine.hpp" #include "componentlibrary.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { diff --git a/src/engine.cpp b/src/engine.cpp index 2590e82b..151ad926 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -62,7 +62,7 @@ void engineInit() { } void engineDestroy() { - // Make sure there are no wires or modules in the rack on destruction. This suggests that a module failed to remove itself before the GUI was destroyed. + // Make sure there are no wires or modules in the rack on destruction. This suggests that a module failed to remove itself before the WINDOW was destroyed. assert(wires.empty()); assert(modules.empty()); } diff --git a/src/main.cpp b/src/main.cpp index 0f7c0b9c..438abfa1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,6 @@ #include "util/common.hpp" #include "engine.hpp" -#include "gui.hpp" +#include "window.hpp" #include "app.hpp" #include "plugin.hpp" #include "settings.hpp" @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) { pluginInit(); engineInit(); - guiInit(); + windowInit(); sceneInit(); settingsLoad(assetLocal("settings.json")); @@ -50,13 +50,13 @@ int main(int argc, char* argv[]) { } engineStart(); - guiRun(); + windowRun(); engineStop(); gRackWidget->savePatch(assetLocal("autosave.vcv")); settingsSave(assetLocal("settings.json")); sceneDestroy(); - guiDestroy(); + windowDestroy(); engineDestroy(); pluginDestroy(); diff --git a/src/settings.cpp b/src/settings.cpp index f0a6642d..b12121da 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,6 +1,6 @@ #include "settings.hpp" #include "app.hpp" -#include "gui.hpp" +#include "window.hpp" #include "engine.hpp" #include "plugin.hpp" #include @@ -20,14 +20,14 @@ static json_t *settingsToJson() { json_t *tokenJ = json_string(gToken.c_str()); json_object_set_new(rootJ, "token", tokenJ); - if (!guiIsMaximized()) { + if (!windowIsMaximized()) { // windowSize - Vec windowSize = guiGetWindowSize(); + Vec windowSize = windowGetWindowSize(); json_t *windowSizeJ = json_pack("[f, f]", windowSize.x, windowSize.y); json_object_set_new(rootJ, "windowSize", windowSizeJ); // windowPos - Vec windowPos = guiGetWindowPos(); + Vec windowPos = windowGetWindowPos(); json_t *windowPosJ = json_pack("[f, f]", windowPos.x, windowPos.y); json_object_set_new(rootJ, "windowPos", windowPosJ); } @@ -78,7 +78,7 @@ static void settingsFromJson(json_t *rootJ) { if (windowSizeJ) { double width, height; json_unpack(windowSizeJ, "[F, F]", &width, &height); - guiSetWindowSize(Vec(width, height)); + windowSetWindowSize(Vec(width, height)); } // windowPos @@ -86,7 +86,7 @@ static void settingsFromJson(json_t *rootJ) { if (windowPosJ) { double x, y; json_unpack(windowPosJ, "[F, F]", &x, &y); - guiSetWindowPos(Vec(x, y)); + windowSetWindowPos(Vec(x, y)); } // opacity diff --git a/src/ui/MenuItem.cpp b/src/ui/MenuItem.cpp index 4a0270f8..5bc46499 100644 --- a/src/ui/MenuItem.cpp +++ b/src/ui/MenuItem.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -26,7 +26,7 @@ void MenuItem::draw(NVGcontext *vg) { void MenuItem::step() { // Add 10 more pixels because Retina measurements are sometimes too small const float rightPadding = 10.0; - // HACK use gVg from the gui. + // HACK use gVg from the window. // All this does is inspect the font, so it shouldn't modify gVg and should work when called from a FramebufferWidget for example. box.size.x = bndLabelWidth(gVg, -1, text.c_str()) + bndLabelWidth(gVg, -1, rightText.c_str()) + rightPadding; Widget::step(); diff --git a/src/ui/MenuLabel.cpp b/src/ui/MenuLabel.cpp index 2df80f72..7cb0b500 100644 --- a/src/ui/MenuLabel.cpp +++ b/src/ui/MenuLabel.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -12,7 +12,7 @@ void MenuLabel::draw(NVGcontext *vg) { void MenuLabel::step() { // Add 10 more pixels because Retina measurements are sometimes too small const float rightPadding = 10.0; - // HACK use gVg from the gui. + // HACK use gVg from the window. box.size.x = bndLabelWidth(gVg, -1, text.c_str()) + rightPadding; Widget::step(); } diff --git a/src/ui/Scene.cpp b/src/ui/Scene.cpp index c71b4133..64a003f2 100644 --- a/src/ui/Scene.cpp +++ b/src/ui/Scene.cpp @@ -1,5 +1,5 @@ #include "widgets.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { diff --git a/src/ui/ScrollBar.cpp b/src/ui/ScrollBar.cpp index ba46b799..a4676837 100644 --- a/src/ui/ScrollBar.cpp +++ b/src/ui/ScrollBar.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -11,7 +11,7 @@ void ScrollBar::draw(NVGcontext *vg) { void ScrollBar::onDragStart(EventDragStart &e) { state = BND_ACTIVE; - guiCursorLock(); + windowCursorLock(); } void ScrollBar::onDragMove(EventDragMove &e) { @@ -25,7 +25,7 @@ void ScrollBar::onDragMove(EventDragMove &e) { void ScrollBar::onDragEnd(EventDragEnd &e) { state = BND_DEFAULT; - guiCursorUnlock(); + windowCursorUnlock(); } diff --git a/src/ui/ScrollWidget.cpp b/src/ui/ScrollWidget.cpp index a738f54b..7c59caa7 100644 --- a/src/ui/ScrollWidget.cpp +++ b/src/ui/ScrollWidget.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -61,11 +61,11 @@ void ScrollWidget::onMouseMove(EventMouseMove &e) { // Scroll with arrow keys if (!gFocusedWidget) { float arrowSpeed = 30.0; - if (guiIsShiftPressed() && guiIsModPressed()) + if (windowIsShiftPressed() && windowIsModPressed()) arrowSpeed /= 16.0; - else if (guiIsShiftPressed()) + else if (windowIsShiftPressed()) arrowSpeed *= 4.0; - else if (guiIsModPressed()) + else if (windowIsModPressed()) arrowSpeed /= 4.0; if (glfwGetKey(gWindow, GLFW_KEY_LEFT) == GLFW_PRESS) { diff --git a/src/ui/Slider.cpp b/src/ui/Slider.cpp index c889b843..648921e7 100644 --- a/src/ui/Slider.cpp +++ b/src/ui/Slider.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { @@ -13,7 +13,7 @@ void Slider::draw(NVGcontext *vg) { void Slider::onDragStart(EventDragStart &e) { state = BND_ACTIVE; - guiCursorLock(); + windowCursorLock(); } void Slider::onDragMove(EventDragMove &e) { @@ -22,7 +22,7 @@ void Slider::onDragMove(EventDragMove &e) { void Slider::onDragEnd(EventDragEnd &e) { state = BND_DEFAULT; - guiCursorUnlock(); + windowCursorUnlock(); EventAction eAction; onAction(eAction); } diff --git a/src/ui/TextField.cpp b/src/ui/TextField.cpp index 54757e85..f093ac1e 100644 --- a/src/ui/TextField.cpp +++ b/src/ui/TextField.cpp @@ -1,6 +1,6 @@ #include "ui.hpp" // for gVg -#include "gui.hpp" +#include "window.hpp" // for key codes #include @@ -92,14 +92,14 @@ void TextField::onKey(EventKey &e) { end = begin = text.size(); break; case GLFW_KEY_V: - if (guiIsModPressed()) { + if (windowIsModPressed()) { const char *newText = glfwGetClipboardString(gWindow); if (newText) insertText(newText); } break; case GLFW_KEY_C: - if (guiIsModPressed()) { + if (windowIsModPressed()) { if (begin < end) { std::string selectedText = text.substr(begin, end - begin); glfwSetClipboardString(gWindow, selectedText.c_str()); diff --git a/src/ui/Tooltip.cpp b/src/ui/Tooltip.cpp index 6e555f18..8977976a 100644 --- a/src/ui/Tooltip.cpp +++ b/src/ui/Tooltip.cpp @@ -1,5 +1,5 @@ #include "ui.hpp" -#include "gui.hpp" +#include "window.hpp" namespace rack { diff --git a/src/widgets/FramebufferWidget.cpp b/src/widgets/FramebufferWidget.cpp index 72a6930e..f111dade 100644 --- a/src/widgets/FramebufferWidget.cpp +++ b/src/widgets/FramebufferWidget.cpp @@ -1,5 +1,5 @@ #include "widgets.hpp" -#include "gui.hpp" +#include "window.hpp" #include #include "../ext/nanovg/src/nanovg_gl.h" #include "../ext/nanovg/src/nanovg_gl_utils.h" diff --git a/src/gui.cpp b/src/window.cpp similarity index 97% rename from src/gui.cpp rename to src/window.cpp index e614a77f..f65c00a0 100644 --- a/src/gui.cpp +++ b/src/window.cpp @@ -1,4 +1,4 @@ -#include "gui.hpp" +#include "window.hpp" #include "app.hpp" #include "asset.hpp" @@ -30,6 +30,7 @@ namespace rack { + GLFWwindow *gWindow = NULL; NVGcontext *gVg = NULL; NVGcontext *gFramebufferVg = NULL; @@ -236,7 +237,7 @@ void cursorEnterCallback(GLFWwindow* window, int entered) { void scrollCallback(GLFWwindow *window, double x, double y) { Vec scrollRel = Vec(x, y); #if ARCH_LIN || ARCH_WIN - if (guiIsShiftPressed()) + if (windowIsShiftPressed()) scrollRel = Vec(y, x); #endif // onScroll @@ -305,7 +306,7 @@ void renderGui() { glfwSwapBuffers(gWindow); } -void guiInit() { +void windowInit() { int err; // Set up GLFW @@ -393,7 +394,7 @@ void guiInit() { bndSetTheme(theme); } -void guiDestroy() { +void windowDestroy() { gGuiFont.reset(); #if defined NANOVG_GL2 @@ -416,7 +417,7 @@ void guiDestroy() { glfwTerminate(); } -void guiRun() { +void windowRun() { assert(gWindow); gGuiFrame = 0; while(!glfwWindowShouldClose(gWindow)) { @@ -483,11 +484,11 @@ void guiRun() { } } -void guiClose() { +void windowClose() { glfwSetWindowShouldClose(gWindow, GLFW_TRUE); } -void guiCursorLock() { +void windowCursorLock() { if (gAllowCursorLock) { #ifdef ARCH_MAC glfwSetInputMode(gWindow, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); @@ -497,13 +498,13 @@ void guiCursorLock() { } } -void guiCursorUnlock() { +void windowCursorUnlock() { if (gAllowCursorLock) { glfwSetInputMode(gWindow, GLFW_CURSOR, GLFW_CURSOR_NORMAL); } } -bool guiIsModPressed() { +bool windowIsModPressed() { #ifdef ARCH_MAC return glfwGetKey(gWindow, GLFW_KEY_LEFT_SUPER) == GLFW_PRESS || glfwGetKey(gWindow, GLFW_KEY_RIGHT_SUPER) == GLFW_PRESS; #else @@ -511,35 +512,35 @@ bool guiIsModPressed() { #endif } -bool guiIsShiftPressed() { +bool windowIsShiftPressed() { return glfwGetKey(gWindow, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS || glfwGetKey(gWindow, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS; } -Vec guiGetWindowSize() { +Vec windowGetWindowSize() { int width, height; glfwGetWindowSize(gWindow, &width, &height); return Vec(width, height); } -void guiSetWindowSize(Vec size) { +void windowSetWindowSize(Vec size) { int width = size.x; int height = size.y; glfwSetWindowSize(gWindow, width, height); } -Vec guiGetWindowPos() { +Vec windowGetWindowPos() { int x, y; glfwGetWindowPos(gWindow, &x, &y); return Vec(x, y); } -void guiSetWindowPos(Vec pos) { +void windowSetWindowPos(Vec pos) { int x = pos.x; int y = pos.y; glfwSetWindowPos(gWindow, x, y); } -bool guiIsMaximized() { +bool windowIsMaximized() { return glfwGetWindowAttrib(gWindow, GLFW_MAXIMIZED); }