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

Using OpenGL /GLUT how would I detect if two keys, say 'a' and 'j'
I'm using OpenGL to render a game view in my android application. The game
I'm using OpenGL and drawing polygons in a 2D view. How could I blur
I am trying to perform several image manipulations using OpenGL ES 2.0 and display
I am using OpenGL/GLUT to implement Bresenham's line drawing algorithm and having some issues
I'm using OpenGL ES to display some objects exported from Blender. Blender provides a
I am using the glImageProcessing example from Apple to perform some filter operations on.
Im using OpenGL for an app that im trying to make. I've been learning
I am creating an android game using opengl and a cocos2d port (http://code.google.com/p/cocos2d-android-1). I
Good afternoon. I have been making a small openGL based app for android that

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.