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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:12:46+00:00 2026-05-11T13:12:46+00:00

I’m using UIImage to render a game map from 32×32 blocks. The code is

  • 0

I’m using UIImage to render a game map from 32×32 blocks. The code is as follows

for( int x = 0; x < rwidth; ++x) {     for(int y = 0; y < rheight; ++y)     {         int bindex = [current_map GetTileIndex:x :y];         CGPoint p;         p.x = x * tile_size_x;         p.y = y * tile_size_x;         [img_list[bindex] drawAtPoint:p];     } } 

This ends up rendering about 150 tiles. My problem is when I run this code my render time goes down to 2-3 frames a second.

I thought the iPhone was fill bound, however if I force bindex to = 1 (ie render the same block 150 times) then I get full framerate.

I can’t believe it is that expensive to render from different UIImages.

Could someone please tell me what I’m doing wrong …

Oh I forgot to mention my image list created from a bigger texture page using CGImageCreateWithImageInRect.

Thanks Rich

  • 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. 2026-05-11T13:12:46+00:00Added an answer on May 11, 2026 at 1:12 pm

    Crack open Instruments and profile your code. It looks like you are drawing into a UIView, and they are not really optimized for games.. Since UIViews are layer-backed, drawAtPoint: needs to draw the image several times (to offscreen buffers) before it appears on screen.

    That being said, UIImage isn’t really designed for games. There’s a lot of overhead with regards to being part of UIKit. You’re not really meant to have hundreds of them.

    In approx order of speed (slowest to fastest):

    • UIImage (usually used if you have a few large images)
    • CALayers (if you need fine animation control or you have roughly 20 to 100 tiles/images)
    • OpelGL textures (what most games should be using)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 226k
  • Answers 226k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try this: $("a").click(function(){ $("#wrapper").append("<div id=" + this.id + "></div>"); });… May 13, 2026 at 1:09 am
  • Editorial Team
    Editorial Team added an answer You'll need to use the HTML mail format for that:… May 13, 2026 at 1:09 am
  • Editorial Team
    Editorial Team added an answer I suggest using javascript foreach. function ChkArray2(Str, Val){ for (var… May 13, 2026 at 1:09 am

Related Questions

I want use html5's new tag to play a wav file (currently only supported
In order to apply a triggered animation to all ToolTip s in my app,
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a French site that I want to parse, but am running into

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.