Advertisement Jump to content
Sign in to follow this  
Dark Kai

BGRA to ARGB

This topic is 4936 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!