X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2FCommon%2Ffreeglut_cursor.c;h=b9254c1eb8127d65d0041a083ff91cb2f0c96e0a;hb=1ede9f68f98e29ddd07bd466310967e716bfac92;hp=3b144f364cdd056e1acfc66e393af5f073a7aaac;hpb=b29d44e0b19fc28021b9ecf2da354c1225b64cfb;p=freeglut diff --git a/src/Common/freeglut_cursor.c b/src/Common/freeglut_cursor.c index 3b144f3..b9254c1 100644 --- a/src/Common/freeglut_cursor.c +++ b/src/Common/freeglut_cursor.c @@ -1,79 +1,79 @@ -/* - * freeglut_cursor.c - * - * The mouse cursor related stuff. - * - * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. - * Written by Pawel W. Olszta, - * Creation date: Thu Dec 16 1999 - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include -#include "freeglut_internal.h" - -/* - * TODO BEFORE THE STABLE RELEASE: - * glutSetCursor() -- Win32 mappings are incomplete. - * - * It would be good to use custom mouse cursor shapes, and introduce - * an option to display them using glBitmap() and/or texture mapping, - * apart from the windowing system version. - */ - -/* -- PRIVATE FUNCTIONS --------------------------------------------------- */ - -extern void fgPlatformSetCursor ( SFG_Window *window, int cursorID ); -extern void fgPlatformWarpPointer ( int x, int y ); - - - -/* -- INTERNAL FUNCTIONS ---------------------------------------------------- */ -void fgSetCursor ( SFG_Window *window, int cursorID ) -{ - fgPlatformSetCursor ( window, cursorID ); -} - - -/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ - -/* - * Set the cursor image to be used for the current window - */ -void FGAPIENTRY glutSetCursor( int cursorID ) -{ - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" ); - FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" ); - - fgPlatformSetCursor ( fgStructure.CurrentWindow, cursorID ); - fgStructure.CurrentWindow->State.Cursor = cursorID; -} - -/* - * Moves the mouse pointer to given window coordinates - */ -void FGAPIENTRY glutWarpPointer( int x, int y ) -{ - FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" ); - FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" ); - - fgPlatformWarpPointer ( x, y ); -} - -/*** END OF FILE ***/ +/* + * freeglut_cursor.c + * + * The mouse cursor related stuff. + * + * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. + * Written by Pawel W. Olszta, + * Creation date: Thu Dec 16 1999 + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "freeglut_internal.h" + +/* + * TODO BEFORE THE STABLE RELEASE: + * glutSetCursor() -- Win32 mappings are incomplete. + * + * It would be good to use custom mouse cursor shapes, and introduce + * an option to display them using glBitmap() and/or texture mapping, + * apart from the windowing system version. + */ + +/* -- PRIVATE FUNCTIONS --------------------------------------------------- */ + +extern void fgPlatformSetCursor ( SFG_Window *window, int cursorID ); +extern void fgPlatformWarpPointer ( int x, int y ); + + + +/* -- INTERNAL FUNCTIONS ---------------------------------------------------- */ +void fgSetCursor ( SFG_Window *window, int cursorID ) +{ + fgPlatformSetCursor ( window, cursorID ); +} + + +/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ + +/* + * Set the cursor image to be used for the current window + */ +void FGAPIENTRY glutSetCursor( int cursorID ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" ); + FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" ); + + fgPlatformSetCursor ( fgStructure.CurrentWindow, cursorID ); + fgStructure.CurrentWindow->State.Cursor = cursorID; +} + +/* + * Moves the mouse pointer to given window coordinates + */ +void FGAPIENTRY glutWarpPointer( int x, int y ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" ); + FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" ); + + fgPlatformWarpPointer ( x, y ); +} + +/*** END OF FILE ***/