SDL2_Image port, having problems with .png images #922
Unanswered
HudsonSchumaker
asked this question in
Q&A
Replies: 1 comment
|
The problem is the .texture_formats = { SDL_PIXELFORMAT_ABGR1555, SDL_PIXELFORMAT_ABGR8888 }so when you hand it an RGB565 surface, SDL_Surface* ps2_surface = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ABGR8888, 0);
// or SDL_PIXELFORMAT_ABGR1555 if you want 16-bit textures to save VRAM
SDL_Texture* tex = SDL_CreateTextureFromSurface(ctx_get_renderer(), ps2_surface);Even simpler: skip the manual conversion entirely and pass the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I having problems with .png images, the colors rendered in the screen are differ from original file.
the least bad pixel format i found is SDL_PIXELFORMAT_RGB565
original image:

rendered:

code: https://github.com/HudsonSchumaker/ps2-demo-c/blob/8aa4f323b008bb12c69c45aaf71168b4be19eec3/src/de-ps2/io/loader.c#L27
so in summary how to do it properly ?
thanks in advance
All reactions