[SDL] Custom mouse cursor size
David Olofson
david at olofson.net
Tue Dec 5 02:21:13 PST 2006
On Tuesday 05 December 2006 10:47, benang at cs.its.ac.id wrote:
> Hi, I needed to make a large customized mouse cursor. What is the
> maximum dimension of a mouse cursor? I know that the width and
> height have to be a multiple of 8, so can I make, for example, 160 x
> 160 pixel cursor? Thanks in advance.
I don't think there is any reliable and portable way of doing that,
using the "real" mouse cursor features. The mouse cursor is often an
actual hardware sprite, which means size, depth, blending features
etc are totally hardware dependent. Even when it's not a hardware
sprite, you may run into platform API and/or driver limitations.
The "standard" solution is to disable the normal mouse cursor, and
implement your own cursor rendering. That is, make it
another "sprite", implemented using SDL_BlitSurface(), an OpenGL
quad, a 3D model, or whatever fits your application.
Downsides of this approach:
* Cursor motion smoothness is limited by your
application's rendering frame rate. (Not a
problem if you can do partial smart updates,
but that's not always an option.)
* Your custom mouse cursor is clipped within
your application window in windowed mode.
//David Olofson - Programmer, Composer, Open Source Advocate
.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
'-- http://www.reologica.se - Rheology instrumentation --'
More information about the SDL
mailing list