CRM32Pro SDK
v5.22
|
ICursor. More...
ICursor.
Interface to manage cursor.
Public Member Functions | |
void | AutoRestore (char value) |
Enable or disable auto background restore. More... | |
void | ChangeType (char id, char type) |
Change the type of given cursor. More... | |
void | ClipRegion (int xi, int yi, int xf, int yf) |
Define a valid clip region. More... | |
void | Close (void) |
Close cursor system. More... | |
char | Create (char *imgfile, char type=CTYPE_NORMAL) |
Create a new cursor from an external image file(BMP/PNG) More... | |
char | Create (SDL_Surface *surf, char type=CTYPE_NORMAL) |
Create a new cursor from a given surface. More... | |
void | Delete (char id) |
Delete a cursor. More... | |
void | Hide (void) |
Hide current cursor. More... | |
void | Info () |
Print a lot of useful cursor interface information. Very useful for debugging purposes. | |
void | Init (void) |
Initialize cursor system. More... | |
void | Invalidate (void) |
When the background cursor will be changed, it invalidates current background restore and stores the new one. Call immediately after blit the new background. | |
char | Load (char *fDPF, char *nameIPF, char type=CTYPE_NORMAL) |
Load a cursor from an IPF stored on a DPF(using a filename) More... | |
char | Load (int idDPF, char *nameIPF, char type=CTYPE_NORMAL) |
Load a cursor from an IPF stored on a DPF(using an idDPF) More... | |
void | Select (char id) |
Select a cursor and define it as current cursor. More... | |
void | SetPosition (int x, int y) |
Set a new cursor position. More... | |
void | SetSmooth (char value) |
Enable or disable smooth movement. More... | |
void | Show (void) |
Show current cursor. More... | |
Friends | |
class | CRM32Pro_CFont |
class | CRM32Pro_CSprite |
class | CRM32Pro_CTile |
class | CRM32Pro_IPrimitives |
class | CRM32Pro_Main |
void CRM32Pro_ICursor::AutoRestore | ( | char | value | ) |
Enable or disable auto background restore.
This setting will override previous auto restore value.
If you used ACCEL_HARDSMOOTH(which will try to set a double-buffer) acceleration mode, it is disabled by default.
On other modes, is enabled by default.
So, if you are blitting and updating all your graphics stuff, you should disable the auto restore to avoid non-desidered effects and to help to improve the performance a little bit. OpenGL modes will disable this feature and avoid to enable it.
value | 0 to disable auto restore, any value to enable it. |
void CRM32Pro_ICursor::ChangeType | ( | char | id, |
char | type | ||
) |
Change the type of given cursor.
id | cursor id to change the type |
type | type of cursor, by default is normal blit mode(See definition of CTYPE_xx) |
void CRM32Pro_ICursor::ClipRegion | ( | int | xi, |
int | yi, | ||
int | xf, | ||
int | yf | ||
) |
Define a valid clip region.
xi | coordinate X from up-left corner of clip region |
yi | coordinate Y from up-left corner of clip region |
xf | coordinate X from down-right corner of clip region |
yf | coordinate Y from down-right corner of clip region |
void CRM32Pro_ICursor::Close | ( | void | ) |
Close cursor system.
Give cursor control to SDL and free all created cursors
char CRM32Pro_ICursor::Create | ( | char * | filename, |
char | type = CTYPE_NORMAL |
||
) |
Create a new cursor from an external image file(BMP/PNG)
With both type image files,BMP and PNG, colorkey is always the RGB value of the pixel at (0,0) and alpha per-surface is always disabled.
But if the PNG has alpha per-pixel, it will use it.
filename | Image file name, with its full path, containing the cursor |
type | type of cursor, by default is normal blit mode(See definition of CTYPE_xx) |
char CRM32Pro_ICursor::Create | ( | SDL_Surface * | surf, |
char | type = CTYPE_NORMAL |
||
) |
Create a new cursor from a given surface.
Alpha per surface with or without colorkey and alpha per pixel will be the same of the given surface.
If colorkey or alpha per pixel are not set, colorkey will be the RGB value of the pixel at (0,0).
surf | pointer to surface to create the cursor. |
type | type of cursor, by default is normal blit mode(See definition of CTYPE_xx) |
void CRM32Pro_ICursor::Delete | ( | char | id | ) |
Delete a cursor.
id | cursor id to be deleted |
void CRM32Pro_ICursor::Hide | ( | void | ) |
Hide current cursor.
It call to CRM32Pro.RenderNeeded() to enable the next render
void CRM32Pro_ICursor::Init | ( | void | ) |
Initialize cursor system.
It needs a valid CRM32Pro.screen. Take cursor control from SDL.
It activates autorestore with normal video modes but turn off with SDL_DOUBLEBUF.
char CRM32Pro_ICursor::Load | ( | char * | fDPF, |
char * | nameIPF, | ||
char | type = CTYPE_NORMAL |
||
) |
Load a cursor from an IPF stored on a DPF(using a filename)
Alpha per surface with or without colorkey and alpha per pixel will be the same of the given IPF.
If colorkey and alpha per pixel are not set, colorkey will be the RGB value of the (0,0) surface position.
fDPF | DPF name to open and load image cursor |
nameIPF | image name (IPF) to load as cursor |
type | type of cursor, by default is normal blit mode(See definition of CTYPE_xx) |
char CRM32Pro_ICursor::Load | ( | int | idDPF, |
char * | nameIPF, | ||
char | type = CTYPE_NORMAL |
||
) |
Load a cursor from an IPF stored on a DPF(using an idDPF)
Alpha per surface with or without colorkey and alpha per pixel will be the same of the given IPF.
If colorkey and alpha per pixel are not set, colorkey will be the RGB value of the (0,0) surface position.
idDPF | ID of the opened DPF |
nameIPF | image name (IPF) to load as cursor |
type | type of cursor, by default is normal blit mode(See definition of CTYPE_xx) |
void CRM32Pro_ICursor::Select | ( | char | id | ) |
Select a cursor and define it as current cursor.
id | cursor id to select as current |
void CRM32Pro_ICursor::SetPosition | ( | int | x, |
int | y | ||
) |
Set a new cursor position.
x | desired new x position |
y | desired new y position |
void CRM32Pro_ICursor::SetSmooth | ( | char | value | ) |
Enable or disable smooth movement.
By default it is enabled.
value | 0 to disable smooth movement, any value to enable it. |
void CRM32Pro_ICursor::Show | ( | void | ) |
Show current cursor.
It call to CRM32Pro.RenderNeeded() to enable the next render