简体   繁体   English

libgdx:在多个屏幕中进行纹理绑定

[英]libgdx: texture bind in multiple screens

I have a question regarding when texture bind occur. 我有一个关于何时发生纹理绑定的问题。 I extend the Game class, and have several Screen classes for different menus and the game. 我扩展了Game类,并为不同的菜单和游戏提供了几个Screen类。 I don't dispose the screens when I switch between them, and store them as members inside the Game class. 在屏幕之间切换时,我不会处理屏幕,而是将它们存储为Game类中的成员。

Each screen has different texture loaded and drawn. 每个屏幕都有不同的纹理加载和绘制。 My question is, when I show one of the screens, do also the other screens' (which were already shown at least once and were not disposed) textures are bound, although they are not in use in the current shown screen? 我的问题是,当我显示其中一个屏幕时,是否也绑定了其他屏幕(至少已显示一次且未放置)的纹理,尽管当前显示的屏幕中未使用它们?

I asked this question at LibGDX forum. 我在LibGDX论坛上问了这个问题。

The topic 话题

From Tonielro: The answer is no. 来自Tonielro: 答案是否定的。 Each screen handles its own drawing in the render method. 每个屏幕都使用render方法处理自己的绘图。 Another screen cannot render graphics for another. 另一个屏幕无法为另一个屏幕渲染图形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM