You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
648B

  1. #pragma once
  2. #include "app.hpp"
  3. #include <GL/glew.h>
  4. #include <GLFW/glfw3.h>
  5. namespace rack {
  6. extern GLFWwindow *gWindow;
  7. extern NVGcontext *gVg;
  8. extern std::shared_ptr<Font> gGuiFont;
  9. extern float gPixelRatio;
  10. void guiInit();
  11. void guiDestroy();
  12. void guiRun();
  13. void guiCursorLock();
  14. void guiCursorUnlock();
  15. inline bool guiIsModPressed() {
  16. #ifdef ARCH_MAC
  17. return glfwGetKey(gWindow, GLFW_KEY_LEFT_SUPER) == GLFW_PRESS || glfwGetKey(gWindow, GLFW_KEY_RIGHT_SUPER) == GLFW_PRESS;
  18. #else
  19. return glfwGetKey(gWindow, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS || glfwGetKey(gWindow, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS;
  20. #endif
  21. }
  22. } // namespace rack