Re: [AD] Two custom mouse cursor patches |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Two custom mouse cursor patches
- From: Evert Glebbeek <eglebbk@xxxxxxxxxx>
- Date: Tue, 16 Sep 2008 09:31:26 -0400
On 16 Sep 2008, at 03:31, Peter Hull wrote:
I had a look at the patch, but I haven't tried it yet.
Cheers.
My comments:
What happens if you destroy the current cursor? I have a feeling that
NSCursor set retains the cursor (in which case it would be fine) but
I'm not sure.
I think the code is pretty much the same as it was in A4, I don't
think there were problem with it there. I'll check that.
There are also some funny things happening with the cursor when there
is more than one window. Right now changing it in one changes it for
the other as well but it'll randomly get reset.
Before I look into this: what's the proper behavior for the mouse
cursor with multiple windows? How does it work on other systems?
Presumably each window should remember its own cursor?
In this line:
cursor = _AL_MALLOC(sizeof cursor);
shouldn't it be sizeof(*cursor)?
Yes, probably. Well spotted!
The bit about "Before MacOS X 10.3..." I think we could maybe drop
support for 10.2 as I don't think many people still use it
It takes effort to pull it ;)
Then again, is A5 supposed to work on 10.2 at all? If not that
comment is just misleading (giving the mistaken impression that it
should).
I confess that NSImageFromAllegroBitmap isn't right because
NSBitmapImageRep uses premultiplied alpha and allegro doesn't.
I'm not sure I fully understand what that means. The present code
does seem to do the right thing, if that's what matters.
The other question is whether this code should go in osxgl or qzmouse:
in principle it doesn't depend on GL so if we were to have a different
graphics driver the same code would be needed.
I thought about it and dicided that it should probably go into
qzmouse, although the code in osxgl does keep a copy of the cursor at
the moment. I'll have to see where that's used and if we need it. If
we do a simple wrapper around qzmouse should do. I'll work on
cleaning things up tonight.
Regarding style and just so I'm clear on this: if I need to expose
functions from within qzmouse to osxgl (for instance to fill up the
vtable), they should be prefixed with _al, right?
Should I fill up the display vtable from osxgl (with exposed
functions from qzmouse) or should I have a function in qzmouse that
fills in the relevant spots in the vtable and call that instead? The
latter hides more internal details and exposes fewer symbols. It
doesn't matter too much, but I just thought I'd ask.
Evert