diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 15:21:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-11 15:21:51 +0400 |
commit | 4081f33687c88a9fcb0c09be86b79964b2c13f08 (patch) | |
tree | e26f20a9d885764fba46142734364f1562b050e0 /source | |
parent | 77bfc417ffd0b74df78ffb8f73032ac5afff4b86 (diff) |
EditMesh was using VBO's even when off in the user preferences causing glMapBufferARB to return an invalid array, however setDrawOptions was (incorrectly) disabling VBO's in almost all cases so it didnt crash except for entering editmode on an object used as a custom bone shape.
Changed to allow setDrawOptions (since it works fine), but only to use VBO's when its enabled in the userprefs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 86c272e3799..a8ea83a45fc 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -492,11 +492,12 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us } glEnd(); } else { - GPUBuffer *buffer = 0; + GPUBuffer *buffer = NULL; float *varray; - if( setDrawOptions == 0 ) { + + if(GPU_buffer_legacy(dm)==FALSE) buffer = GPU_buffer_alloc( sizeof(float)*3*2*emdm->em->totedge, 0 ); - } + if( buffer != 0 && (varray = GPU_buffer_lock_stream( buffer )) ) { int prevdraw = 0; int numedges = 0; |