Others have given you code to convert to your immediate mode quad to vertex
arrays. But here is some more info i think might help.
The first thing that is off from you think you using opengl 3.X, which you
really arnt. Opengl-ES 1.X is equivalent to Opengl 1.3. Opengl-ES 2.0 is closer
to Opengl 3.0. Anything >= 2.0 introduced the programmable pipeline. Anything <
2.0 is fixed pipline. So the point is your driver vendor may say its 3.X, but
really your targeting API specified for 1.X.
You can target OpenGL 1.3 and if you do not use any special API it will work on
ES variants. I assume from this point on that you plan to use the fixed pipline.
Here a list of ES 1.1 API that is use as a reference
http://www.khronos.org/opengles/documentation/opengles1_0/html/
Never use immediate mode (glBegin/glEnd) unless you want something quick for
debugging/testing.There are ways to use this API on ES hardware but it requires
using software wrappers that other developers have written. But dont go there if
you dont need to.
Use vertex arrays (add VBO/IBO’s for boost in performance, all these do is allow
you to load your vertex data onto the GPU memory and update the vertex data as
little as possible. So if you had a static mesh, you load it into the vbo/ibo
and the data is in the GPU memory and it doesnt need to be updated from that
point on, since it is static. In my project I coded both paths where i can use
vertex arrays directly or through VBO’s.
Good reference for vertex arrays:
http://www.songho.ca/opengl/gl_vertexarray.html
VBO/IBO’s: http://www.songho.ca/opengl/gl_vbo.html
Keep your texture data simple, GL_RGB or GL_RGBA
In my personal project im currently working on, I went through roughly this
process. Learn the obj format for vertex data, Organize the obj data into
vertices (position/texcoords/color/normals) for vertex arrays (i use
glDrawArrays with GL_TRIANGLES). Add vbo’s/ibos’. Learn how matrices can be used
to scale, rotate, translate the object. Add texturing to the obj format and into
the render routines. Learn how matrices can be used to set the projection and
modelview matrices for camera effects. This is the current method i use for
static models, things would need to change for dynamic vertex data.
One word on matrices, i dont use the opengl API, other than glLoadMatrix. I use
math library CML: http://cmldev.net/. It has worked really well for me, and i
suggest using it or something like it as the matrix API is deprecated with the
programmable pipline.________________________________
From: wilbefast@gmail.com (William Dyce)
To: SDL Development List
Sent: Fri, August 5, 2011 4:01:57 AM
Subject: [SDL] GLES 1.1 <-> OpenGL 3.4 equivalent names/functions?
Any idea what the equivalents might be, if there are any? Most resources online
seem to focus on later version of openGL :-/
Thanks,
William