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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:06:24+00:00 2026-06-17T13:06:24+00:00

I am loading the texture.png texture by using GLKit as per the code below:

  • 0

I am loading the texture.png texture by using GLKit as per the code below:

    // Setup texture       
CGImageRef imageRef = [[UIImage imageNamed:@"texture.png"] CGImage];
GLKTextureInfo texInfo = [GLKTextureLoader textureWithCGImage:imageRef options:nil error:NULL];

glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texInfo.name);


// Set parameters that control texture sampling for the bound
// texture
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texInfo.width, texInfo.height, 0, GL_RGB, GL_UNSIGNED_BYTE, XXXX);

XXXX is the data which specifies a pointer to the image data in memory. The problem is that I am using GLKit to load the texture but I couldn’t find in the apple documentation any way to retrieve the data from the GLKTextureInfo class. Does anyone know how I can fix that?

  • 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-06-17T13:06:25+00:00Added an answer on June 17, 2026 at 1:06 pm

    If you’ve called [GLKTextureLoader textureWithCGImage:options:error:], you don’t need to upload the bitmap data. It’s already happened, so the call to glTexImage2D() is unnecessary.

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

Sidebar

Related Questions

Im using this code to load a texture: HRESULT hr = D3DXCreateTextureFromFile(d3ddev, test.bmp, &g_texture);
I'm loading a PNG texture with: void Sprite::setTexture(string f) { SDL_Surface *image = IMG_Load(f.c_str());
i'm using three.js revision 53 when loading a texture in Canvas Renderer (IE on
Loading a CGImage or NSImage from a file using a standard image format (jpeg,
I am having some difficulty loading in texture coords from the obj file using
When loading the class, using method forName() , any static initializers in the class
After loading a PHP template (using jQuery's load function), this simple script won't make
I tried a lot of examples for loading and displaying images in openGL using
I am trying to load and draw a 2d texture using OpenGL with GLFW
UPDATE: I've posted the Renderer code below, since this code here doesn't seem to

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.