The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Help with converting between SDL_Texture pixel formats?
BadManiac


Joined: 07 Aug 2014
Posts: 7
Hi,

I've recently started playing around with SDL for a hobby project of mine, replacing my old 16 bit software blitting library. And I've come across a problem I'm hoping someone here can help me with.

I have a block of raw pixel data in BGR888 format, and I want to convert it to a ARGB8888 texture. I tried SDL_ConvertPixels but it doesn't work in the way I need it to. I need each pixel to be "expanded" from three byte to four byte. SDL_Convert pixels does it on a row by row basis.

So is there some clever SDL function I'm missing that will do this or willl I have to break out the old assembler? Smile