Skip to content

SDL_CreateCursor not displaying inverted colours on Windows #15064

@nghtlprbn

Description

@nghtlprbn

I can't get colour inversion to work when using SDL_CreateCursor on Windows 11. This sample gives a fully white cursor rather than a transparent cursor. Is this a bug or is the code wrong?

#include <SDL3/SDL.h>

int main() {
	SDL_Init(0);
	SDL_Window* window = SDL_CreateWindow("", 500, 500, 0);
	SDL_ShowWindow(window);

	Uint8 data[8];
	Uint8 mask[8];
	memset(data, 0xFF, sizeof(data));
	memset(mask, 0x0, sizeof(mask));

	SDL_Cursor* cursor = SDL_CreateCursor(data, mask, 8, 8, 0, 0);
	SDL_SetCursor(cursor);

	while(true) {
		SDL_Event event;
		SDL_PollEvent(&event);
		if(event.type == SDL_EVENT_QUIT) break;
	}

	SDL_Quit();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions