Skip to content

Commit 7ce2a97

Browse files
committed
BGRA color order fix for Cg on Windows
1 parent ef9908c commit 7ce2a97

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

panda/src/glstuff/glCgShaderContext_src.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ CLP(CgShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderConte
172172
// can only ever be sure that vtx_position is bound.
173173
GLCAT.warning()
174174
<< "CG varying vtx_position is bound to generic attribute " << loc
175-
<< "instead of 0. Use ATTR0 semantic to prevent this.\n";
175+
<< " instead of 0. Use ATTR0 semantic to prevent this.\n";
176176
}
177177
}
178178

@@ -816,7 +816,11 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
816816
break;
817817

818818
case CA_color:
819-
glColorPointer(num_values, type, stride, client_pointer);
819+
if (numeric_type == GeomEnums::NT_packed_dabc) {
820+
glColorPointer(GL_BGRA, GL_UNSIGNED_BYTE, stride, client_pointer);
821+
} else {
822+
glColorPointer(num_values, type, stride, client_pointer);
823+
}
820824
glEnableClientState(GL_COLOR_ARRAY);
821825
break;
822826

0 commit comments

Comments
 (0)