Pyrogenesis  trunk
cursor.h
Go to the documentation of this file.
1 /* Copyright (c) 2010 Wildfire Games
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to
9  * the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 /*
24  * mouse cursors (either via OpenGL texture or hardware)
25  */
26 
27 #ifndef INCLUDED_GRAPHICS_CURSOR
28 #define INCLUDED_GRAPHICS_CURSOR
29 
30 #include "lib/file/vfs/vfs.h"
31 
32 /**
33  * Draw the cursor on-screen.
34  *
35  * @param vfs
36  * @param name Base name of cursor or zero to hide the cursor.
37  * @param x,y Coordinates [pixels] (origin at lower left)
38  * (the origin is convenient for drawing via OpenGL, but requires the
39  * mouse Y coordinate to be subtracted from the client area height.
40  * Making the caller responsible for this avoids a dependency on
41  * the g_yres global variable.)
42  * @param forceGL Require the OpenGL cursor implementation, not hardware cursor
43  *
44  * Uses a hardware mouse cursor where available, otherwise a
45  * portable OpenGL implementation.
46  **/
47 extern Status cursor_draw(const PIVFS& vfs, const wchar_t* name, int x, int y, bool forceGL);
48 
49 /**
50  * Forcibly frees all cursor handles.
51  *
52  * Currently used just prior to SDL shutdown.
53  */
54 void cursor_shutdown();
55 
56 #endif // #ifndef INCLUDED_GRAPHICS_CURSOR
shared_ptr< IVFS > PIVFS
Definition: vfs.h:226
void cursor_shutdown()
Forcibly frees all cursor handles.
Definition: cursor.cpp:305
Status cursor_draw(const PIVFS &vfs, const wchar_t *name, int x, int y, bool forceGL)
Draw the cursor on-screen.
Definition: cursor.cpp:316
i64 Status
Error handling system.
Definition: status.h:171
Definition: vfs_util.cpp:39