egl.switch_to(false);

glViewport(0,0, size[0],size[1]);

glClearColor(0.25f,0,0,1);

glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

glBindTexture( GL_TEXTURE_2D, def_tex );

static const float X1 = -0.5f;

static const float Y1 = -0.5f;

static const float X2 = 0.5f;

static const float Y2 = 0.5f;

static GLfloat vertexData[] = {

X2, Y2,

X1, Y2,

X1, Y1,

X1, Y1,

X2, Y1,

X2, Y2,

};

static const float uvX1 = 0;

static const float uvY1 = 0;

static const float uvX2 = 1;

static GLfloat uvData[] = {

uvX2, uvY2,

uvX1, uvY2,

uvX1, uvY1,

uvX1, uvY1,

uvX2, uvY1,

uvX2, uvY2,

};

glBindBuffer(GL_ARRAY_BUFFER, 0);

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

glUseProgram( ogles2_shaderProgram );

glEnableVertexAttribArray( ogles2_shader_vLoc );

glVertexAttribPointer( ogles2_shader_vLoc, 2, GL_FLOAT, GL_FALSE, 0, vertexData );

glEnableVertexAttribArray( ogles2_shader_uv0Loc );

glVertexAttribPointer( ogles2_shader_uv0Loc, 2, GL_FLOAT, GL_FALSE, 0, uvData );

glDrawArrays(GL_TRIANGLES, 0, 6);

glUseProgram( 0 );

glDisableVertexAttribArray(ogles2_shader_vLoc);

glDisableVertexAttribArray(ogles2_shader_uv0Loc);

egl.switch_back();

egl.swap_buffers();

WOsborn2011-06-06 03:22:55