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.

window.hpp 1.0KB

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