<bdo id='y5HZK'></bdo><ul id='y5HZK'></ul>

        <small id='y5HZK'></small><noframes id='y5HZK'>

      1. <tfoot id='y5HZK'></tfoot>
        <i id='y5HZK'><tr id='y5HZK'><dt id='y5HZK'><q id='y5HZK'><span id='y5HZK'><b id='y5HZK'><form id='y5HZK'><ins id='y5HZK'></ins><ul id='y5HZK'></ul><sub id='y5HZK'></sub></form><legend id='y5HZK'></legend><bdo id='y5HZK'><pre id='y5HZK'><center id='y5HZK'></center></pre></bdo></b><th id='y5HZK'></th></span></q></dt></tr></i><div id='y5HZK'><tfoot id='y5HZK'></tfoot><dl id='y5HZK'><fieldset id='y5HZK'></fieldset></dl></div>

        <legend id='y5HZK'><style id='y5HZK'><dir id='y5HZK'><q id='y5HZK'></q></dir></style></legend>

        释放由 GLKTextureLoader 分配的纹理(GLKTextureInfo 对象

        时间:2023-05-30
        <legend id='oV2w9'><style id='oV2w9'><dir id='oV2w9'><q id='oV2w9'></q></dir></style></legend>
        • <bdo id='oV2w9'></bdo><ul id='oV2w9'></ul>
            <tbody id='oV2w9'></tbody>

            <small id='oV2w9'></small><noframes id='oV2w9'>

            <i id='oV2w9'><tr id='oV2w9'><dt id='oV2w9'><q id='oV2w9'><span id='oV2w9'><b id='oV2w9'><form id='oV2w9'><ins id='oV2w9'></ins><ul id='oV2w9'></ul><sub id='oV2w9'></sub></form><legend id='oV2w9'></legend><bdo id='oV2w9'><pre id='oV2w9'><center id='oV2w9'></center></pre></bdo></b><th id='oV2w9'></th></span></q></dt></tr></i><div id='oV2w9'><tfoot id='oV2w9'></tfoot><dl id='oV2w9'><fieldset id='oV2w9'></fieldset></dl></div>
          1. <tfoot id='oV2w9'></tfoot>
                • 本文介绍了释放由 GLKTextureLoader 分配的纹理(GLKTextureInfo 对象)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  刚开始在 iOS 上进行开发,尤其是 iOS 5 上与 OpenGL 相关的新功能,所以如果我的任何问题都非常基础,我深表歉意.

                  New to developing on iOS and in particular the new OpenGL related features on iOS 5, so I apologize if any of my questions are so basic.

                  我正在开发的应用程序旨在接收相机帧并通过 OpenGL ES 在屏幕上显示它们(图形人员将接管它并添加我知之甚少的实际 OpenGL 绘图).该应用程序是 XCode4 开发的,目标是运行 iOS 5 的 iPhone4.目前,我使用了 ARC 和 GLKit 功能,除了将图像加载为纹理时出现内存泄漏外,一切都运行良好.该应用很快就会收到内存警告".

                  The app I am working on is designed to receive camera frames and display them on screen via OpenGL ES (the graphic folks will take over this and add the actual OpenGL drawing about which I know very little). The application is developed XCode4, and the target is iPhone4 running iOS 5. For the moment, I used the ARC and the GLKit functionality and all is working fine except for the memory leak in loading the images as texture. The app receives a "memory warning" very soon.

                  具体想问一下怎么释放分配的贴图

                  Specifically, I would like to ask how to release the textures allocated by

                  @property(retain) GLKTextureInfo *texture;
                  
                  -(void)setTextureCGImage:(CGImageRef)image 
                  {
                      NSError *error;
                  
                      self.texture = [GLKTextureLoader textureWithCGImage:image options:nil error:&error];
                  
                      if (error) 
                      {
                          NSLog(@"Error loading texture from image: %@",error);
                      }
                  }
                  

                  image 是从相机框架构建的石英图像(来自苹果的示例代码).我知道问题不在代码的那部分,因为如果我禁用分配,应用程序不会收到警告.

                  The image is a quartz image built from the camera frame (sample code from apple). I know the problem is not in that part of the code since if I disable the assignment, the app does not receive the warning.

                  推荐答案

                  我相信超级 hacky 解决方案,但它似乎有效:

                  Super hacky solution I believe, but it seems to work:

                  在赋值前添加以下内容:

                  Add the following before the assignment:

                  GLuint name = self.texture.name;
                  glDeleteTextures(1, &name);
                  

                  如果有更官方的方式(或者如果这是官方方式),如果有人可以告诉我,我将不胜感激.

                  If there's a more official way (or if this is the official way), I would appreciate if someone could let me know.

                  这篇关于释放由 GLKTextureLoader 分配的纹理(GLKTextureInfo 对象)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:检查iOS应用是否在应用商店中 下一篇:iOS - 如何创建“实用程序"?我的所有控制器都

                  相关文章

                  最新文章

                • <tfoot id='iu4U1'></tfoot>
                • <i id='iu4U1'><tr id='iu4U1'><dt id='iu4U1'><q id='iu4U1'><span id='iu4U1'><b id='iu4U1'><form id='iu4U1'><ins id='iu4U1'></ins><ul id='iu4U1'></ul><sub id='iu4U1'></sub></form><legend id='iu4U1'></legend><bdo id='iu4U1'><pre id='iu4U1'><center id='iu4U1'></center></pre></bdo></b><th id='iu4U1'></th></span></q></dt></tr></i><div id='iu4U1'><tfoot id='iu4U1'></tfoot><dl id='iu4U1'><fieldset id='iu4U1'></fieldset></dl></div>
                      <bdo id='iu4U1'></bdo><ul id='iu4U1'></ul>
                    <legend id='iu4U1'><style id='iu4U1'><dir id='iu4U1'><q id='iu4U1'></q></dir></style></legend>

                      <small id='iu4U1'></small><noframes id='iu4U1'>