Jump to content
  • Advertisement
Sign in to follow this  
garyfletcher

Mouse pointer dissapears using SDL_FULLSCREEN?

This topic is 4774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there. I've been working on my SDL game engine for a couple of weeks now and I've just done my 1st game with it. It's actually mostly nicked from Cone's GFX with SDL tutorials...well except for the engine bit. I'd be really grateful if you'd take a look, have a play, look at the code and give me some feedback as to general design, things that need adding. Etc. One problem I'm having though is that the mouse pointer dissapears when using SDL_FULLSCREEN. Any ideas? Anyway the project is built with dev-c++ and can be found here if you fancy a go. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Yes, when you use fullscreen, the cursor does indeed disappear and SDL_ShowCursor( true ); will not bring it back [sad]. So what you have to do is make your own little cursor, perhaps a 16x16 BMP and use that instead. It will get a little tricky to get perfect, but the general idea is this:

- Update Mouse Coords
- Draw Game
- Draw Cursor Last (so it's on top)


That's about it really, you might want to add in some smoothing of the movements if it starts to tear a lot. Give that a shot and see if you can get what you want.

Share this post


Link to post
Share on other sites
Using a manually programmed in cursor will also allow you to have absolute control over the user. If you want to force the mouse in a square, you can do that. Oh, and make sure you use the change of x and y instead of updating the cursor to the location of mouse.

Share this post


Link to post
Share on other sites
So use the relative x and y as opposed to the absolute x and y values?

One question. I assume that a programatic pointer will work as well in non-fullscreen mode?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!