Sign in to follow this  
Acharis

SDL_CreateCursor, does it work?

Recommended Posts

Acharis    5979
I need to change the "system" mouse cursor (I do NOT WANT TO USE BLIT). So, I tried SDL_CreateCursor but can't find any working example.

http://www.libsdl.org/cgi/docwiki.cgi/SDL_CreateCursor (that one crashes my game)

1. Do you know of any working example of SDL_CreateCursor?
2. Have you ever tried it? Have you made SDL_CreateCursor working?
3. Any possible clues where the problem might be?


I'm using Code::Blocks and SDL 1.2.15 + SDL_Mixer + SDL_TTF + OpenGL.

Share this post


Link to post
Share on other sites
ic0de    1012
[quote name='Acharis' timestamp='1353884344' post='5004033']
I need to change the "system" mouse cursor (I do NOT WANT TO USE BLIT). So, I tried SDL_CreateCursor but can't find any working example.

[url="http://www.libsdl.org/cgi/docwiki.cgi/SDL_CreateCursor"]http://www.libsdl.or...DL_CreateCursor[/url] (that one crashes my game)

1. Do you know of any working example of SDL_CreateCursor?
2. Have you ever tried it? Have you made SDL_CreateCursor working?
3. Any possible clues where the problem might be?


I'm using Code::Blocks and SDL 1.2.15 + SDL_Mixer + SDL_TTF + OpenGL.
[/quote]

I don't know about SDL_CreateCursor but SDL_CreateColorCursor works great for me its basically the same function except it uses an SDL_Surface as input I use this function after I create my window like so:
[CODE]
mainwindow = SDL_CreateWindow("game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags);
SDL_SetCursor(SDL_CreateColorCursor(IMG_Load("Resources/Textures/cursor.png"), 0, 0));
[/CODE]

Share this post


Link to post
Share on other sites
Acharis    5979
[quote name='ic0de' timestamp='1355778884' post='5011822']
I don't know about SDL_CreateCursor but SDL_CreateColorCursor works great for me its basically the same function except it uses an SDL_Surface as input I use this function after I create my window like so:
[CODE]
mainwindow = SDL_CreateWindow("game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, flags);
SDL_SetCursor(SDL_CreateColorCursor(IMG_Load("Resources/Textures/cursor.png"), 0, 0));
[/CODE]
[/quote]SDL 2.0 only :(

Maybe I should switch...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this