Asgard
05-07-2002, 09:29 AM
Hello,
I have a problem when using glColorPointer to specify per-vertex colors. I'm using WinXP, nVidia drivers 23.11 and VC++ 6.0. My application runs in accelerated window mode with a 32 bit color buffer, 24 bit depth buffer and 8 bit stencil buffer.
All my vertices have a DWORD that represents the per-vertex, primary color in ARGB format (MSB is A, next byte is R, and so on).
Now. when I use glColorPointer to specify colors it reads the DWORD as ABGR and not as ARGB. How come? And is there a way to change this without changing the way the colors are stored in a DWORD (can't do that for various reasons)?
Here's how I call glColorPointer:
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(VertexType), pBuffer);
pBuffer is a pointer to an array of vertices with the components interleaved. Before the call the pointer pBuffer gets adjusted so that it points to the color component of the first vertex.
Thanks for any help.
Regards,
Asgard
I have a problem when using glColorPointer to specify per-vertex colors. I'm using WinXP, nVidia drivers 23.11 and VC++ 6.0. My application runs in accelerated window mode with a 32 bit color buffer, 24 bit depth buffer and 8 bit stencil buffer.
All my vertices have a DWORD that represents the per-vertex, primary color in ARGB format (MSB is A, next byte is R, and so on).
Now. when I use glColorPointer to specify colors it reads the DWORD as ABGR and not as ARGB. How come? And is there a way to change this without changing the way the colors are stored in a DWORD (can't do that for various reasons)?
Here's how I call glColorPointer:
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(VertexType), pBuffer);
pBuffer is a pointer to an array of vertices with the components interleaved. Before the call the pointer pBuffer gets adjusted so that it points to the color component of the first vertex.
Thanks for any help.
Regards,
Asgard