added sanity checks when deleting buffers

This commit is contained in:
Paolo Cignoni 2008-01-28 08:49:58 +00:00
parent 57069766d4
commit 0e283de929
1 changed files with 6 additions and 1 deletions

View File

@ -24,6 +24,9 @@
History
$Log: not supported by cvs2svn $
Revision 1.27 2007/12/05 11:08:16 mischitelli
Renamed some unmeaningful variable names (b -> array_buffers ; h -> curr_hints)
Revision 1.26 2007/12/04 17:59:41 mischitelli
- Fixed DrawFill method, which required the hint 'HNUseVArray' enabled in order to render the mesh with VBO. This was also causing extra overhead in the Update method since HNUseVArray has to be enabled and therefore extra calculation were done to copy vertices in VArrays even if the user was using only VBOs.
@ -223,7 +226,9 @@ public:
//Delete the VBOs
if(curr_hints&HNUseVBO)
{
glDeleteBuffersARB(2, (GLuint *)array_buffers);
for(int i=0;i<3;++i)
if(glIsBuffer(array_buffers[i]))
glDeleteBuffersARB(1, (GLuint *)(array_buffers+i));
}
}