Skip to content

"transparency" without sdl2_image #23

@mike-merilaht

Description

@mike-merilaht

This can still be achieve with the following code, might help some people that still cant access sdl2_image while using conan

surface = SDL_LoadBMP("sprite.bmp"); SDL_SetColorKey(surface, SDL_TRUE , SDL_MapRGB(surface->format, 0xFF,0,0xFF)); //<--- this removes the color FF00FF from the sprite, essentially removing the background. texture = SDL_CreateTextureFromSurface(renderer_, surface); SDL_FreeSurface(surface);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions