I tried to create a simple text texture with the format RGBA888:
Code:
SDL_Texture *tex;
tex = SDL_CreateTexture(rContext, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STATIC, 2, 2);
And then, I tried to update it with the following pixel data:
Code:
char px[] =
{
255, 0, 0, 255,
0, 0, 255, 255,
0, 0, 255, 255,
0, 0, 255, 255
};
SDL_UpdateTexture(tex, NULL, px, 2 * sizeof(ILuint));
Problem is, SDL is reading the values as AGBR and not RGBA like I told it too.
What’s the problem here? Is it an endian matter? Also, if yes, why don’t I have this problem using libraries like DevIL for instance?
Thank you for all the help provided.