Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 17:16:17 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-12-11 17:16:17 +0300
commitc6ffe237629b771f86eb92c755b0897e3a2233e0 (patch)
tree19d6a7a18e49e438262ac686893e20c3871ac222 /source/blender/gpu
parent89b6d94e387d4b127dfa7095146b641053a01617 (diff)
Sculpt Branch:
* Added detection if VBO extension is supported. * Redraw other 3d views after sculpting. * Fix brush sometimes punching through mesh with very small polygons, added an extra epsilon to the ray-triangle intersection.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index af220487ab1..33aa4168ff8 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -457,10 +457,12 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface,
/* Count the number of triangles */
for(i = 0, tottri = 0; i < totface; ++i)
tottri += mface[face_indices[i]].v4 ? 2 : 1;
+
+ if(GL_ARB_vertex_buffer_object)
+ glGenBuffersARB(1, &buffers->index_buf);
if(buffers->index_buf) {
/* Generate index buffer object */
- glGenBuffersARB(1, &buffers->index_buf);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
sizeof(unsigned short) * tottri * 3, NULL, GL_STATIC_DRAW_ARB);
@@ -503,7 +505,7 @@ void *GPU_build_mesh_buffers(GHash *map, MVert *mvert, MFace *mface,
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
}
- if(buffers->vert_buf)
+ if(buffers->index_buf)
glGenBuffersARB(1, &buffers->vert_buf);
GPU_update_mesh_buffers(buffers, mvert, vert_indices, totvert);
@@ -567,7 +569,9 @@ void *GPU_build_grid_buffers(DMGridData **grids,
totquad= (gridsize-1)*(gridsize-1)*totgrid;
/* Generate index buffer object */
- glGenBuffersARB(1, &buffers->index_buf);
+ if(GL_ARB_vertex_buffer_object)
+ glGenBuffersARB(1, &buffers->index_buf);
+
if(buffers->index_buf) {
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, buffers->index_buf);