GL_ABGR_EXT

Hi,

Desperately need help…
The textures I want to use in my applications come from ABGR-data. Loading this data using glTexImage2D with GL_ABGR_EXT works fine, but then you’re limited to 2^n sized textures, which is not what I desire (since resizing of the textures needs to be done easily and quickly).
The prefered method would be to use gluBuild2DMipmaps but for some reason the format GL_ABGR_EXT generates an ‘invalid enumeration’ error. I noticed that gluScaleImage has the same problem, so could it be that all glu-functions can’t work with the ABGR-format?
Does anybody have an idea? Or does someone now of a way to change the format of the imagedata, without using a time-consuming operation like swapping the color bits?

Thanks,
Rogier

Never heard of ABGR. Maybe you mean BGRA?

using gluBuild2DMipmap does resize your texture… a faster way should be to create a texture that are the nearest bigger ^2 ( you can use null as pointer to data iirc) and then use texSubImage2d to upload your texture in the lower left corner, and adjust the texturecoords accordingly… but again, thats maybe not what youre looking for

For the ABGR, BGRA thing, i dont know.

GLU doesn’t know about core GL extensions. But you can lie to GLU to a certain degree, ie use the gluScaleImage function and tell GLU it’s RGBA - it doesn’t matter for scaling. It’s just a four channel image, and all channels are treated equally.

Then use the scaled image(s) for GL, this time with the proper format information (ABGR).

You can’t use gluBuild2DMipmaps without swizzling image data yourself.

[This message has been edited by zeckensack (edited 11-11-2003).]

Originally posted by jopepie2:
Does anybody have an idea? Or does someone now of a way to change the format of the imagedata, without using a time-consuming operation like swapping the color bits?

Use a different texture format?

Why is swapping the order such a problem? Are you loading textures every frame?

The problem is I am projecting Charts that come from a chartserver in ABGR-format. When the user resizes the window, a new chart with the respective size will have to be loaded. Scaling this image to for example 1024x1024 or swapping it’s colors to RGBA is to time consuming because it freezes the whole application for a (long) while the user needs to be able to go on working with the application as soon as possible.
I’ve seen code on the internet where the GL_ABGR_EXT format IS used with gluBuild2DMipmaps(), but with me it won’t work in the glu-functions, while the extension IS available. No idea why it doesn’t work, I think al the version of GL, GLU and GLX are up-to-date…