/* Copyright (c) 2014 Alex Diener 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. Alex Diener alex@ludobloom.com */ #include "glxshell/GLXShellCallbacks.h" bool (* drawCallback)(double referenceTime, double activeDrawDelta) __asm("drawCallback$GLXShell"); void (* resizeCallback)(unsigned int newWidth, unsigned int newHeight, double referenceTime) __asm("resizeCallback$GLXShell"); void (* keyDownCallback)(unsigned int charCode, unsigned int keyCode, unsigned int modifiers, bool isRepeat, double referenceTime) __asm("keyDownCallback$GLXShell"); void (* keyUpCallback)(unsigned int keyCode, unsigned int modifiers, double referenceTime) __asm("keyUpCallback$GLXShell"); void (* keyModifiersChangedCallback)(unsigned int modifiers, unsigned int lastModifiers, double referenceTime) __asm("keyModifiersChangedCallback$GLXShell"); void (* mouseDownCallback)(unsigned int buttonNumber, unsigned int buttonMask, float x, float y, unsigned int modifiers, double referenceTime) __asm("mouseDownCallback$GLXShell"); void (* mouseUpCallback)(unsigned int buttonNumber, unsigned int buttonMask, float x, float y, unsigned int modifiers, double referenceTime) __asm("mouseUpCallback$GLXShell"); void (* mouseMovedCallback)(float x, float y, float deltaX, float deltaY, unsigned int modifiers, double referenceTime) __asm("mouseMovedCallback$GLXShell"); void (* mouseDraggedCallback)(unsigned int buttonMask, float x, float y, float deltaX, float deltaY, unsigned int modifiers, double referenceTime) __asm("mouseDraggedCallback$GLXShell"); void (* mouseLeaveCallback)(unsigned int modifiers, double referenceTime) __asm("mouseLeaveCallback$GLXShell"); void (* scrollWheelCallback)(float x, float y, int deltaX, int deltaY, unsigned int modifiers, double referenceTime) __asm("scrollWheelCallback$GLXShell"); void (* backgroundedCallback)(double referenceTime) __asm("backgroundedCallback$GLXShell"); void (* foregroundedCallback)(double referenceTime) __asm("foregroundedCallback$GLXShell"); bool (* confirmQuitCallback)(double referenceTime) __asm("confirmQuitCallback$GLXShell"); void Shell_drawFunc(bool (* callback)(double referenceTime, double activeDrawDelta)) { drawCallback = callback; } void Shell_resizeFunc(void (* callback)(unsigned int newWidth, unsigned int newHeight, double referenceTime)) { resizeCallback = callback; } void Shell_keyDownFunc(void (* callback)(unsigned int charCode, unsigned int keyCode, unsigned int modifiers, bool isRepeat, double referenceTime)) { keyDownCallback = callback; } void Shell_keyUpFunc(void (* callback)(unsigned int keyCode, unsigned int modifiers, double referenceTime)) { keyUpCallback = callback; } void Shell_keyModifiersChangedFunc(void (* callback)(unsigned int modifiers, unsigned int lastModifiers, double referenceTime)) { keyModifiersChangedCallback = callback; } void Shell_mouseDownFunc(void (* callback)(unsigned int buttonNumber, unsigned int buttonMask, float x, float y, unsigned int modifiers, double referenceTime)) { mouseDownCallback = callback; } void Shell_mouseUpFunc(void (* callback)(unsigned int buttonNumber, unsigned int buttonMask, float x, float y, unsigned int modifiers, double referenceTime)) { mouseUpCallback = callback; } void Shell_mouseMovedFunc(void (* callback)(float x, float y, float deltaX, float deltaY, unsigned int modifiers, double referenceTime)) { mouseMovedCallback = callback; } void Shell_mouseDraggedFunc(void (* callback)(unsigned int buttonMask, float x, float y, float deltaX, float deltaY, unsigned int modifiers, double referenceTime)) { mouseDraggedCallback = callback; } void Shell_mouseLeaveFunc(void (* callback)(unsigned int modifiers, double referenceTime)) { mouseLeaveCallback = callback; } void Shell_scrollWheelFunc(void (* callback)(float x, float y, int deltaX, int deltaY, unsigned int modifiers, double referenceTime)) { scrollWheelCallback = callback; } void Shell_backgroundedFunc(void (* callback)(double referenceTime)) { backgroundedCallback = callback; } void Shell_foregroundedFunc(void (* callback)(double referenceTime)) { foregroundedCallback = callback; } void Shell_confirmQuitFunc(bool (* callback)(double referenceTime)) { confirmQuitCallback = callback; }