Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6690737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:40:18+00:00 2026-05-26T05:40:18+00:00

I am writing a 3d game that is using GL10, but I’d like the

  • 0

I am writing a 3d game that is using GL10, but I’d like the application to support GL11 or GL20 if available. What is the best design for supporting all 3? Or is this a fool’s errand and I should just focus on supporting one version?

My current idea is to split my render() function into renderGL10, renderGL11, renderGL20 and call the appropriate render function based on the available GL instance. Inside each render function is the proper way to render for the GL version; there will likely be overlap for GL10 and GL11. Is this an appropriate way to handle my problem or is there a better way?

public render(){
  if (Gdx.graphics.isGL20Available()){
    renderGL20();
  } else if (Gdx.graphics.isGL11Available()){
    renderGL11();
  } else { 
    renderGL10();
  }
}

EDIT:
Solution: If gl1.x is available, gl10 is also available (and Gdx.gl10 is not null). So, my render code should generally be structured as follows:

public render(){
  // Use Gdx.gl for any gl calls common to all versions
  if (Gdx.graphics.isGL20Available()){
    // Use Gdx.GL20 for all gl calls
  } else {
    if (Gdx.graphics.isGL11Available()){
      // Use Gdx.gl11 for any gl11 call not supported by gl10
    } 
    // Use Gdx.gl10 for all gl calls
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:40:18+00:00Added an answer on May 26, 2026 at 5:40 am

    Do you actually use shaders in your OpenGL ES 2.0 path or do you rely on SpriteBatch and consorts to handle the dirty details for you? In the later case there’s no real benefit in going GLES 2.0 (apart from non-power of two textures, which might be slower on some devices)

    Usually you chose between either GLES 1.x or 2.0. If you go with 1.x you don’t have to do anything. If you want to use 2.0 you have to create an AndroidApplicationConfig and set the useGL20 flag to true. If GLES 2.0 is not supported on the device you run your app on, libgdx will fall back to 1.x. You can then use your above render loop which will use GLES 2.0 if available and fall back to 1.x otherwise. You are unlikely to have to have separate paths for 1.0 and 1.x though, unless you use GLES calls directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a Facebook application that is a simple board game which I
Has anyone had experience writing a game engine or demo engine using something like
I'm writing a game for Android using libgdx. Here is some code that draws
I am writing a game server that requires connecting to a MySQL database server
I plan on writing a Java 3D game that will work both on PC
I'm currently writing my own 2D Game Engine for a game that I would
I am writing a game where the computer chooses a random number that a
I'm writing the simple card game War for homework and now that the game
I'm writing a small agent in java that will play a game against other
I'm writing a game using android ndk. I'm using picking to select objects in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.