Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GLPaint in OpenGL ES 2.0

Do anyone tried GLPaint sample application with OpenGl ES 2.0 ? I had a try an got errors with glMatrixMode(), glPointSize(), glOrthof(), glTexEnvf() methods .

enter image description here

like image 704
BigAppleBump Avatar asked Jan 30 '26 14:01

BigAppleBump


1 Answers

All of those errors are because the code uses functions and constants that were removed in OpenGL ES 2.0. If you want to make that app use OpenGL ES 2.0, you will have to replace those calls with code that uses OpenGL ES 2.0 functions only.

There are significant differences between OpenGL ES 1.1 and OpenGL ES 2.0. Porting an app from 1.1 to 2.0 is not trivial. You will need to learn quite a bit about both OpenGL ES 1.1 and OpenGL ES 2.0 to port the app.

For the specific functions you mentioned:

glMatrixMode and glOrthof have no replacements in OpenGL ES 2.0. You are expected to provide your own vector/matrix math code. If you are targeting iOS 5.0, you will want to look at the GLKMath part of the GLKit framework.

glPointSize is replaced by the gl_PointSize variable in the vertex shader.

glTexEnvf is replaced by vertex and fragment shaders.

like image 125
rob mayoff Avatar answered Feb 01 '26 04:02

rob mayoff