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

  • Home
  • SEARCH
  • 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 7499315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:47:08+00:00 2026-05-29T19:47:08+00:00

From what I’ve seen, if I wanna make a NON-opengl game loop what I

  • 0

From what I’ve seen, if I wanna make a NON-opengl game loop what I can do is have a game thread that during the loop will update the game state (or game physics) and also update the graphics by locking a Canvas from a (normal) SurfaceView, doing the drawing via Canvas.drawXXX(…) methods and then unlocking it at which point the graphics get updated for the loop.

I don’t really get how to do that when using GLSurfaceView and Renderer. From what I understand, I can no longer have my hand-made gameThread draw on demand as I had with the regular surface and it’s Canvas, because now there’s a rendering thread that will call Renderer.onDrawFrame() (on my implementation of the renderer class that I pass to the GLSurfaceView).

My question is then, what’s a good way to make a game loop with GLSurfaceView and Renderer? Should I still make my separate game thread, but only handle game state (physics) updates in it and then use that game state in my implementation of Renderer.onDrawFrame() to actually draw graphics based on current state? Should I only use the Rendere’s thread to also do state updates?

  • 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-29T19:47:09+00:00Added an answer on May 29, 2026 at 7:47 pm

    Well, as it turns out, best way to go is to use the thread provided by the GLSurface. The hook to it comes through an implementation of the Renderer interface. Effectively the Renderer’s onDrawFrame() method can be considered analogous to a regular Thread’s run() method. This kind of throws out the window the concept of a fixed updates per second paradigm (not really, but it’s too convoluted to do in this context) but on the other hand you get optimal graphics updates.

    There’s a great tutorial on Android and OpenGL here:

    http://insanitydesign.com/wp/projects/nehe-android-ports/

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

Sidebar

Related Questions

From examples that I have seen online and in a Programming Entity Framework CodeFirst
From epoll's man page: epoll is a variant of poll(2) that can be used
From here: https://stackoverflow.com/a/2485177/462608 For thread-safe accesses to shared data, we need a guarantee that
From what I have seen, if you are building a OSX desktop HTML5 app
From my SQLite database i pulled all of the entries that have Liquor in
From the manpage of the dbus-monitor command, I know that I can use some
From my website, I have a button which calls a method and then generates
From this context: import itertools lines = itertools.cycle(open('filename')) I'm wondering how I can implement
From 2.13.2/3 The double quote and the question mark ? , can be represented
From time to time I run into the issue that Grails integration tests the

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.