VBO offscreen selection drawing, cdderivedmesh
Get rid of legacy drawing, it's only used for selection,
in which case we can prepare a temporary color buffer and draw
at once. Code is not complete here because we still redundantly
set the draw color in the draw function and don't ommit hidden
faces automatically. Still it works 100% without immediate mode
now.
This commit is contained in:
@@ -764,6 +764,21 @@ void GPU_color_setup(DerivedMesh *dm, int colType)
|
||||
GLStates |= GPU_BUFFER_COLOR_STATE;
|
||||
}
|
||||
|
||||
void GPU_buffer_bind_as_color(GPUBuffer *buffer)
|
||||
{
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
if (buffer->use_vbo) {
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, buffer->id);
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0);
|
||||
}
|
||||
else {
|
||||
glColorPointer(4, GL_UNSIGNED_BYTE, 0, buffer->pointer);
|
||||
}
|
||||
|
||||
GLStates |= GPU_BUFFER_COLOR_STATE;
|
||||
}
|
||||
|
||||
|
||||
void GPU_edge_setup(DerivedMesh *dm)
|
||||
{
|
||||
if (!gpu_buffer_setup_common(dm, GPU_BUFFER_EDGE))
|
||||
|
||||
Reference in New Issue
Block a user