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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:51:51+00:00 2026-05-23T13:51:51+00:00

I am using the glImageProcessing example from Apple to perform some filter operations on.

  • 0

I am using the glImageProcessing example from Apple to perform some filter operations on. However, I would like to be able to load a new image into the texture.

Currently, the example loads the image with the line:

loadTexture("Image.png", &Input, &renderer); 

(which I’ve modified to accept an actual UIImage):

loadTexture(image, &Input, &renderer);

However, in testing how to redraw a new image I tried implementing (in Imaging.c):

loadTexture(image, &Input, &renderer);
loadTexture(newImage, &Input, &renderer);

and the sample app crashes at the line:

CFDataRef data = CGDataProviderCopyData(CGImageGetDataProvider(CGImage)); 

in Texture.c

I have also tried deleting the active texture by

loadTexture(image, &Input, &renderer);
glDeleteTextures(GL_TEXTURE_2D, 0);
loadTexture(newImage, &Input, &renderer);

which also fails.

Does anyone have any idea how to remove the image/texture from the opengl es interface so that I can load a new image???

Note: in Texture.c, apple states “The caller of this function is responsible for deleting the GL texture object.” I suppose this is what I am asking how to do. Apple doesn’t seem to give any clues 😉

Also note: I’ve seen this question posed many places, but no one seems to have an answer. I’m sure others will appreciate some help on this topic as well! Many thanks!

Cheers,
Brett

  • 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-23T13:51:52+00:00Added an answer on May 23, 2026 at 1:51 pm

    You’re using glDeleteTextures() incorrectly in the second case. The first parameter to that function is how many textures you wish to delete, and the second is an array of texture names (or a pointer to a single texture name). You’ll need to do something like the following:

    glDeleteTextures(1, &textureName);
    

    Where textureName is the name of the texture obtained at its creation. It looks like that value is stored within the texID component of the Image struct passed into loadTexture().

    That doesn’t fully explain the crash you see, which seems like a memory management issue with your input image (possibly an autoreleased object that is being discarded before you access its CGImage component).

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

Sidebar

Related Questions

Using a site like StackOverflow as an example: I have a table of users,
I am attempting to pull some information from my tnsnames file using regex. I
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I am trying to do some Image processing on a UIImage using some EAGLView
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor
I use the example GLImageProcessing, but it can not process the image with both
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using Java, how can I extract all the links from a given web page?
Using the Sanitize gem, I'm cleaning some HTML. In the href attribute of 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.