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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:40:23+00:00 2026-05-14T07:40:23+00:00

I have 2 1024×1024 sprite sheets, one containing several 480×320 background images and another

  • 0

I have 2 1024×1024 sprite sheets, one containing several 480×320 background images and another containing a variety of smaller elements as entities and interface. My framerate drops like a rock whenever I enter a scene in which I have to display sprites from both textures (forcing me to re-bind twice per frame, interface texture->bg texture->interface texture).

- (void)setCurrentTexture:(int)texID{
 if(currentTex == texID)
  return;
 else
  currentTex = texID;

 // Bind the texture name. 
 glBindTexture(GL_TEXTURE_2D, [Graphics getTexture:texID]);
 // Speidfy a 2D texture image, provideing the a pointer to the image data in memory
 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, [Graphics getTexWidth:texID], [Graphics getTexHeight:texID], 0, GL_RGBA, GL_UNSIGNED_BYTE, [Graphics getTexData:texID]);
 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}

Is there something wrong with the way I’m swapping my textures?

Edit: I’ve removed half of the state changes I’ve been making. Removing any of the above 3 results in my polygons being textured with nothing (i.e. the show up white). The biggest hitter is glTexImage2D… but trying to set it elsewhere once (at init, for example) ends up with my models/quads not being textured at all.

  • 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-14T07:40:23+00:00Added an answer on May 14, 2026 at 7:40 am

    Unless you’re updating the data in the textures you should only call glTexImage2D once for each texture when your application startup.

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

Sidebar

Related Questions

Until now I have been making my own 1024*1024 sprite sheets by placing the
Here's the situation: I have a two images that are over 1024 in width
I have another one problem with pop3. Here is connection to pop3-server: $pop3Server =
If I have 300 640 x 960 images (for iPhone 4) and 300 1024
Here is my set up: I have two folders for images, 640 and 1024.
I am facing this issue: I have lots of threads (1024) who access one
I have a huge amount of images of size 768 by 1024. I want
I have one image 768 x 1024 size. second image is on that image
I have a 1024*768px image that I want to use as a background for
i have a 1024 x 1024 image I use for a texture in my

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.