Dibuje una línea recta usando OpenGL ES en iPhone?

Finalmente intenté dibujar una línea usando el marco OpenGL ES en XCode 4.2 para la aplicación de juego simple iPhone. Estudié algo sobre GLKView y GLKViewController para dibujar una línea en iPhone. Aquí está mi código de muestra que probé en mi proyecto,

@synthesize context = _context;
@synthesize effect = _effect;

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];

    if (!self.context) {
        NSLog(@"Failed to create ES context");
    }


    GLKView *view = (GLKView *)self.view;
    view.context = self.context;
    view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
    [EAGLContext setCurrentContext:self.context];

    //[self setupGL];
}

- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
    NSLog(@"DrawInRect Method");

    [EAGLContext setCurrentContext:self.context];

    // This method is calling multiple times....

    glClearColor(0.65f, 0.65f, 0.65f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);


   const GLfloat line[] = 
   {
        -0.5f, -0.5f, //point A 
        0.5f, -0.5f, //point B  
   };
   glVertexPointer(2, GL_FLOAT, 0, line);
   glEnableClientState(GL_VERTEX_ARRAY);
   glDrawArrays(GL_LINES, 0, 2);
}

Cuando ejecuto el proyecto, solo aparece el color gris en la pantalla, la línea no se muestra. Y también la- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect delegado está llamando tiempo infinito. Por favor, guíame donde estoy haciendo mal. ¿Por qué la línea no aparece o dibuja? ¿Puedes por favor ayudarme? Estoy intentando esto 2 días. Gracias por adelantado

Respuestas a la pregunta(2)

Su respuesta a la pregunta