Skip to content

can't render more than one mesh #11

@quinn

Description

@quinn

Hi there, your tutorial is excellent, thank you for putting so much work into this. My question is about the Mesh class, I am unable to get it to render multiple meshes. As far as I can tell this is due to the m_vertexArrayObject allocating the same ID for the mesh. Also, i had to make some changes to make this make more sense. For example, I changed m_vertexArrayObject from a GLuint to an array of length one:

enum {
	SINGLE_VAO,
	NUM_VAO
};

GLuint m_vertexArrayObject[NUM_VAO];

glGenVertexArrays(NUM_VAO, m_vertexArrayObject);
glBindVertexArray(m_vertexArrayObject[SINGLE_VAO]);

Secondly, the second argument to glGenVertexArrays is no longer passed as a pointer. Again, this is based on examples I found elsewhere. The problem I am facing is that m_vertexArrayObject[SINGLE_VAO] is always zero (i assume to that being the default value of the array), so (as far as i know) this means I can never have more than one mesh.

Thanks for your help with this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions