We should have a Vertex-Array Object to handle the OpenGL VAO vertex array operations.
[x] Store GLuint index, so we know the VAO's location.
[x] Be able to initialize with glGenVertexArrays(GLint num, GLuint* location);
[x] Be able to call glBindVertexArray(GLuint name) in order to...
1) Create and assign a new VAO to the provided name.
2) Make the name active if it is already a created object.
3) Stop using app-allocated VAOs through the binding of 0.
[ ] Handle GL_INVALID_OPERATION error when previously generated.
[x] Call glDeleteVertexArrays(GLuint n, GLuint* arrays) on deconstructor.
[x] Have glIsVertexArray(GLuint* array) overloaded.
[ ] Supply data to the VAO with glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
Allocates size bytes of VRAM for data. Will delete old data upon use.
Target can be one of many types seen on page 80. Most likely is GL_ARRAY_BUFFER. Make that default.
Size = # of elements * their sizeof
Data = pointer, or null. null reserves but doesn't initialize.
Usage tells how data should be written. Many uses; see page 81. GL_STATIC_DRAW is common.
[ ] Handle GL_OUT_OF_MEMORY on glBufferData call.
It is very likely there are more requirements. This is just the Chapter 1 notes.
This will be updated to reflect new requirements.
We should have a Vertex-Array Object to handle the OpenGL VAO vertex array operations.
[x] Store GLuint index, so we know the VAO's location.
[x] Be able to initialize with glGenVertexArrays(GLint num, GLuint* location);
[x] Be able to call glBindVertexArray(GLuint name) in order to... 1) Create and assign a new VAO to the provided name. 2) Make the name active if it is already a created object. 3) Stop using app-allocated VAOs through the binding of 0.
[x] Call glDeleteVertexArrays(GLuint n, GLuint* arrays) on deconstructor.
[x] Have glIsVertexArray(GLuint* array) overloaded.
[ ] Supply data to the VAO with glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
Allocates size bytes of VRAM for data. Will delete old data upon use.
Target can be one of many types seen on page 80. Most likely is GL_ARRAY_BUFFER. Make that default.
Size = # of elements * their sizeof
Data = pointer, or null. null reserves but doesn't initialize.
Usage tells how data should be written. Many uses; see page 81. GL_STATIC_DRAW is common.
[ ] Handle GL_OUT_OF_MEMORY on glBufferData call.
It is very likely there are more requirements. This is just the Chapter 1 notes. This will be updated to reflect new requirements.