更新纹理而不是创建新纹理。 [英] Updating a texture rather than creating a new one.

查看:89
本文介绍了更新纹理而不是创建新纹理。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要更新一个纹理大小,但不想创建一个新的纹理大小,因为它会继续使用vide ocard中的内存并最终崩溃。

I need to update a textures size but dont want to create new one as it would keep using up memory in the vide ocard and eventually crash.

有没有办法这样做?

n.Wright

推荐答案

不是在程序的每个循环中创建一个新的纹理,我现在只在分辨率发生变化时才创建一个新纹理。

Rather than create a new texture every loop of the program, I now only create a new one if the resolution has changed.

不理想,因为最终希望视频卡的内存不足。

Not ideal because eventually the video card will run out of memory.

希望程序在此之前很久就会关闭。

Hopefully the program will be closed long before that.

我试过更新子资源但只是更新纹理数据而不是纹理大小。

I tried just updating the subresource but that only updates the texture data not the texture size.


这篇关于更新纹理而不是创建新纹理。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆