Consider the following OpenGL code:
glGenBuffers (1 ,&vertexBufferObject ); glGenBuffers (1 , &indexBufferObject);
glm : :vec2 vertices [ 3 ];
vertices [0] = glm : : vec2( −1.0 ,−1.0); vertices [1] = glm : : vec2 (1.0 , −1.0); vertices [2] = glm: : vec2 (0.0 , 1.0); short indices [3] = {0 , 1 ,2};
<missingcode>
The code was meant to create the vertex and index buffers andupload data from glm::vec2 vertices[3] andshort indices[3] to those buffers.
1. Define the variablesvertexBufferObject andindexBufferObject.
2. Call the right functions to upload the data to thebuffers.
Expert Answer
An answer will be send to
PayPal Gateway not configured
PayPal Gateway not configured