Mouse pointer dissapears using SDL_FULLSCREEN?
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.
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:
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.
- 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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement