Wiki Page Content

Differences between revisions 8 and 9
Revision 8 as of 2015-05-31 18:55:45
Size: 1261
Comment: Hid green comment in comment.
Revision 9 as of 2016-10-02 18:07:24
Size: 1515
Editor: urkle
Comment: clarify input parameters can use the constants (which hav
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
||'''toggle'''||1 to show the cursor, 0 to hide it, -1 to query the current state|| ||'''toggle'''||SDL_ENABLE to show the cursor, SDL_DISABLE to hide it, SDL_QUERY to query the current state||
Line 19: Line 19:
Returns 1 if the cursor is shown, or 0 if the cursor is hidden, or a negative error code on failure; call [[SDL_GetError]]() for more information. Returns SDL_ENABLE if the cursor is shown, or SDL_DISABLE if the cursor is hidden, or a negative error code on failure; call [[SDL_GetError]]() for more information.
Line 37: Line 37:
/* <<Color2(col=green,text="The above has been rearranged from the original. Do these apply in 2.0?")>> */ '''toggle''' may be any of the following:
||-1||SDL_QUERY||returns the current visibility of the cursor||
||0||SDL_DISABLE||makes the cursor hidden (also a return value as to the current state of the cursor)||
||1||SDL_ENABLE||makes the cursor visible (also a return value as to the current state of the cursor)||

DRAFT

SDL_ShowCursor

Use this function to toggle whether or not the cursor is shown.

Syntax

int SDL_ShowCursor(int toggle)

Function Parameters

toggle

SDL_ENABLE to show the cursor, SDL_DISABLE to hide it, SDL_QUERY to query the current state

Return Value

Returns SDL_ENABLE if the cursor is shown, or SDL_DISABLE if the cursor is hidden, or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

int main(int argc, char** argv) {
    SDL_ShowCursor(SDL_DISABLE);
    ...
    return 0;
}
/* creates a blank cursor */

Remarks

The cursor starts off displayed but can be turned off. Passing SDL_ENABLE displays the cursor and passing SDL_DISABLE hides it.

The current state of the mouse cursor can be queried by passing SDL_QUERY; either SDL_DISABLE or SDL_ENABLE will be returned.

toggle may be any of the following:

-1

SDL_QUERY

returns the current visibility of the cursor

0

SDL_DISABLE

makes the cursor hidden (also a return value as to the current state of the cursor)

1

SDL_ENABLE

makes the cursor visible (also a return value as to the current state of the cursor)


CategoryAPI, CategoryMouse

None: SDL_ShowCursor (last edited 2016-10-20 20:30:49 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit