Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System cursor always 16 x 16 pixels? #157

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

System cursor always 16 x 16 pixels? #157

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.9
Reported for operating system, platform: Mac OS X (All), PowerPC

Comments on the original bug report:

On 2006-05-25 14:42:46 +0000, Jakob Frandsen wrote:

I've developed an application that makes use of changing hardware cursors/system pointers. The program works fine under Windows and Linux and I was porting it to Mac OS X when I stumbled into this problem.

I was using 32x32 pixels cursors, as per this code:

http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlcreatecursor.html

which as I mentioned works fine under Windows and Linux, but under Mac OS X, the cursor is corrupted and refuses (I found out after much experimenting) to be larger than 16x16 pixels.

On 2006-06-20 04:59:34 +0000, Christian Walther wrote:

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.

On 2006-06-24 11:16:11 +0000, Christian Walther wrote:

Created attachment 141
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.

On 2006-06-24 13:36:20 +0000, Sam Lantinga wrote:

Do all cursors flicker on 10.2, or just the scaled ones?

On 2006-06-24 13:36:48 +0000, Sam Lantinga wrote:

Your patch is in subversion, thanks!

On 2006-06-24 14:10:19 +0000, Christian Walther wrote:

(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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant