mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 14:00:09 -10:00
Enable the new Vertex Array Object entry points.
TRAC #23392 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Authored-by: Jamie Madill
This commit is contained in:
1 parent
a7d05865b9
commit
d102854814
2 files changed
+42
-8
No files matched your search
@@ -776,6 +776,9 @@ GLuint Context::createVertexArray()
|
||||
{
|
||||
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);
|
||||
|
||||
return handle;
|
||||
|
||||
@@ -9186,8 +9186,16 @@ void __stdcall glBindVertexArray(GLuint array)
|
||||
return gl::error(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
// glBindVertexArray
|
||||
UNIMPLEMENTED();
|
||||
gl::VertexArray *vao = context->getVertexArray(array);
|
||||
|
||||
if (!vao)
|
||||
{
|
||||
// The default VAO should always exist
|
||||
ASSERT(array != 0);
|
||||
return gl::error(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
context->bindVertexArray(array);
|
||||
}
|
||||
}
|
||||
catch(std::bad_alloc&)
|
||||
@@ -9211,8 +9219,18 @@ void __stdcall glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
|
||||
return gl::error(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
// glDeleteVertexArrays
|
||||
UNIMPLEMENTED();
|
||||
if (n < 0)
|
||||
{
|
||||
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&)
|
||||
@@ -9236,8 +9254,15 @@ void __stdcall glGenVertexArrays(GLsizei n, GLuint* arrays)
|
||||
return gl::error(GL_INVALID_OPERATION);
|
||||
}
|
||||
|
||||
// glGenVertexArrays
|
||||
UNIMPLEMENTED();
|
||||
if (n < 0)
|
||||
{
|
||||
return gl::error(GL_INVALID_VALUE);
|
||||
}
|
||||
|
||||
for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
|
||||
{
|
||||
arrays[arrayIndex] = context->createVertexArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(std::bad_alloc&)
|
||||
@@ -9261,8 +9286,14 @@ GLboolean __stdcall glIsVertexArray(GLuint array)
|
||||
return gl::error(GL_INVALID_OPERATION, GL_FALSE);
|
||||
}
|
||||
|
||||
// glIsVertexArray
|
||||
UNIMPLEMENTED();
|
||||
if (array == 0)
|
||||
{
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
gl::VertexArray *vao = context->getVertexArray(array);
|
||||
|
||||
return (vao != NULL ? GL_TRUE : GL_FALSE);
|
||||
}
|
||||
}
|
||||
catch(std::bad_alloc&)
|
||||
|
||||
Reference in new issue
Block a user