Sign in to follow this  
Dark Kai

BGRA to ARGB

Recommended Posts

Dark Kai    122
Hi, I've a array of color data (ARGB format) which i pass in to OpenGL through GL.glColorPointer(4, GL_UNSIGNED_BYTE,0, *MyColorData); OpenGL seems to be rendering with BGRA format so I have weird colors for my models. Is there anyway to specify what color format I'm using?? I don't want to reformat my data to BGRA. Thanks in advance.

Share this post


Link to post
Share on other sites
lc_overlord    436
The default thing is RGBA rendering.
And allthough it is possible to set some input formats in Ogl(BGRA and so on) i don't think ARGB is one of them.

So your only option is really to swap around the bytes to fit RGBA, either at load time or just after.
It is not that hard.

Share this post


Link to post
Share on other sites
RipTorn    722
unfortunatly, the GL_BGRA and GL_ARGB extensions only work for loading data into textures, and opengl doesn't support the level of vertex buffer customization as direct 3d, so you'll just have to bite the bullet and convert them yourself. sorry.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this