Pyrogenesis  trunk
Classes | Macros | Enumerations | Functions
cursor.cpp File Reference
#include "precompiled.h"
#include "cursor.h"
#include <cstdio>
#include <cstring>
#include <sstream>
#include "lib/external_libraries/libsdl.h"
#include "lib/ogl.h"
#include "lib/res/h_mgr.h"
#include "lib/sysdep/cursor.h"
#include "ogl_tex.h"
Include dependency graph for cursor.cpp:

Classes

class  SDLCursor
 
class  GLCursor
 
struct  Cursor
 

Macros

#define ALLOW_SYS_CURSOR   0
 

Enumerations

enum  CursorKind { CK_Default, CK_SDL, CK_OpenGL }
 

Functions

 H_TYPE_DEFINE (Cursor)
 
static void Cursor_init (Cursor *c, va_list args)
 
static void Cursor_dtor (Cursor *c)
 
static Status Cursor_reload (Cursor *c, const PIVFS &vfs, const VfsPath &name, Handle)
 
static Status Cursor_validate (const Cursor *c)
 
static Status Cursor_to_string (const Cursor *c, wchar_t *buf)
 
static Handle cursor_load (const PIVFS &vfs, const VfsPath &name, bool forceGL)
 
void cursor_shutdown ()
 Forcibly frees all cursor handles. More...
 
static Status cursor_free (Handle &h)
 
Status cursor_draw (const PIVFS &vfs, const wchar_t *name, int x, int y, bool forceGL)
 Draw the cursor on-screen. More...
 

Macro Definition Documentation

#define ALLOW_SYS_CURSOR   0

Enumeration Type Documentation

enum CursorKind
Enumerator
CK_Default 
CK_SDL 
CK_OpenGL 

Function Documentation

Status cursor_draw ( const PIVFS vfs,
const wchar_t name,
int  x,
int  y,
bool  forceGL 
)

Draw the cursor on-screen.

Parameters
vfs
nameBase name of cursor or zero to hide the cursor.
x,yCoordinates [pixels] (origin at lower left) (the origin is convenient for drawing via OpenGL, but requires the mouse Y coordinate to be subtracted from the client area height. Making the caller responsible for this avoids a dependency on the g_yres global variable.)
forceGLRequire the OpenGL cursor implementation, not hardware cursor

Uses a hardware mouse cursor where available, otherwise a portable OpenGL implementation.

static void Cursor_dtor ( Cursor c)
static
static Status cursor_free ( Handle h)
static
static void Cursor_init ( Cursor c,
va_list  args 
)
static
static Handle cursor_load ( const PIVFS vfs,
const VfsPath name,
bool  forceGL 
)
static
static Status Cursor_reload ( Cursor c,
const PIVFS vfs,
const VfsPath name,
Handle   
)
static
void cursor_shutdown ( )

Forcibly frees all cursor handles.

Currently used just prior to SDL shutdown.

static Status Cursor_to_string ( const Cursor c,
wchar_t buf 
)
static
static Status Cursor_validate ( const Cursor c)
static
H_TYPE_DEFINE ( Cursor  )