Commit d1028548 by Jamie Madill Committed by Shannon Woods

Enable the new Vertex Array Object entry points.

TRAC #23392 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Authored-by: Jamie Madill
parent a7d05865
...@@ -776,6 +776,9 @@ GLuint Context::createVertexArray() ...@@ -776,6 +776,9 @@ GLuint Context::createVertexArray()
{ {
GLuint handle = mVertexArrayHandleAllocator.allocate(); GLuint handle = mVertexArrayHandleAllocator.allocate();
// Although the spec states VAO state is not initialized until the object is bound,
// we create it immediately. The resulting behaviour is transparent to the application,
// since it's not currently possible to access the state until the object is bound.
mVertexArrayMap[handle] = new VertexArray(mRenderer, handle); mVertexArrayMap[handle] = new VertexArray(mRenderer, handle);
return handle; return handle;
......
...@@ -9186,8 +9186,16 @@ void __stdcall glBindVertexArray(GLuint array) ...@@ -9186,8 +9186,16 @@ void __stdcall glBindVertexArray(GLuint array)
return gl::error(GL_INVALID_OPERATION); return gl::error(GL_INVALID_OPERATION);
} }
// glBindVertexArray gl::VertexArray *vao = context->getVertexArray(array);
UNIMPLEMENTED();
if (!vao)
{
// The default VAO should always exist
ASSERT(array != 0);
return gl::error(GL_INVALID_OPERATION);
}
context->bindVertexArray(array);
} }
} }
catch(std::bad_alloc&) catch(std::bad_alloc&)
...@@ -9211,8 +9219,18 @@ void __stdcall glDeleteVertexArrays(GLsizei n, const GLuint* arrays) ...@@ -9211,8 +9219,18 @@ void __stdcall glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
return gl::error(GL_INVALID_OPERATION); return gl::error(GL_INVALID_OPERATION);
} }
// glDeleteVertexArrays if (n < 0)
UNIMPLEMENTED(); {
return gl::error(GL_INVALID_VALUE);
}
for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
{
if (arrays[arrayIndex] != 0)
{
context->deleteVertexArray(arrays[arrayIndex]);
}
}
} }
} }
catch(std::bad_alloc&) catch(std::bad_alloc&)
...@@ -9236,8 +9254,15 @@ void __stdcall glGenVertexArrays(GLsizei n, GLuint* arrays) ...@@ -9236,8 +9254,15 @@ void __stdcall glGenVertexArrays(GLsizei n, GLuint* arrays)
return gl::error(GL_INVALID_OPERATION); return gl::error(GL_INVALID_OPERATION);
} }
// glGenVertexArrays if (n < 0)
UNIMPLEMENTED(); {
return gl::error(GL_INVALID_VALUE);
}
for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
{
arrays[arrayIndex] = context->createVertexArray();
}
} }
} }
catch(std::bad_alloc&) catch(std::bad_alloc&)
...@@ -9261,8 +9286,14 @@ GLboolean __stdcall glIsVertexArray(GLuint array) ...@@ -9261,8 +9286,14 @@ GLboolean __stdcall glIsVertexArray(GLuint array)
return gl::error(GL_INVALID_OPERATION, GL_FALSE); return gl::error(GL_INVALID_OPERATION, GL_FALSE);
} }
// glIsVertexArray if (array == 0)
UNIMPLEMENTED(); {
return GL_FALSE;
}
gl::VertexArray *vao = context->getVertexArray(array);
return (vao != NULL ? GL_TRUE : GL_FALSE);
} }
} }
catch(std::bad_alloc&) catch(std::bad_alloc&)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment