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 6660161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:07:15+00:00 2026-05-26T02:07:15+00:00

In Android, a Renderer gets passed a GL10 object in onSurfaceCreated, onSurfaceChanged, and onDraw.

  • 0

In Android, a Renderer gets passed a GL10 object in onSurfaceCreated, onSurfaceChanged, and onDraw. Does this actual instance of GL10 really have any specific importance, or can you instantiate any instance of GL10 you want?

The reason I ask is that I have two seemingly contradictory pieces of information I’ve gleaned from different sources:

  1. I was looking through the source code for gl2-android, which is a set of ES 2.0 bindings. In the example, GL2Test.java, the GL10 instances that are passed are completely ignored. The renderer simply instantiates an AndroidGL20 instance and uses that instead.

  2. I’ve been working with Robert Green’s code for OpenGL live wallpapers. In the many comments listed on his introductory blog post, some folks pointed out that occasionally the GL10 context that is passed to onSurfaceCreated changes to a different instance. If this happens, drawing will fail if you do not first reload your textures using the new instance. So the fix is to test at the start of onSurfaceCreated to make sure it’s the same GL10 instance and deciding from there whether to reload. (You don’t want to reload every time, because onSurfaceCreated gets called with each screen rotation, which must be supported by live wallpapers.)

What I’m trying to do is set up gl2-android for use with a live wallpaper. But I want to be sure I can use it in a manner that’s safe from the problem described in number 2 above.

  • 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-26T02:07:15+00:00Added an answer on May 26, 2026 at 2:07 am

    GL Contexts are objects that hold all the information of the current OpenGL instance. Whenever you create a texture, vertex buffer, a surface, a shader or change the state (blend mode, alpha and so forth) all those are stored into the context. Destroying the context will ultimately destroy the objects created within that context and reset the state of OpenGL, in that sense they are very “significant”!

    OnSurfaceCreated method is called whenever a new context has been created for the first time or after a destruction of a previous one (due to returning back to the home screen, switching off the display or changing orientation) That’s the reason why you will need to re-create/upload all your resources after this, since the previous one has been destroyed with all the resources attached to it.

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

Sidebar

Related Questions

Android contact - does each contact have a unquieid? How do I get the
just curious to know android Graphical components (View) have their own specific renderer or
Can Android OS that is installed on actual devices be emulated in VMWare or
The GLSurfaceView.Renderer interface of the Android SDK gives me a GL interface as parameter
I'm writing an cross-platform renderer. I want to use it on Windows, Linux, Android,
I have a Activity class and a Renderer class (extends GLSurfaceView implements Renderer). Inside
This is kind of a shot in the dark, but... I know we have
I've created 3 Java classes. one that has a glsurfaceview object and this calls
I have a simple Square with openGL es 1 and Android 1.5. The square
I do not understand Android layouts. I have the following structure and have tried

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.