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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:41:38+00:00 2026-05-24T01:41:38+00:00

I am developing openGL application on iPad and i came up to one quite

  • 0

I am developing openGL application on iPad and i came up to one quite large problem. I used already existing posts to learn that i can use UILabel to generate text into opengl texture, so i did that. The problem appeared when i had to use five or more labels in different places of texture. When my application must generate five of those textures consisting of five labels each it takes some power. I generate one texture in one loop max, but that creates a small lag. When i load five textures, the lag gets five times more irritating.

Now when i told the story, let me ask you a question:

How could i relieve my CPU and perhaps generate text in some other way? Its static, just for displaying info.

I did try using other thread, but i came up to even more problems, so i would rather prefer some text generating alternative that multi threading.

Here is a part of that texture generator:

//------------ DATE --------------------------------
[dateLabel setBounds:CGRectMake(0, 0, 95, 10)];
[dateLabel setFrame:CGRectMake(0, 0, 95, 10)];
[dateLabel setBackgroundColor:[UIColor clearColor]];
[dateLabel setFont:[UIFont systemFontOfSize:12]];
[dateLabel setLineBreakMode:UILineBreakModeWordWrap];
[dateLabel setNumberOfLines:1];
dateLabel.textColor = [UIColor whiteColor];

dateLabel.text = [self.delegate dateAtIndex:index];

UIGraphicsBeginImageContext(CGSizeMake(95, 10));     
[dateLabel.layer renderInContext:UIGraphicsGetCurrentContext()]; 
//[dateLabel release]; // We can now release the view
UIImage* date = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext();

As you can see, i set the position, size, text and then create UIImage out of it. I create even more of those images (five in fact), and then i render all those images to other context which is my last texture.

Perhaps my lack of experience led me to some stupid solution here.

  • 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-24T01:41:39+00:00Added an answer on May 24, 2026 at 1:41 am

    I figured it out. I had to turn to multi threading anyway. It appears that text in OpenGL can be rendered in many ways. But all of them requires different approach and implementation. You can generate text letter by letter, you can use existing libraries and so on. But UILabel method still beats them all when you only need static text on some texture.

    Anyway, i managed to relieve the CPU by using NSOperationQueue. I fed all the processing to operation queue and the images it generated, saved in NSMutableArray. Only then i used them for generating textures.

    Hooray!

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

Sidebar

Related Questions

I'm currently developing an iOS application (iPad and iPhone) that uses OpenGL ES 1.0
I'm developing an slightly animated application (in c++ with opengl). For that, I need
I am developing an Android application that uses OpenGL to render a 3D ball
I'm developing an Android application with some native code (used to render with OpenGL
I have trouble developing an OpenGL application. The weird thing is that me and
I'm developing an iPhone OpenGL application, and I need to use some textures with
I'm developing an application which make use of display lists offered by OpenGL. My
I'm developing an OpenGL application. I need to have a model of planet earth
I'm developing a desktop OpenGL application, and I want to make sure it'll be
I'm developing a graphing application that on the main navigation/tab view displays a UIView

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.