So, I just started working on something in Open GL ES 2.0. I get the general impression that the transition from template 1.1 to template 2.0 in Xcode caused some confusion for everyone, so as a result, 2.0 2.0 is not very useful (if there is something really good and informative there, like 71squared video in template 1.1, with the exception of 2.0, your invitation to post a link to it).
My problem displays the image on the screen.
Right now, I have this in my drawFrame method.
[(EAGLView *)self.view setFramebuffer];
static float transY = 0.0f;
glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
[playerCube drawAtPoint:CGPointMake(160.0f, 240.0f)];
if ([context API] == kEAGLRenderingAPIOpenGLES2)
{
glUseProgram(program);
glUniform1f(uniforms[UNIFORM_TRANSLATE], (GLfloat)transY);
transY += 0.075f;
if (![self validateProgram:program])
{
NSLog(@"Failed to validate program: %d", program);
return;
}
}
else
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, (GLfloat)(sinf(transY)/2.0f), 0.0f);
transY += 0.075f;
}
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
[(EAGLView *)self.view presentFramebuffer];
, . , ViewController.m. . . Texture2D Apple, , , .
playerCube = [[Texture2D alloc] initWithImage:[UIImage imageNamed:@"Cubix.png"]];, , , , , [playerCube drawAtPoint:CGPointMake(160.0f, 240.0f)];.
, , ? , . , - image.frame = CGRectMake (); Texture 2D? , , ?
, - . StackOverflow .