I'm experimenting a bit with vertex arrays, buffers and shaders. Because there was an option in glGenVertexArrays() that i can generate more than 1 vertex array, so i thought why not using 1 vertex array for 1 object, 3 vertex arrays for 3 objects etc.
- arrays which stores vertexes, normals and colors
- vertex array object generated with glGenVertexArray() and bound with glBindVertexArray()
- vertex buffer, normal buffer and color buffer generated, bound and stored with glBufferData()
- array for transformation matrix
- shader program to be used (compiled, attached and linked in Renderer)
- render function which binds vertex array and uses shader program of this object
- basic GL (glClearColor()) settings when rendering in window
- array for viewing and projection matrix
- vertex and fragment shader compiled
- shader program attached with vertex and fragment shader
- render loop which renders Objects
Programming everything in one go (like you see in any OpenGL 3.3+ Tutorial) works fine (beautiful cube), but I don't see any objects in the window with the same verteces, normals colors and shaders. Is it possible that I need to bind a vertex array so that i can link a shader program?