Software rendering docs

Adam Jackson ajax at nwnk.net
Thu Mar 2 10:31:47 PST 2006


On Wednesday 01 March 2006 01:24, Peter Hutterer wrote:
> Hey Adam,
>
> recreational investigation? in the X source code? are you joking? :)
>
> The actual goal I have is render multiple cursors at once. I did some
> modifications to X so that the events being sent from the server look
> like we have independent mice. Works reasonably well so far, with
> apps like GIMP, firefox and abiword responding well to the changes
> (two-handed input in GIMP is quite interesting to work with).
>
> The problem is that at the moment my window manager has to render the
> mice to display multiple cursors. Which of course doesn't work
> properly when a pointer grab is on (and in some other cases).
> According to Aaron Plattner my graphics card (nvidia) doesn't support
> more than one cursor in hardware. So the whole thing has to be in
> software.

Almost no cards support multiple hardware cursors at this time.

> I haven't figured out though how to render more than one cursor
> simultaneously to the screen.
>
> The wrapping concept you mentioned is actually what is killing me so
> far. With all the function pointers it's hard to add information
> without breaking the API and rewriting lots of code.

The usual way to preserve subsystem-specific state for a given object is to 
create a "private" for that subsystem and attach it to the object.  The 
global structure (screen, pixmap, etc.) usually contains an array to hold 
pointers to private data, and you can acquire a slot in the array by 
allocating a private index for that object.

This is basically wedging runtime dynamic inheritance onto a language that has 
no intrinsic support for it.  Yay C.

Of course this only works if the extra attributes you're adding only need to 
be seen by the layer you're adding.  If not then additional cleverness is 
needed.

Towards your specific problem, my wild guess would be that you need to 
instantiate the software cursor code more than once, but I have no idea how 
far-reaching the changes would be to get that working correctly.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20060302/784cbe55/attachment.pgp>


More information about the xorg mailing list