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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:29:50+00:00 2026-05-23T15:29:50+00:00

I have a render loop that I want to run in the background so

  • 0

I have a render loop that I want to run in the background so that I can control the speed of the playback loop making it animate either slow or fast. Right now I’m using sleep and calling begin and end on the CCRenderTexture in the main thread each time I want to use the sprite:

[self performSelectorOnMainThread:@selector(visit) withObject:nil waitUntilDone:YES];

- (void)visit {
    [target begin];
    [[self.currentLine.brush sprite] visit];
    [target end];
}

This was a hack that got it working but of course makes it run very slow. calling begin and end in the background thread just causes nothing to render at all

I want to be able to call begin, do all my drawing in the background thread and then call end but everything I’ve tried has either done nothing or made my EAGLView flip out.

  • 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-23T15:29:50+00:00Added an answer on May 23, 2026 at 3:29 pm

    The CCRenderTexure works by redirecting the opengl output onto itself so that the drawing that gets done is saved on your sprite. This means that in a single operation you need to call begin do all your drawing and then call end.

    When running on a background thread the CCDirector is making it’s own draw calls in the main thread so that when you call begin and try to do multiple functions in that state the director is drawing too causing all sorts of strange errors.

    end needs to be called before normal rendering operations resume.

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

Sidebar

Related Questions

How can I have a view render a partial (user control) from a different
I have some content that i have to render as a excel file in
I have a small app that has a Render thread. All this thread does
I have some .src files, and I want to render ONE .png file given
I have the following loop that renders an array a of arrays. Each arrays
I am getting data from my database and I want to have that data
I have a report that I need to run multiple times and save as
I have an array of node IDs with which loop through and run node_load($nid)
I have an issue with my KnockoutJS code that is creating an infinite loop.
I am aware that JSON strings often have a max length defined in either

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.