PDA

View Full Version : GL_ABGR_EXT



jopepie2
11-11-2003, 04:01 AM
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

Zengar
11-11-2003, 05:57 AM
Never heard of ABGR. Maybe you mean BGRA?

Mazy
11-11-2003, 06:08 AM
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 http://www.opengl.org/discussion_boards/ubb/smile.gif

For the ABGR, BGRA thing, i dont know.

zeckensack
11-11-2003, 06:33 AM
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).]

rgpc
11-11-2003, 04:41 PM
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?

jopepie2
11-11-2003, 10:15 PM
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...