Android OpenGL Nonsense

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
4,230
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 13, 2011

Really, Android? You have to go and destroy my OpenGL context between executions? Cold, Android. Cold...

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (cyborusDev)

  • "Renderer.onSurfaceCreated (GL10 gl, EGLConfig config)

    Called when the surface is created or recreated.

    ...

    Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be recreated when the EGL context is lost..."

    I was more worried that GL resources would get out of hand. I think this is fairly reasonable.

  • @xinaesthetic I used onSurfaceCreated as the entry point for restoring all the OpenGL assets. So yeah, it was not a terribly difficult fix. It's just frustrating that the assets die in the first place.

  • Have you check to see if its the cell phone?

  • @plutoamun What? Like as if my phone is defective or something?

  • Are you using the NDK or Java?

    If you're using Java, you can simply use GLSurfaceView + GLSurfaceView.Renderer to capture the events (+it shifts rendering out into a seperate thread).

  • @MilchTheShake I'm using both. I have a GLSurfaceView piping rendering events off to NDK code.

see all

All Comments (23)

Sign In or Sign Up now to post a comment!
  • Those are some big rings below your eyes man!

  • Great, thanks for sharing this, quite interesting to know :)

  • I see your frustration, but this is intentional. What about people running multiple apps that use OpenGL? There's one device, so one instance makes sense.

    By using onPause(), onClose(), onStart(), and onResume(), you should be able to handle these issues.

    And if you really want to (and it seems you do), you can call finish() to exit your app at any time you like. Yup, it'll do it.

    Oh yeah, these are all methods you call from your Activity.

    -scott biggs

  • there's no way to preserve data? instances? bundle data? never heard of that?

  • im new to android and im just learning java, i wanted to know how to make 3d games for android, is opengl a different program or does it come in eclipse thanks

  • I'm note sure, but i think this is done with:  protected void onPause(){ super.onPause(); mGLView.onPause(); } protected void onResume(){ super.onResume(); mGLView.onResume(); }

    }

    I think the View.onPause should keep the state of the GL scene, But i'm just starting to mess with And-OGL. Let me know if i'm wrong... got this from: developer.android.com/resource­s/tutorials/opengl/opengl-es10­.html

  • I'm not an android dev, but isn't there an event fired when the home button is pressed (onThombstone or something?) that way you can really quit your app (possibly save game state) so that you dont have to worry about this?

  • Nice video! I've coded some Android stuff and some OpenGL, but not a single line of OpenGL on Android. However, this is how I assumed it'd work. Isn't it is obvious that you can't rely on the context being present when you switch back considering that the Activity might get automagically get deleted if there's only tiny amount of memory left on the system etc?

  • Awesome!

    fullbleed T-Shirt?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more