本文整理汇总了Java中com.badlogic.gdx.graphics.glutils.FileTextureData.copyToPOT方法的典型用法代码示例。如果您正苦于以下问题:Java FileTextureData.copyToPOT方法的具体用法?Java FileTextureData.copyToPOT怎么用?Java FileTextureData.copyToPOT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.glutils.FileTextureData
的用法示例。
在下文中一共展示了FileTextureData.copyToPOT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ensurePot
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入方法依赖的package包/类
protected Pixmap ensurePot(Pixmap pixmap) {
if (Gdx.gl20 == null && FileTextureData.copyToPOT) {
int pixmapWidth = pixmap.getWidth();
int pixmapHeight = pixmap.getHeight();
int potWidth = MathUtils.nextPowerOfTwo(pixmapWidth);
int potHeight = MathUtils.nextPowerOfTwo(pixmapHeight);
if (pixmapWidth != potWidth || pixmapHeight != potHeight) {
Pixmap copy = PixmapUtil.resizedCopy(pixmap, Dim.of(potWidth, potHeight), Filter.BiLinear);
pixmap.dispose();
return copy;
}
}
return pixmap;
}
示例2: create
import com.badlogic.gdx.graphics.glutils.FileTextureData; //导入方法依赖的package包/类
public void create() {
int width = 800;
int height = 600;
Tilo.width = width;
Tilo.height = height;
script = new lua();
// LOAD PLUGINS
g.plugin_load();
script.put("graphics", g);
script.put("timer", t);
script.put("window", w);
script.put("math", m);
script.put("input", i);
script.put("audio", a);
if (getPlatform().equalsIgnoreCase("desktop")) {
width = 800;
height = 600;
Tilo.width = width;
Tilo.height = height;
boolean fullscreen = false;
Gdx.graphics.setDisplayMode(width, height, fullscreen);
}
assets = new AssetManager();
Gdx.input.setInputProcessor(this);
// LOAD SCRIPT
FileHandle main = file("main.lua");
if (main.exists()) {
script.eval(main.readString());
} else {
error(TAG, E_RESOURCE + main.name());
quit();
}
// Enable non power of two textures.
FileTextureData.copyToPOT = true;
// Set OpenGL features
Gdx.gl.glDisable(GL20.GL_CULL_FACE);
Gdx.gl.glDisable(GL20.GL_DITHER);
Gdx.gl.glDisable(GL20.GL_DEPTH_TEST);
Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST);
script.invoke("tilo", "load", assets);
ready = true;
}