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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:28:06+00:00 2026-05-27T12:28:06+00:00

I am using OpenGL ES to perform drawing in an Android app. I want

  • 0

I am using OpenGL ES to perform drawing in an Android app.

I want to write a function called from the UI thread which would call the renderer thread and get it to read and return the image to the caller.

I was thinking about using a Future so that the UI thread would sleep while the renderer thread writes the image data (that operation is very fast, so the user would not feel like the app became unresponsive).

But I am at a loss about how to submit the Future to the renderer thread. All the examples I found create their own threads and then submit the future to these threads. The documentation about GLSurfaceView mentions “The queueEvent() method is used to safely communicate between the UI thread and the rendering thread. If you prefer, you can use some other Java cross-thread communication technique, such as synchronized methods on the Renderer class itself.” so it looks like using a Future instead of calling queueEvent() is possible, but I have no idea how to do that.

  • 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-27T12:28:07+00:00Added an answer on May 27, 2026 at 12:28 pm

    Thy this, I did not test it, so might not work:

    FutureTask<YourReturnObject> futureTask = new FutureTask<YourReturnObject>(new Callable<YourReturnObject>() {
        @Override
        public YourReturnObject call() throws Exception {
            //your gl stuff here
            return // result
        }
    });
    glSurfaceView.queueEvent(futureTask);
    YourReturnObject result=futureTask.get(); // should block until gl thread is done.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using OpenGL on Android to draw set width lines, which work great
I am using OpenGl in android and they have a callback method called draw
I am using OpenGL 2.0 on the android platform (Samsung Galaxy S2). When I
I'm using OpenGL in C++ Visual Studio 2008 Forms application and I want a
I'm using OpenGL for Android to draw my 2D images. Whenever I draw something
I am programming an Android 2d game using opengl es 2.0. After I draw
I want to draw using OpenGL library a Ring with sectors, each one with
I have an OpenGL app that needs to perform some computations in the background
I'm using OpenGL ES to display some objects exported from Blender. Blender provides a
I have a problem using opengl on android to draw a simple rectangle. This

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.