当前位置: 首页>>代码示例>>Java>>正文


Java FileTextureData.copyToPOT方法代码示例

本文整理汇总了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;
}
 
开发者ID:anonl,项目名称:nvlist,代码行数:15,代码来源:PremultFileTextureData.java

示例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;
}
 
开发者ID:Murii,项目名称:Tilo-game-framework,代码行数:53,代码来源:Tilo.java


注:本文中的com.badlogic.gdx.graphics.glutils.FileTextureData.copyToPOT方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。