Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Enumerations | Functions
cursor.cpp File Reference
#include "precompiled.h"
#include "cursor.h"
#include <cstring>
#include <cstdio>
#include <sstream>
#include "lib/ogl.h"
#include "lib/sysdep/cursor.h"
#include "ogl_tex.h"
#include "lib/res/h_mgr.h"

Go to the source code of this file.

Classes

class  GLCursor
 
struct  Cursor
 

Macros

#define ALLOW_SYS_CURSOR   0
 

Enumerations

enum  CursorKind { CK_Default, CK_System, CK_OpenGL }
 

Functions

static Status load_sys_cursor (const PIVFS &vfs, const VfsPath &pathname, int hx, int hy, sys_cursor *cursor)
 
 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

Definition at line 45 of file cursor.cpp.

Enumeration Type Documentation

enum CursorKind
Enumerator
CK_Default 
CK_System 
CK_OpenGL 

Definition at line 150 of file cursor.cpp.

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.

Definition at line 309 of file cursor.cpp.

static void Cursor_dtor ( Cursor c)
static

Definition at line 179 of file cursor.cpp.

static Status cursor_free ( Handle h)
static

Definition at line 303 of file cursor.cpp.

static void Cursor_init ( Cursor c,
va_list  args 
)
static

Definition at line 174 of file cursor.cpp.

static Handle cursor_load ( const PIVFS vfs,
const VfsPath name,
bool  forceGL 
)
static

Definition at line 293 of file cursor.cpp.

static Status Cursor_reload ( Cursor c,
const PIVFS vfs,
const VfsPath name,
Handle   
)
static

Definition at line 201 of file cursor.cpp.

void cursor_shutdown ( )

Forcibly frees all cursor handles.

Currently used just prior to SDL shutdown.

Definition at line 298 of file cursor.cpp.

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

Definition at line 259 of file cursor.cpp.

static Status Cursor_validate ( const Cursor c)
static

Definition at line 235 of file cursor.cpp.

H_TYPE_DEFINE ( Cursor  )
static Status load_sys_cursor ( const PIVFS vfs,
const VfsPath pathname,
int  hx,
int  hy,
sys_cursor cursor 
)
static

Definition at line 49 of file cursor.cpp.