Pickle
Mega GP Mania
I think i know EGL ok, not that its too hard to understand. Id like to learn opengles better, I know some basics with some of the other things ive messed around with. This time i want to give porting an opengl application to opengles. Ive come across ken's labyrinth and i think it might be a good starting point.
With a quick look at it uses sdl, gl, glu libraries. Im going to start with keeping sdl 1.2, but i may have to switch since im going to use glues (which might need SDL 1.3)
So using glues and sdl, just converting the gl to gles is needed.
Im hoping some of you chime in and point me in the right direction.
2 big things ive see so far:
not sure if these are even needed
I know so far glColor3f needs to be change i think the glColorPointer. QUADS doesnt exist so I think i need to break this down into 2 triangels. (this was based on Adventus example, but maybe its gles2 only?)
With a quick look at it uses sdl, gl, glu libraries. Im going to start with keeping sdl 1.2, but i may have to switch since im going to use glues (which might need SDL 1.3)
So using glues and sdl, just converting the gl to gles is needed.
Im hoping some of you chime in and point me in the right direction.
2 big things ive see so far:
Code:
glDrawBuffer(GL_FRONT);
glDrawBuffer(GL_BACK);
not sure if these are even needed
Code:
#ifndef OPENGLES
glBegin(GL_QUADS);
glColor3f(redfactor,greenfactor,bluefactor);
glTexCoord2f(tx1,ty2);
glVertex2s(x,y+h);
glTexCoord2f(tx2,ty2);
glVertex2s(x+w,y+h);
glTexCoord2f(tx2,ty1);
glVertex2s(x+w,y);
glTexCoord2f(tx1,ty1);
glVertex2s(x,y);
glEnd();
#else
GLfloat box[] = {x,y + h, x + w,y + h, x + w, y, x,y};
GLfloat tex[] = {tx1,ty2, tx2,ty2, tx2,ty1, tx1,ty1};
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glColor3f(redfactor,greenfactor,bluefactor);
glVertexPointer(2, GL_FLOAT, 0, box);
glTexCoordPointer(2, GL_FLOAT, 0, tex);
glDrawArrays(GL_QUADS,0,4);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
#endif
I know so far glColor3f needs to be change i think the glColorPointer. QUADS doesnt exist so I think i need to break this down into 2 triangels. (this was based on Adventus example, but maybe its gles2 only?)