4 * The mouse cursor related stuff.
6 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
7 * Written by Pawel W. Olszta, <olszta@sourceforge.net>
8 * Creation date: Thu Dec 16 1999
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #include <GL/freeglut.h>
29 #include "fg_internal.h"
32 * TODO BEFORE THE STABLE RELEASE:
33 * glutSetCursor() -- Win32 mappings are incomplete.
35 * It would be good to use custom mouse cursor shapes, and introduce
36 * an option to display them using glBitmap() and/or texture mapping,
37 * apart from the windowing system version.
40 /* -- PRIVATE FUNCTIONS --------------------------------------------------- */
42 extern void fgPlatformSetCursor ( SFG_Window *window, int cursorID );
43 extern void fgPlatformWarpPointer ( int x, int y );
47 /* -- INTERNAL FUNCTIONS ---------------------------------------------------- */
48 void fgSetCursor ( SFG_Window *window, int cursorID )
50 fgPlatformSetCursor ( window, cursorID );
54 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
57 * Set the cursor image to be used for the current window
59 void FGAPIENTRY glutSetCursor( int cursorID )
61 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetCursor" );
62 FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetCursor" );
64 fgPlatformSetCursor ( fgStructure.CurrentWindow, cursorID );
65 fgStructure.CurrentWindow->State.Cursor = cursorID;
69 * Moves the mouse pointer to given window coordinates
71 void FGAPIENTRY glutWarpPointer( int x, int y )
73 FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
74 FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );
76 fgPlatformWarpPointer ( x, y );