OpenGL ES 1.x support removed from libgdx

Since everybody was in favor of removing OpenGL ES 1.x support, i pulled the plug today. What does this mean?

  • The interfaces GL10 and GL11 are no more.
  • LwjglApplicationConfiguration and AndroidApplicationConfiguration do not have the useGL20 flags anymore.
  • LWjglApplication and AndroidApplication#initialize (and all LW and Daydream equivalents) will throw a RuntimeException if OpenGL ES 2.0 is not supported
  • Your Android app should declare it’s using GLES 2.0 in its manifest so it doesn’t turn up on the 0.00001% of devices not supporting OpenGL ES 2.0

On the desktop, the minimum desktop OpenGL version required is 2.0. Only extremely old Intel (GMA 950), SiS and Tungsten chips will not support this. These have been out for over 12 years now, so i’ll take any hatred coming my way for excluding them from running libgdx apps.

OpenGL ES 3.0 Support Added

In other news, i have added preliminary interfaces and implementations for GL30. You can play around with that on the desktop via LwjglApplicationConfiguration.useGL30. I haven’t enabled it on Android yet as i have to first understand the implications. Also, Mesh and ShaderProgram are likely going to be extended in the near future to make use of GL30 features.

Note that OpenGL ES 3.0 emulation requires OpenGL 3.2 on the desktop (or 4.1 if you want frame buffer invalidation). Also, when we create a 3.0 context on the desktop, we disable backwards compatibility. You HAVE to stick to the specs or else your stuff will fail. E.g. if you use GLSL version 330, texture2D() is no longer available, use texture() instead.

Help us test these changes!

The nightlies will be ready in a an hour from now. You can check the build progress of our Jenkins instance if you can’t await fiddling with things. Please give it a try with your existing applications. It would also be awesome if you clone the libgdx repo and test the tests and demos on your machine and report back here. I spent all of today testing on Windows, Linux, Mac OS X, Android and iOS, but the more setups the better. The removal should not influence existing code that was OpenGL version agnostic (e.g. using SpriteBatch, Scene2D etc.) in any way!

11 thoughts on “OpenGL ES 1.x support removed from libgdx

  1. Yeah on GLES 3.0! I don’t think there should be in particular caveats with it on Android per se though I am soon to make the jump myself in the coming months. A shader preprocessor is on the list to finish / extend on my side to handle texture2D -> texture and other standard concerns like precision markers for desktop & ES support along with of course also providing shader combination and such.

    Uniform buffers are one of the ES 3.0 features I’m really excited to get working. With ES 2.0 rework of my efforts I broke away from traditional OOP way of encapsulation for data models. IE there is a separate data component that stores all data in a single array and system components which provide the indexing necessary for multi-dimensional data or combined models for all uniforms in a shader, etc. I’ll be switching to storing uniform data models with a ByteBuffer and provide a different set of system components which index it properly. It’ll be darn nice to be able to flash all uniform data for shaders in one call versus iterating through all uniforms as is the ES 2.0 way. I assume for libgdx this is something that could be standardized with your implementation of ShaderProgram. I don’t think libgdx provides any data model support and that is left up to the devs using the framework right? Perhaps that may be something to consider standardizing in order to exploit uniform buffers.

    Other ES 3.0 stuff I’m excited about is the thread synchronization API as this will greatly expand multi-threaded capabilities which I’m now doing outside of resource loading. The other thing that is exciting is PBOs, but that is more of a higher level engine implementation detail, but perhaps an abstraction for reading back textures could be added to libgdx if it doesn’t exist already and use PBOs behind the scene when running on ES 3.0.

    Some cool tutorials from ARM with coverage of GLES 3.0 for Android:

    OK… back to work here… If anyone is heading out to GDC this year I’d be glad to meet up for a beer. Couldn’t swing a ticket on my side this year, but I’m in the area…

  2. OK I downloaded and install the latest nightly and created a project with gdx-setup-ui and had to make some changes to get rid of the error

    Here’s what I had to do

    In the main project
    delete import;, 1, 1, 1);;

    In android and desktop
    delete cfg.useGL20 = false;

    So I expect the setup needs to be updated as well?

  3. GOOD! i was told to not use GL10 because it would be deprecated sooner or later. So i worked with GL20 from the start and now i dont need to make any changes to my code 🙂 AND NOW PEOPLE WILL DO TUTORIALS ONLY FOR GL20. Which is great for starters like me

  4. I’m not sure if this is the right place, but I’m having a bug with OpenGL/LibGDX.
    I am trying to use shaders. I have a Quadro FX 5800, which has OpenGL 4.3, which I have confirmed using DoctorGL. However, when I used the .9.9 version of libGDX to create a shader, the ShaderProgram sent a NullPointerException which I tracked down to;
    So, I wasn’t sure what to do since I DO have OpenGL2.0, which should not return null, so I looked here and saw this post.
    After downloading the nightly and fixing the issues, I tried it again and got a black screen. I believe the issue is its forcing it to use OpenGL2.0, which it still doesn’t think I have, and instead just outputs a black screen.

    Do you know how to fix this? Thank you!

  5. Seems like the in the base and android projects still say

    cfg.useGL20 = false;

    Which is, as mentioned above, no longer around.

    Also, in the base project has;
    Instead of GL20

    Using latest nightly of libgdx as of yesterday.

  6. You are using an old copy of the setup. The setup bundles template copies of each project. Those templates were updated, but require you to update your setup to see them.

  7. Not an expert, so I have to ask. Can someone clarify what this change means for the usages of OrthographicCamera? As per the tutorial ( GL10 gl = – Obtains the OpenGL instance. It has to be version 1 as version 2 is not supported for OrthographicCamera. I recall running into errors when I was using gl20 as the config with the camera.

Leave a Reply

Your email address will not be published.