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.

63 lines
1.4KB

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