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.

51 lines
1.1KB

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