//======================================================================== // GLFW 3.4 - www.glfw.org //------------------------------------------------------------------------ // Copyright (c) 2016 Google Inc. // Copyright (c) 2016-2017 Camilla Löwy // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would // be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not // be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. // //======================================================================== #pragma once // Include files #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* GL Stuff */ #ifndef GL4ES #include #include #endif #define MIN_MINIGLVERSION 2 #define MIN_OGLES2_VERSION 0 #define GLFW_OS4_WINDOW_STATE _GLFWwindowOS4 os4; #define GLFW_OS4_LIBRARY_WINDOW_STATE _GLFWlibraryOS4 os4; #define GLFW_OS4_MONITOR_STATE _GLFWmonitorOS4 os4; #define GLFW_OS4_CONTEXT_STATE _GLFWcontextGL gl; #define GLFW_OS4_CURSOR_STATE _GLFWcursorOS4 os4; #define GLFW_OS4_LIBRARY_CONTEXT_STATE struct MyIntuiMessage { uint32 Class; uint16 Code; uint16 Qualifier; struct Gadget *Gadget; struct Window *IDCMPWindow; int16 RelativeMouseX; int16 RelativeMouseY; int16 WindowMouseX; // Absolute pointer position, relative to int16 WindowMouseY; // top-left corner of inner window int16 ScreenMouseX; int16 ScreenMouseY; int16 Width; // Inner window dimensions int16 Height; }; // OS4-specific per-window data // typedef struct _GLFWwindowOS4 { struct Window *handle; int xpos; int ypos; int lastCursorPosX; int lastCursorPosY; int width; int height; char *title; GLFWbool visible; GLFWbool iconified; GLFWbool maximized; GLFWbool resizable; GLFWbool decorated; GLFWbool floating; GLFWbool transparent; float opacity; int windowType; // NORMAL - GL - GLES } _GLFWwindowOS4; typedef struct _GLFWcontextGL { struct BitMap *bm; void* glContext; } _GLFWcontextGL; // OS4-specific per-monitor data // typedef struct _GLFWmonitorOS4 { GLFWgammaramp ramp; } _GLFWmonitorOS4; // X11-specific per-cursor data // typedef struct _GLFWcursorX11 { Object *handle; uint32_t *imageData; } _GLFWcursorOS4; // OS4-specific global data // typedef struct _GLFWlibraryOS4 { int xcursor; int ycursor; char keynames[GLFW_KEY_LAST + 1][17]; short int keycodes[256]; short int scancodes[GLFW_KEY_LAST + 1]; char *clipboardString; struct MsgPort *appMsgPort; struct MsgPort *userPort; _GLFWwindow *focusedWindow; } _GLFWlibraryOS4; void _glfwPollMonitorsOS4(void); GLFWbool _glfwConnectOS4(int platformID, _GLFWplatform* platform); int _glfwInitOS4(void); void _glfwTerminateOS4(void); void _glfwFreeMonitorOS4(_GLFWmonitor* monitor); void _glfwGetMonitorPosOS4(_GLFWmonitor* monitor, int* xpos, int* ypos); void _glfwGetMonitorContentScaleOS4(_GLFWmonitor* monitor, float* xscale, float* yscale); void _glfwGetMonitorWorkareaOS4(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); GLFWvidmode* _glfwGetVideoModesOS4(_GLFWmonitor* monitor, int* found); void _glfwGetVideoModeOS4(_GLFWmonitor* monitor, GLFWvidmode* mode); GLFWbool _glfwGetGammaRampOS4(_GLFWmonitor* monitor, GLFWgammaramp* ramp); void _glfwSetGammaRampOS4(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); int _glfwCreateWindowOS4(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); void _glfwDestroyWindowOS4(_GLFWwindow* window); void _glfwSetWindowTitleOS4(_GLFWwindow* window, const char* title); void _glfwSetWindowIconOS4(_GLFWwindow* window, int count, const GLFWimage* images); void _glfwSetWindowMonitorOS4(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); void _glfwGetWindowPosOS4(_GLFWwindow* window, int* xpos, int* ypos); void _glfwSetWindowPosOS4(_GLFWwindow* window, int xpos, int ypos); void _glfwGetWindowSizeOS4(_GLFWwindow* window, int* width, int* height); void _glfwSetWindowSizeOS4(_GLFWwindow* window, int width, int height); void _glfwSetWindowSizeLimitsOS4(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); void _glfwSetWindowAspectRatioOS4(_GLFWwindow* window, int n, int d); void _glfwGetFramebufferSizeOS4(_GLFWwindow* window, int* width, int* height); void _glfwGetWindowFrameSizeOS4(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); void _glfwGetWindowContentScaleOS4(_GLFWwindow* window, float* xscale, float* yscale); void _glfwIconifyWindowOS4(_GLFWwindow* window); void _glfwRestoreWindowOS4(_GLFWwindow* window); void _glfwMaximizeWindowOS4(_GLFWwindow* window); int _glfwWindowMaximizedOS4(_GLFWwindow* window); int _glfwWindowHoveredOS4(_GLFWwindow* window); int _glfwFramebufferTransparentOS4(_GLFWwindow* window); void _glfwSetWindowResizableOS4(_GLFWwindow* window, GLFWbool enabled); void _glfwSetWindowDecoratedOS4(_GLFWwindow* window, GLFWbool enabled); void _glfwSetWindowFloatingOS4(_GLFWwindow* window, GLFWbool enabled); void _glfwSetWindowMousePassthroughOS4(_GLFWwindow* window, GLFWbool enabled); float _glfwGetWindowOpacityOS4(_GLFWwindow* window); void _glfwSetWindowOpacityOS4(_GLFWwindow* window, float opacity); void _glfwSetRawMouseMotionOS4(_GLFWwindow *window, GLFWbool enabled); GLFWbool _glfwRawMouseMotionSupportedOS4(void); void _glfwShowWindowOS4(_GLFWwindow* window); void _glfwRequestWindowAttentionOS4(_GLFWwindow* window); void _glfwRequestWindowAttentionOS4(_GLFWwindow* window); void _glfwHideWindowOS4(_GLFWwindow* window); void _glfwFocusWindowOS4(_GLFWwindow* window); int _glfwWindowFocusedOS4(_GLFWwindow* window); int _glfwWindowIconifiedOS4(_GLFWwindow* window); int _glfwWindowVisibleOS4(_GLFWwindow* window); void _glfwPollEventsOS4(void); void _glfwWaitEventsOS4(void); void _glfwWaitEventsTimeoutOS4(double timeout); void _glfwPostEmptyEventOS4(void); void _glfwGetCursorPosOS4(_GLFWwindow* window, double* xpos, double* ypos); void _glfwSetCursorPosOS4(_GLFWwindow* window, double x, double y); void _glfwSetCursorModeOS4(_GLFWwindow* window, int mode); int _glfwCreateCursorOS4(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); int _glfwCreateStandardCursorOS4(_GLFWcursor* cursor, int shape); void _glfwDestroyCursorOS4(_GLFWcursor* cursor); void _glfwSetCursorOS4(_GLFWwindow* window, _GLFWcursor* cursor); void _glfwSetClipboardStringOS4(const char* string); const char* _glfwGetClipboardStringOS4(void); const char* _glfwGetScancodeNameOS4(int scancode); int _glfwGetKeyScancodeOS4(int key); GLFWbool _glfwInitJoysticksOS4(void); void _glfwTerminateJoysticksOS4(void); int _glfwPollJoystickOS4(_GLFWjoystick* js, int mode); const char* _glfwGetMappingNameOS4(void); void _glfwUpdateGamepadGUIDOS4(char* guid); void _glfwGetRequiredInstanceExtensionsOS4(char** extensions); int _glfwGetPhysicalDevicePresentationSupportOS4(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); VkResult _glfwCreateWindowSurfaceOS4(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); void _glfwPollMonitorsOS4(void);