[英]SDL2 2D texture allocation/pooling
I have two questions regarding SDL2's hardware-accelerated texture rendering:我有两个关于 SDL2 的硬件加速纹理渲染的问题:
SDL_Createtexture(...)
, are textures automatically pooled/transferred between system RAM and VRAM when VRAM is at a premium?SDL_Createtexture(...)
,当 VRAM 非常SDL_Createtexture(...)
,纹理是否会在系统 RAM 和 VRAM 之间自动池化/传输? In order to ensure I don't inundate VRAM, I was considering loading textures into surfaces and converting them to textures as and when required (it's unlikely that all textures will fit into VRAM at once).SDL_Texture
instances need to be recreated?SDL_Texture
实例?No, you don't need to recreate your SDL_Texture
instances after minimize a window or change its resolutions.不,您不需要在最小化窗口或更改其分辨率后重新创建
SDL_Texture
实例。 Maybe you only need to redraw things in the screen after change its resolutions, but not after minimize it.也许您只需要在更改分辨率后重新绘制屏幕中的内容,而不是在最小化它之后。
Also, I recommend you to look at these SDL2 tutorials: https://lazyfoo.net/tutorials/SDL/index.php另外,我建议您查看这些 SDL2 教程: https ://lazyfoo.net/tutorials/SDL/index.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.