When I render a cube, it looks like this:
glBindBuffer (GL_ARRAY_BUFFER, vertexBuffer); GlVertexAttribPointer (vertexPositionAttribute, 3, GL_FLOAT, incorrect, 0, 0); Glubbindfuffer (GL_ARRAY_BUFFER, Texture Causesbuffer); GlVertexAttribPointer (Texture CoresAttribute, 2, GL_Flota, False, 0, 0); GlActiveTexture (GL_TEXTURE0); Globinated (GL_TEXTURE_2D, textured ID); Glubbind Buffer (GL_ELEMENT_ARRAY_BUFFER, IndexBuffer); GlDrawElements (GL_TRIANGLES, IndexCount, GL_UNSIGNED_SHORT, 0);
I just want to change the texture course and I am not turning vertical or index. My question is, do I have to re-send top data and index data to render this cube again or should I just send new texture cores? And if I can just send a new texture, then what is the need to call OpenGL?
you can ); GlobeFatata (GL_ARRAIBFFER, Size, Data, GLDVNAMICADRAW);
Which means buffer the buffer again and call You create a new vbo with texture coordinates You can also create and set the glBufferData on it
glVertexAttribPointer (textureCoordsAttribute, 2, GL_FLOAT, false, 0, 0);
. GL_ARRAY_BUFFER
with
No comments:
Post a Comment