title: How to access OpenGL rendering context on Android with Delphi XE5?
body: <p>How to create OpenGL rendering context on Android device when developing an application with Delphi XE5?</p>
  
  <p>Basically I don't know where to start. There are no OpenGL examples yet.</p>
  
  <p>What I would expect to exist:</p>
  
  <ul>
  <li><p>Some kind of event (Panel.OnRender) that would provide an existing context in which I could call OpenGL calls.</p></li>
  <li><p>Generic TOpenGLSurface control that could be placed in forms designer</p></li>
  <li><p>A way to create context on main form in runtime.</p></li>
  </ul>
  
  <p>From my research so far I that <code>TWindowManager.Render</code> has access to OpenGL calls and uses them to render popup windows.</p>
  
  <p><strong>EDIT:</strong> Adding a Timer to a form and calling this procedure fills the screen with green, so that means GL context is already there:</p>
  
  <pre><code>procedure TForm1.Timer1Timer(Sender: TObject);
  begin
    glClearColor(0, 1, 0, 0);
    glClear(GL_DEPTH_BUFFER_BIT or GL_STENCIL_BUFFER_BIT or GL_COLOR_BUFFER_BIT);
    eglSwapBuffers(TCustomAndroidContext.SharedDisplay, TCustomAndroidContext.SharedSurface);
  end;
  </code></pre>
  
  <p>The question is - how to properly handle it, cos rendering on Timer in controlled environment is definitely a bad idea.</p>