darkblu said:Pickle, why does ken's labyrinth need to read from the framebuffer at all?
#if defined(OPENGLES)
GLfloat vtx[] = {
-4.0, 2.0,
-2.0, 0.0,
-3.0,-4.0,
-2.0,-3.0,
4.0, 2.0,
2.0, 0.0,
3.0,-4.0,
2.0,-3.0
};
//cross top left
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
if (cross)
glColor4f(bright_g[0], bright_g[1], bright_g[2], bright_g[3]);
else
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
//cross bottom left
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
if (cross)
glColor4f(bright_g[0], bright_g[1], bright_g[2], bright_g[3]);
//cross top right
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
if (cross)
glColor4f(bright_g[0], bright_g[1], bright_g[2], bright_g[3]);
else
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
//cross bottom right
glColor4f(dark_g[0], dark_g[1], dark_g[2], dark_g[3]);
if (cross)
glColor4f(bright_g[0], bright_g[1], bright_g[2], bright_g[3]);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_FLOAT,0, vtx);
glDrawArrays(GL_LINES, 0, 4);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
#else
if (!cross_lh[cross])
{
cross_lh[cross]=glGenLists(1);
glNewList(cross_lh[cross], GL_COMPILE_AND_EXECUTE);
glBegin(GL_LINES);
//cross top left
glColor4fv(dark_g);
glVertex2f(-4.0,2.0);
if (cross)
glColor4fv(bright_g);
else
glColor4fv(dark_g);
glVertex2f(-2.0,0.0);
//cross bottom left
glColor4fv(dark_g);
glVertex2f(-3.0,-4.0);
if (cross)
glColor4fv(bright_g);
glVertex2f(-2.0,-3.0);
//cross top right
glColor4fv(dark_g);
glVertex2f(4.0,2.0);
if (cross)
glColor4fv(bright_g);
else
glColor4fv(dark_g);
glVertex2f(2.0,0.0);
//cross bottom right
glColor4fv(dark_g);
glVertex2f(3.0,-4.0);
if (cross)
glColor3fv(bright_g);
glVertex2f(2.0,-3.0);
glEnd();
glEndList();
}
else
glCallList(cross_lh[cross]);
#endif
In 'compatibility' desktp GL, glColor can be used in glBegin/glEnd (AKA 'immediate mode') sections to establish the attrbutes of individual vertices. In ES1.x glColor et al are meant to provide global values to vertex attributes that are otherwise not found in the vertex record (i.e. not specified by gl*Pointer functions). IOW, you were right to expect you'll need glColorPointer.Pickle said:This is some opengl code Im trying to converting (unrelated to Ken Lab) (and ignore the glList stuff)
In this example the opengl code change the color for every vertex, does the way I have to opengles work? Or am i overwriting the current color and im going to end up with what ever is the last color assigned?
Which in the second case I believe i need to use a glColorPointer.
darkblu said:In 'compatibility' desktp GL, glColor can be used in glBegin/glEnd (AKA 'immediate mode') sections to establish the attrbutes of individual vertices. In ES1.x glColor et al are meant to provide global values to vertex attributes that are otherwise not found in the vertex record (i.e. not specified by gl*Pointer functions). IOW, you were right to expect you'll need glColorPointer.Pickle said:This is some opengl code Im trying to converting (unrelated to Ken Lab) (and ignore the glList stuff)
In this example the opengl code change the color for every vertex, does the way I have to opengles work? Or am i overwriting the current color and im going to end up with what ever is the last color assigned?
Which in the second case I believe i need to use a glColorPointer.
//cross bottom right
glColor4fv(dark_g);
glVertex2f(3.0,-4.0);
if (cross)
glColor3fv(bright_g);
glVertex2f(2.0,-3.0);
the previous. basically, the precise meaning of glColor et al (except glVertex) functions is to set the 'current value' - be that for individual glVertex instances (immediate mode in compatibility desktop GL) or for canned semantics arrays, i.e. gl*Pointer functions (but not glVertexAttribPointer which are generic semantics attributes).Pickle said:does this mean if cross is false the the second vertex will get the previous color or no color at all?Code://cross bottom right glColor4fv(dark_g); glVertex2f(3.0,-4.0); if (cross) glColor3fv(bright_g); glVertex2f(2.0,-3.0);