當前位置: 首頁>>代碼示例>>Java>>正文


Java Texture.getTextureHeight方法代碼示例

本文整理匯總了Java中org.newdawn.slick.opengl.Texture.getTextureHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java Texture.getTextureHeight方法的具體用法?Java Texture.getTextureHeight怎麽用?Java Texture.getTextureHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.newdawn.slick.opengl.Texture的用法示例。


在下文中一共展示了Texture.getTextureHeight方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
/**
 * Setup.
 *
 * @param u the u
 * @return the shader args
 */
public static ShaderArgs setup(FightUnit u) {
	Unit unit = u.getUnit();
	ShaderArgs args = new ShaderArgs();
	if(unit.getTheClass().name.equals("Lord")) return args;
	String c = unit.functionalClassName();
	
	Texture t = palettes.get(c);
	if(t == null) return args;
	if(lookup.get(c) == null) return args;
	int offset = lookup.get(c).indexOf(unit.name);
	if(offset < 0) return args;
	args.programName = "paletteSwap";
	args.args = new float[] {t.getTextureWidth(), t.getTextureHeight(), offset, t.getImageWidth()};
	GL13.glActiveTexture(GL13.GL_TEXTURE8);
	t.bind();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	return args;
}
 
開發者ID:eliatlarge,項目名稱:FEMultiPlayer-V2,代碼行數:25,代碼來源:PaletteSwapper.java

示例2: apply

import org.newdawn.slick.opengl.Texture; //導入方法依賴的package包/類
/**
 * Uploads the pixel data to the given texture at the specified position.
 * This only needs to be called once, after the pixel data has changed.
 * 
 * @param texture the texture to modify
 * @param x the x position to place the pixel data on the texture
 * @param y the y position to place the pixel data on the texture
 */
public void apply(Texture texture, int x, int y) {
	if (x+width > texture.getTextureWidth() || y+height > texture.getTextureHeight())
		throw new IndexOutOfBoundsException("pixel data won't fit in given texture");
	position(length());
	pixels.flip();
	int glFmt = format.getOGLType();
	final SGL GL = Renderer.get();
	texture.bind();
	GL.glTexSubImage2D(SGL.GL_TEXTURE_2D, 0, x, y, width, height, 
			glFmt, SGL.GL_UNSIGNED_BYTE, pixels);
}
 
開發者ID:lucas-tulio,項目名稱:fractal-explorer,代碼行數:20,代碼來源:PixelData.java


注:本文中的org.newdawn.slick.opengl.Texture.getTextureHeight方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。