本文整理汇总了Java中net.minecraft.client.shader.Framebuffer.unbindFramebuffer方法的典型用法代码示例。如果您正苦于以下问题:Java Framebuffer.unbindFramebuffer方法的具体用法?Java Framebuffer.unbindFramebuffer怎么用?Java Framebuffer.unbindFramebuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.shader.Framebuffer
的用法示例。
在下文中一共展示了Framebuffer.unbindFramebuffer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawFullScreenLogo
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
public static void drawFullScreenLogo(final ResourceLocation logo, final int bg) {
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
mc.getTextureManager().bindTexture(logo);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.startDrawingQuads();
worldrenderer.setColorOpaque_I(16777215);
worldrenderer.addVertexWithUV(0.0D, (double)mc.displayHeight, 0.0D, 0.0D, 0.0D);
worldrenderer.addVertexWithUV((double)mc.displayWidth, (double)mc.displayHeight, 0.0D, 0.0D, 0.0D);
worldrenderer.addVertexWithUV((double)mc.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
worldrenderer.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
worldrenderer.setColorOpaque_I(bg);
short short1 = 256;
short short2 = 256;
mc.scaledTessellator((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
mc.updateDisplay();
}
示例2: drawSplashScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
logger.error((String)("Unable to load logo: " + locationMojangPng), (Throwable)ioexception);
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0, 0, j, k, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例3: drawSplashScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException {
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i,
scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double) scaledresolution.getScaledWidth(),
(double) scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try {
inputstream = this.mcDefaultResourcePack.getInputStream(locationMojangPng);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo",
new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
} catch (IOException ioexception) {
logger.error((String) ("Unable to load logo: " + locationMojangPng), (Throwable) ioexception);
} finally {
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255)
.endVertex();
worldrenderer.pos((double) this.displayWidth, (double) this.displayHeight, 0.0D).tex(0.0D, 0.0D)
.color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double) this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.func_181536_a((scaledresolution.getScaledWidth() - j) / 2, (scaledresolution.getScaledHeight() - k) / 2, 0,
0, j, k, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例4: drawSplashScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例5: drawSplashScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
public void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.disableLighting();
GlStateManager.disableFog();
GlStateManager.disableDepth();
GlStateManager.enableTexture2D();
InputStream inputstream = null;
try
{
inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
textureManagerInstance.bindTexture(this.mojangLogo);
}
catch (IOException ioexception)
{
LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
}
finally
{
IOUtils.closeQuietly(inputstream);
}
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
int j = 256;
int k = 256;
this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
GlStateManager.disableLighting();
GlStateManager.disableFog();
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GlStateManager.enableAlpha();
GlStateManager.alphaFunc(516, 0.1F);
this.updateDisplay();
}
示例6: loadScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
/**
* Displays a new screen.
*/
private void loadScreen() throws LWJGLException
{
GL11.glEnable(GL11.GL_TEXTURE_2D);
this.renderEngine.bindTexture(locationMojangPng);
ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight);
int var2 = var1.getScaleFactor();
Framebuffer var3 = new Framebuffer(var1.getScaledWidth() * var2, var1.getScaledHeight() * var2, true);
var3.bindFramebuffer(false);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, (double)var1.getScaledWidth(), (double)var1.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
this.renderEngine.bindTexture(locationMojangPng);
Tessellator var4 = Tessellator.instance;
var4.startDrawingQuads();
var4.setColorOpaque_I(16777215);
var4.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var4.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
var4.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
var4.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
var4.draw();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var4.setColorOpaque_I(16777215);
short var5 = 256;
short var6 = 256;
this.scaledTessellator((var1.getScaledWidth() - var5) / 2, (var1.getScaledHeight() - var6) / 2, 0, 0, var5, var6);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
var3.unbindFramebuffer();
var3.framebufferRender(var1.getScaledWidth() * var2, var1.getScaledHeight() * var2);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glFlush();
this.func_147120_f();
}
示例7: loadScreen
import net.minecraft.client.shader.Framebuffer; //导入方法依赖的package包/类
private void loadScreen() throws LWJGLException
{
ScaledResolution scaledresolution = new ScaledResolution(this, this.displayWidth, this.displayHeight);
int i = scaledresolution.getScaleFactor();
Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
framebuffer.bindFramebuffer(false);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0F, 0.0F, -2000.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
try
{
this.field_152354_ay = this.renderEngine.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(this.mcDefaultResourcePack.getInputStream(locationMojangPng))));
this.renderEngine.bindTexture(this.field_152354_ay);
}
catch (IOException ioexception)
{
logger.error("Unable to load logo: " + locationMojangPng, ioexception);
}
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.setColorOpaque_I(16777215);
tessellator.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
tessellator.addVertexWithUV((double)this.displayWidth, (double)this.displayHeight, 0.0D, 0.0D, 0.0D);
tessellator.addVertexWithUV((double)this.displayWidth, 0.0D, 0.0D, 0.0D, 0.0D);
tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
tessellator.draw();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
tessellator.setColorOpaque_I(16777215);
short short1 = 256;
short short2 = 256;
this.scaledTessellator((scaledresolution.getScaledWidth() - short1) / 2, (scaledresolution.getScaledHeight() - short2) / 2, 0, 0, short1, short2);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
framebuffer.unbindFramebuffer();
framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glFlush();
this.func_147120_f();
}