| Summary: | System cursor always 16 x 16 pixels? | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Jakob Frandsen <jakobf> |
| Component: | video | Assignee: | Christian Walther <cwalther> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | cwalther |
| Version: | 1.2.9 | ||
| Hardware: | PowerPC | ||
| OS: | Mac OS X (All) | ||
| Attachments: | patch | ||
|
Description
Jakob Frandsen
2006-05-25 14:42:46 UTC
You're right - the QuickDraw calls that are used in the current implementation of SDL_SetCursor() only support 16x16 cursors. This should be reimplemented in Cocoa (like all the other uses of QuickDraw, which is deprecated in 10.4). I may or may not have time to code up a fix in the next two weeks. Created attachment 141 [details] patch OK, here's a patch that replaces the QuickDraw implementation of SDL_CreateCursor() and companions with a Cocoa implementation (interestingly, there doesn't seem to be a modern Carbon way of achieving this). Tested on 10.4.6 (PPC), 10.3.9, and 10.2.8 using the 'testcursor' example (to which I added a third test cursor). On 10.2, cursors must be 16x16, therefore bigger cursors are scaled down. In that case, for some reason that I didn't investigate any further, they flicker when held over the SDL window. On 10.3 and later, bigger cursors work now (up to 64x64, I believe). One feature that gets lost in the translation is that pixels with value 1 (black) and mask 0 (transparent) would invert the background color. In accordance with the spec (http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fCreateCursor), they now simply appear black. This feature is an artifact of the way cursor drawing was done in QuickDraw days and can't be reproduced using Cocoa's alpha-blended cursors. Do all cursors flicker on 10.2, or just the scaled ones? Your patch is in subversion, thanks! (In reply to comment #3) > Do all cursors flicker on 10.2, or just the scaled ones? Just the scaled ones. It may have something to do with them having semi-transparent pixels (in contrast to the non-scaled ones that only have completely transparent and completely opaque pixels). Maybe this takes cursor rendering from hardware to software on the Wallstreet powerbook I was testing it on. And as I mentioned, it only flickers if the cursor is above the SDL window, not on other parts of the screen. |