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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:22:56+00:00 2026-05-19T00:22:56+00:00

In my OpenGL-ES 1.1 based app, I’m using CALayer s as a source for

  • 0

In my OpenGL-ES 1.1 based app, I’m using CALayers as a source for OpenGL textures. Those CALayers comprise of CGImages and text rendered through CoreGraphics. Another OpenGL texture source is a screenshot of a UIView taken using -[CALAyer renderInContext:] and UIGraphicsGetImageFromCurrentImageContext. Currently, I’m running completely on the main thread.

The latter case in particular is pretty bad because it halts the OpenGL rendering for the whole time it takes to create the UIView and its screenshot.

Now I’m considering to move the OpenGL code into a separate thread hoping to get around this blocking. Ideally, the screenshot would be taken on a different thread (main thread if needed) than the OpenGL rendering.

I wasn’t able to find a complete coverage in the documentation about what requires running on the main thread and what not. I found some comments in the iOS 4 release notes, and some comments in specific UIKit methods but I’m missing the complete picture.

The code runs on iOS 4.x or higher.

  • 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-19T00:22:56+00:00Added an answer on May 19, 2026 at 12:22 am

    You can do drawing with OpenGL ES on a background thread, as long as you do don’t try to access the OpenGL context from another thread at the same time. See Apple’s Technical Q&A QA1612 for a little more on this.

    I have run into a number of issues with updating CALayer content from a background thread, so I do any work with layers on the main thread. Core Animation fires off its animations on a background thread, anyway.

    I’d never updated anything related to UIKit from a background thread, but some aspects of drawing in UIKit were made threadsafe in 4.0. David Duncan comments here that drawing to a context is now threadsafe.

    In your case, I wouldn’t see a problem with running the OpenGL ES rendering on a background thread (perhaps using a serial dispatch queue in GCD to prevent access to the context from multiple threads at once) and then doing your image grabs on another.

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

Sidebar

Related Questions

I am building a tile based app in Python using pyglet/openGL wherein I'll need
I'm using an NSTimer to do some rendering in an OpenGL based iPhone app.
I'm thinking about using OpenGL for part of my app, speciffically tile based London
I'm creating a drawing app ( text ) for the iPad using OpenGL. I've
Okay, so I'm using Rajawali (See: http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/ ) to create a 3D sphere with
I'm making an universal openGL based app that should work on ipod/iphone 2G/3G/3GS/4 and
I'm experimenting w/ improving the resolution of an OpenGL ES based app. Apple mentions
I'm building an OpenGL based app - writing in native C/C++. I want to
I'm trying to make my first App. based on OpenGl, i'm trying to draw
I'm working on an OpenGL based application. I've been using GLUT for setting up

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.