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.

55 lines
1.2KB

  1. #pragma once
  2. #define GLEW_STATIC
  3. #include <GL/glew.h>
  4. #include <GLFW/glfw3.h>
  5. #include "common.hpp"
  6. #include "widgets.hpp"
  7. #ifdef ARCH_MAC
  8. #define WINDOW_MOD_KEY_NAME "Cmd"
  9. #else
  10. #define WINDOW_MOD_KEY_NAME "Ctrl"
  11. #endif
  12. namespace rack {
  13. extern GLFWwindow *gWindow;
  14. extern NVGcontext *gVg;
  15. extern NVGcontext *gFramebufferVg;
  16. /** The default font to use for GUI elements */
  17. extern std::shared_ptr<Font> gGuiFont;
  18. /** The scaling ratio */
  19. extern float gPixelRatio;
  20. /* The ratio between the framebuffer size and the window size reported by the OS.
  21. This is not equal to gPixelRatio in general.
  22. */
  23. extern float gWindowRatio;
  24. extern bool gAllowCursorLock;
  25. extern int gGuiFrame;
  26. extern math::Vec gMousePos;
  27. void windowInit();
  28. void windowDestroy();
  29. void windowRun();
  30. void windowClose();
  31. void windowCursorLock();
  32. void windowCursorUnlock();
  33. bool windowIsModPressed();
  34. bool windowIsShiftPressed();
  35. math::Vec windowGetWindowSize();
  36. void windowSetWindowSize(math::Vec size);
  37. math::Vec windowGetWindowPos();
  38. void windowSetWindowPos(math::Vec pos);
  39. bool windowIsMaximized();
  40. void windowSetTheme(NVGcolor bg, NVGcolor fg);
  41. void windowSetFullScreen(bool fullScreen);
  42. bool windowGetFullScreen();
  43. } // namespace rack