ARGB to RGBA

Hello all,

I’ve actually only just noticed (now that I have some colour images)
that my bmp files are 32bit ARGB format, for my opengl textures I need
them to be RGBA ( I just noticed everything red is showing as blue and
alpha blending isn’t working properly )

Is there a SDL built-in quick way of converting between ARGB and RGBA?

Thanks

Ian
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20100227/099266e5/attachment.pgp

Technically they are compatible with GL_BGRA instead of GL_RGBA, give it a try.

Windows calls it ARGB because it is backwards (little endian) :)On 02/27/2010 02:34 PM, Ian Norton wrote:

Hello all,

I’ve actually only just noticed (now that I have some colour images)
that my bmp files are 32bit ARGB format, for my opengl textures I need
them to be RGBA ( I just noticed everything red is showing as blue and
alpha blending isn’t working properly )

Is there a SDL built-in quick way of converting between ARGB and RGBA?

Thanks

Ian


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier

Aren’t all OSes on an x86 chip wrong-endian, because the processor’s that way?>----- Original Message ----

From: Forest Hale
Subject: Re: [SDL] ARGB to RGBA

Technically they are compatible with GL_BGRA instead of GL_RGBA, give it a try.

Windows calls it ARGB because it is backwards (little endian) :slight_smile:

Thanks

I had a mess about with SDL_ConvertSurface and as you say through
trial and error and am converting from what looks like BGRA

Gimp was telling me it was ARGB.

All working now :slight_smile: thanksOn 28 Feb 2010, at 12:06, Forest Hale wrote:

On 02/27/2010 02:34 PM, Ian Norton wrote:

Hello all,

I’ve actually only just noticed (now that I have some colour images)
that my bmp files are 32bit ARGB format, for my opengl textures I
need
them to be RGBA ( I just noticed everything red is showing as blue
and
alpha blending isn’t working properly )

Is there a SDL built-in quick way of converting between ARGB and
RGBA?

Thanks

Ian

Technically they are compatible with GL_BGRA instead of GL_RGBA,
give it a try.

Windows calls it ARGB because it is backwards (little endian) :slight_smile:


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a
rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Gimp refers to the pixel layout on disk, SDL refers to the pixel
layout in memory.

See ya!On Sun, Feb 28, 2010 at 8:06 AM, Ian Norton wrote:

Thanks

I had a mess about with SDL_ConvertSurface and as you say through trial and
error and am converting from what looks like BGRA

Gimp was telling me it was ARGB.

All working now :slight_smile: thanks

On 28 Feb 2010, at 12:06, Forest Hale wrote:

On 02/27/2010 02:34 PM, Ian Norton wrote:

Hello all,

I’ve actually only just noticed (now that I have some colour images)
that my bmp files are 32bit ARGB format, for my opengl textures I need
them to be RGBA ( I just noticed everything red is showing as blue and
alpha blending isn’t working properly )

Is there a SDL built-in quick way of converting between ARGB and RGBA?

Thanks

Ian

Technically they are compatible with GL_BGRA instead of GL_RGBA, give it a
try.

Windows calls it ARGB because it is backwards (little endian) :slight_smile:


LordHavoc
Author of DarkPlaces Quake1 engine -
http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged
demo." - James Klass
"A game is a series of interesting choices." - Sid Meier


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC