This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Tips & Tricks: OpenGL vs. OpenGL ES

Note: This was originally posted on 15th October 2009 at http://forums.arm.com

As we come up with various tips and hints that might help application developers working on Mali GPUs we will be posting them here so that you have instant access to them prior to the hints being turned into formal knowledgebase articles or other documentation.

If there are questions that you have, we will do our best to answer them in a timely manner.

This first topic will cover general differences between coding for the OpenGL (desktop graphics library) and OpenGL ES (embedded system graphics library) APIs from Khronos...
  • Note: This was originally posted on 27th October 2009 at http://forums.arm.com

    Some differences between OpenGL & OpenGL ES APIs:

    OpenGL ES 1.1 and 2.0 are subsets of the full OpenGL standard. Some OpenGL functionality is not available in OpenGL ES:


    • No support for glBegin or glEnd. Instead, use vertex arrays and vertex buffer objects 
    • Supported rasterization primitives are points, lines and triangles. Quads are not supported 
    • There is no polynomial evaluation stage 
    • Blocks of fragments can be sent directly to individual fragment operations 
    • There is no support for display lists

    For complete list, visit [url="http://www.khronos.org/opengles/"]http://www.khronos.org/opengles/[/url]
  • Note: This was originally posted on 27th October 2009 at http://forums.arm.com

    If you are writing code to run on both OpenGL 2.0 and OpenGL ES 2.0, be aware of slight differences between the shader languages used in the two APIs. For example, OpenGL ES 2.0 requires a precision declaration in the fragment shader code, while OpenGL 2.0 does not support this.

    To enable your code to run on both OpenGL 2.0 and OpenGL ES 2.0, start every fragment shader with:

    [font="Courier New"]#ifdef GL_ES
    precision mediump float;
    #endif[/font]
  • Note: This was originally posted on 10th July 2011 at http://forums.arm.com

    Ahh glad I came to this thread. Once I used [font=arial, sans-serif][size=2]vertex arrays and vertex buffer objects this immediately fixed some of the issues I was having.[/size][/font]