From f54776b1a677a8650cf3c18111643c0379c51724 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 9 Dec 2009 14:37:26 +0000 Subject: VBO: * Fix #19785: curves not drawing with VBO enabled * Fix #19553: duplicate Window crashes with VBO's The convention in Blender was to have GL_VERTEX_ARRAY and GL_NORMAL_ARRAY enabled by default, and other arrays disabled. The VBO drawing code did not take this into account. I've made these now disabled by default, since that makes the code clearer in other places too. --- source/blender/gpu/intern/gpu_buffers.c | 8 +------- source/blender/gpu/intern/gpu_draw.c | 8 +++++--- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index a59c263055d..3c178b10561 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -388,15 +388,9 @@ GPUBuffer *GPU_buffer_setup( DerivedMesh *dm, GPUDrawObject *object, int size, G DEBUG_VBO("GPU_buffer_setup\n"); - if( globalPool == 0 ) { + if( globalPool == 0 ) globalPool = GPU_buffer_pool_new(); - /* somehow GL_NORMAL_ARRAY is enabled on startup and causes edge drawing code to crash */ - glDisableClientState( GL_VERTEX_ARRAY ); - glDisableClientState( GL_NORMAL_ARRAY ); - glDisableClientState( GL_TEXTURE_COORD_ARRAY ); - glDisableClientState( GL_COLOR_ARRAY ); - } buffer = GPU_buffer_alloc(size,globalPool); if( buffer == 0 ) { dm->drawObject->legacy = 1; diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index c2cf4dfa9fd..db6c7fa5ce0 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -1276,9 +1276,11 @@ void GPU_state_init(void) glDisable(GL_TEXTURE_1D); glDisable(GL_TEXTURE_2D); - /* default on, disable/enable should be local per function */ - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); + /* default disabled, enable should be local per function */ + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); glPixelTransferi(GL_MAP_COLOR, GL_FALSE); glPixelTransferi(GL_RED_SCALE, 1); -- cgit v1.2.3