Reputation: 1409
Back in the days of ancient OpenGL if you wanted to draw a textured quad over the whole window all you had to do was bind the texture, and have multiple calls to glVertex and glTexCoords and you're done.
now days it seems that in order to do this you need to create shaders that only copy from the texture memory, and than load and compile them. you also need to create VBOs to hold the coordinates, texture coordinates and quad indices, and than tell OpenGL where are each of the coordinates located.
Isn't there a simpler way?
Upvotes: 2
Views: 409
Reputation: 39380
Well, the new OpenGL is much more flexible, but also a bit more complicated.
First, you don't have to use indices - if you don't supply indexing VBO, the drawcall will just iterate over vertices and texcoords from buffers. It really isn't much different from using glVertex**v
and other vector-based functions (which you should be using even in the old GL).
Also, shaders can be hard-coded into strings; you won't have to provide file operation facilities then.
When you add it all up, it won't make your code much longer than in old OpenGL; in fact, it can even shorten it up a bit, provided you didn't use the vector functions earlier.
Upvotes: 1