summaryrefslogtreecommitdiff
path: root/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-09-23 18:29:38 -0500
committerDave Parks <davep@lindenlab.com>2011-09-23 18:29:38 -0500
commit4821a22070c1f68f224ff670096c2bddf25b932a (patch)
tree11d6c8c5a4a785a653535d16bac0ffe3c1d9cc4f /indra/llrender/llvertexbuffer.cpp
parent57620a9da903f3c6fe482627d18c44b6411e6910 (diff)
SH-2244 Fix for mac build?
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r--indra/llrender/llvertexbuffer.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index b2a0f6822d..add3decee3 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -575,7 +575,9 @@ void LLVertexBuffer::unbind()
{
if (sGLRenderArray)
{
+#if GL_ARB_vertex_array_object
glBindVertexArray(0);
+#endif
sGLRenderArray = 0;
}
@@ -733,7 +735,9 @@ LLVertexBuffer::~LLVertexBuffer()
if (mGLArray)
{
+#if GL_ARB_vertex_array_object
glDeleteVertexArrays(1, &mGLArray);
+#endif
}
sCount--;
@@ -1049,7 +1053,9 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
if (gGLManager.mHasVertexArrayObject && useVBOs() && (LLRender::sGLCoreProfile || sUseVAO))
{
+#if GL_ARB_vertex_array_object
glGenVertexArrays(1, &mGLArray);
+#endif
setupVertexArray();
}
}
@@ -1128,7 +1134,9 @@ void LLVertexBuffer::setupVertexArray()
}
}
+#if GL_ARB_vertex_array_object
glBindVertexArray(0);
+#endif
}
void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
@@ -1864,7 +1872,9 @@ bool LLVertexBuffer::bindGLArray()
{
if (mGLArray && sGLRenderArray != mGLArray)
{
+#if GL_ARB_vertex_array_object
glBindVertexArray(mGLArray);
+#endif
sGLRenderArray = mGLArray;
return true;
}
@@ -2072,7 +2082,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
if (sGLRenderArray)
{
+#if GL_ARB_vertex_array_object
glBindVertexArray(0);
+#endif
sGLRenderArray = 0;
}