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


Java Framebuffer.deleteFramebuffer方法代码示例

本文整理汇总了Java中net.minecraft.client.shader.Framebuffer.deleteFramebuffer方法的典型用法代码示例。如果您正苦于以下问题:Java Framebuffer.deleteFramebuffer方法的具体用法?Java Framebuffer.deleteFramebuffer怎么用?Java Framebuffer.deleteFramebuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.shader.Framebuffer的用法示例。


在下文中一共展示了Framebuffer.deleteFramebuffer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: saveBlockPic

import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void saveBlockPic(String domain, String selected, int outputSize) {
	File f = new File(saveDir, domain + "/block/" + outputSize + "x/" + selected.replaceAll("[^0-9a-zA-Z]{1}", "_") + ".png");
	f.getParentFile().mkdirs();

	Framebuffer mb = mc.getFramebuffer();
	int radius = Math.min(mb.framebufferWidth, mb.framebufferHeight);
	Framebuffer fb = new Framebuffer(mb.framebufferWidth * outputSize / radius, mb.framebufferHeight * outputSize / radius, true);
	fb.framebufferClear();
	fb.bindFramebuffer(false);
	
	int r = radius * this.width / mb.framebufferWidth;

	setupRenderItemGlState(r, 0, 0);
	drawBlockCore(selected);
	releaseRenderItemGlState();
	
	FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outputSize, outputSize, false);
	
	mb.bindFramebuffer(true);
	fb.deleteFramebuffer();
}
 
开发者ID:herbix,项目名称:renderTo,代码行数:22,代码来源:RenderToGuiScreen.java

示例2: saveItemPic

import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void saveItemPic(String domain, String selected, int outputSize) {
	File f = new File(saveDir, domain + "/item/" + outputSize + "x/" + selected.replaceAll("[^0-9a-zA-Z]{1}", "_") + ".png");
	f.getParentFile().mkdirs();

	Framebuffer mb = mc.getFramebuffer();
	int radius = Math.min(mb.framebufferWidth, mb.framebufferHeight);
	Framebuffer fb = new Framebuffer(mb.framebufferWidth * outputSize / radius, mb.framebufferHeight * outputSize / radius, true);
	fb.framebufferClear();
	fb.bindFramebuffer(false);
	
	int r = radius * this.width / mb.framebufferWidth;

	setupRenderItemGlState(r, 0, 0);
	drawItemCore(selected);
	releaseRenderItemGlState();

	FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outputSize, outputSize, false);
	
	mb.bindFramebuffer(true);
	fb.deleteFramebuffer();
}
 
开发者ID:herbix,项目名称:renderTo,代码行数:22,代码来源:RenderToGuiScreen.java

示例3: saveEntityPic

import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void saveEntityPic(String domain, String selected, double size) {
	String fileSuffix = globalSetting.saveGif ? ".gif" : ".png";
	File f = new File(saveDir, domain + "/entity/" + size + "x/" + selected.replaceAll("[\\\\\\/\\?\\:\\>\\<\\|\\*\\\"]{1}", "_") + fileSuffix);
	f.getParentFile().mkdirs();

	Entity entity = cachedEntities.get(domain.equals("minecraft") ? selected : (domain + "." + selected));
	if(entity == null) {
		return;
	}
	double sizex = 0.5 * size * entity.width * 1.414;
	double sizey = 0.5 * size * (entity.height * 0.866 + entity.width * 0.707);
	int outx = (int)(64 * sizex + 0.5);
	int outy = (int)(64 * sizey + 0.5);
	int result;
	do {
		Framebuffer mb = mc.getFramebuffer();
		if(globalSetting.saveGif) {
			result = saveEntityGif(size, f, entity, outx, outy, mb);
		} else {
			Framebuffer fb = createAndRenderEntityToFrameBuffer(size, entity, outx, outy, mb);
			result = FrameBufferUtils.instance.saveFrameBufferToFile(fb, f, outx, outy, true);
			fb.deleteFramebuffer();
		}

		if ((result & 1) != 0) {
			outx *= 2;
		}
		if ((result & 2) != 0) {
			outy *= 2;
		}
		mb.bindFramebuffer(true);
	} while(result != 0);
}
 
开发者ID:herbix,项目名称:renderTo,代码行数:34,代码来源:RenderToGuiScreen.java

示例4: deleteFrameBuffer

import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
public static void deleteFrameBuffer(Framebuffer buffer)
{
    if(buffer.framebufferObject >= 0)
    {
        buffer.deleteFramebuffer();
    }
    frameBuffers.remove(buffer);
}
 
开发者ID:iChun,项目名称:iChunUtil,代码行数:9,代码来源:RendererHelper.java


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