Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

SDL_CreateCursor, does it work?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 Acharis   Members   

5966
Like
0Likes
Like

Posted 25 November 2012 - 04:59 PM

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.
Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

Stellar Monarch (4X, turn based): GDN forum topic - Twitter - Facebook - YouTube

#2 ic0de   Members   

974
Like
0Likes
Like

Posted 17 December 2012 - 03:14 PM

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.or...DL_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.


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:
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));

Currently working on new DOS game, Chuck Jones: Space Cop of the Future, Check out my Dev Blog
 

you know you program too much when you start ending sentences with semicolons;


#3 Acharis   Members   

5966
Like
0Likes
Like

Posted 19 December 2012 - 06:31 PM

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:

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));

SDL 2.0 only :(

Maybe I should switch...
Working on an Emperor focused, no micromanagement, asymmetric, 4X, space empire builder:

Stellar Monarch (4X, turn based): GDN forum topic - Twitter - Facebook - YouTube




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.