本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.isFramebufferEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.isFramebufferEnabled方法的具体用法?Java OpenGlHelper.isFramebufferEnabled怎么用?Java OpenGlHelper.isFramebufferEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.isFramebufferEnabled方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBindFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void createBindFramebuffer(int width, int height)
{
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferWidth = width;
this.framebufferHeight = height;
}
else
{
GlStateManager.enableDepth();
if (this.framebufferObject >= 0)
{
this.deleteFramebuffer();
}
this.createFramebuffer(width, height);
this.checkFramebufferComplete();
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0);
}
}
示例2: setFramebufferFilter
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void setFramebufferFilter(int p_147607_1_)
{
if (OpenGlHelper.isFramebufferEnabled())
{
this.framebufferFilter = p_147607_1_;
GlStateManager.bindTexture(this.framebufferTexture);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, (float)p_147607_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, (float)p_147607_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
GlStateManager.bindTexture(0);
}
}
示例3: setFramebufferFilter
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void setFramebufferFilter(int framebufferFilterIn)
{
if (OpenGlHelper.isFramebufferEnabled())
{
this.framebufferFilter = framebufferFilterIn;
GlStateManager.bindTexture(this.framebufferTexture);
GlStateManager.glTexParameteri(3553, 10241, framebufferFilterIn);
GlStateManager.glTexParameteri(3553, 10240, framebufferFilterIn);
GlStateManager.glTexParameteri(3553, 10242, 10496);
GlStateManager.glTexParameteri(3553, 10243, 10496);
GlStateManager.bindTexture(0);
}
}
示例4: displayString
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void displayString(String message)
{
this.currentlyDisplayedText = message;
if (!this.mc.running)
{
if (!this.loadingSuccess)
{
throw new MinecraftError();
}
}
else
{
GlStateManager.clear(256);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
if (OpenGlHelper.isFramebufferEnabled())
{
int i = this.scaledResolution.getScaleFactor();
GlStateManager.ortho(0.0D, (double)(this.scaledResolution.getScaledWidth() * i), (double)(this.scaledResolution.getScaledHeight() * i), 0.0D, 100.0D, 300.0D);
}
else
{
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
}
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -200.0F);
}
}
示例5: displayString
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void displayString(String message)
{
this.currentlyDisplayedText = message;
if (!this.mc.running)
{
if (!this.field_73724_e)
{
throw new MinecraftError();
}
}
else
{
GlStateManager.clear(256);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
if (OpenGlHelper.isFramebufferEnabled())
{
int i = this.scaledResolution.getScaleFactor();
GlStateManager.ortho(0.0D, (double)(this.scaledResolution.getScaledWidth() * i), (double)(this.scaledResolution.getScaledHeight() * i), 0.0D, 100.0D, 300.0D);
}
else
{
ScaledResolution scaledresolution = new ScaledResolution(this.mc);
GlStateManager.ortho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 100.0D, 300.0D);
}
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -200.0F);
}
}
示例6: bindFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void bindFramebuffer(boolean p_147610_1_)
{
if (OpenGlHelper.isFramebufferEnabled())
{
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
if (p_147610_1_)
{
GlStateManager.viewport(0, 0, this.framebufferWidth, this.framebufferHeight);
}
}
}
示例7: createFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void createFramebuffer(int width, int height)
{
this.framebufferWidth = width;
this.framebufferHeight = height;
this.framebufferTextureWidth = width;
this.framebufferTextureHeight = height;
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferClear();
}
else
{
this.framebufferObject = OpenGlHelper.glGenFramebuffers();
this.framebufferTexture = TextureUtil.glGenTextures();
if (this.useDepth)
{
this.depthBuffer = OpenGlHelper.glGenRenderbuffers();
}
this.setFramebufferFilter(9728);
GlStateManager.bindTexture(this.framebufferTexture);
GlStateManager.glTexImage2D(3553, 0, 32856, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, 6408, 5121, (IntBuffer)null);
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0);
if (this.useDepth)
{
OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight);
OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
}
this.framebufferClear();
this.unbindFramebufferTexture();
}
}
示例8: deleteFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void deleteFramebuffer()
{
if (OpenGlHelper.isFramebufferEnabled())
{
this.unbindFramebufferTexture();
this.unbindFramebuffer();
if (this.depthBuffer > -1)
{
OpenGlHelper.glDeleteRenderbuffers(this.depthBuffer);
this.depthBuffer = -1;
}
if (this.framebufferTexture > -1)
{
TextureUtil.deleteTexture(this.framebufferTexture);
this.framebufferTexture = -1;
}
if (this.framebufferObject > -1)
{
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0);
OpenGlHelper.glDeleteFramebuffers(this.framebufferObject);
this.framebufferObject = -1;
}
}
}
示例9: createFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void createFramebuffer(int width, int height)
{
this.framebufferWidth = width;
this.framebufferHeight = height;
this.framebufferTextureWidth = width;
this.framebufferTextureHeight = height;
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferClear();
}
else
{
this.framebufferObject = OpenGlHelper.glGenFramebuffers();
this.framebufferTexture = TextureUtil.glGenTextures();
if (this.useDepth)
{
this.depthBuffer = OpenGlHelper.glGenRenderbuffers();
}
this.setFramebufferFilter(9728);
GlStateManager.bindTexture(this.framebufferTexture);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null));
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0);
if (this.useDepth)
{
OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight);
OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
}
this.framebufferClear();
this.unbindFramebufferTexture();
}
}
示例10: framebufferRenderExt
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void framebufferRenderExt(int width, int height, boolean p_178038_3_)
{
if (OpenGlHelper.isFramebufferEnabled())
{
GlStateManager.colorMask(true, true, true, false);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)width, (double)height, 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.viewport(0, 0, width, height);
GlStateManager.enableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
if (p_178038_3_)
{
GlStateManager.disableBlend();
GlStateManager.enableColorMaterial();
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.bindFramebufferTexture();
float f = (float)width;
float f1 = (float)height;
float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
vertexbuffer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
tessellator.draw();
this.unbindFramebufferTexture();
GlStateManager.depthMask(true);
GlStateManager.colorMask(true, true, true, true);
}
}
示例11: createFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void createFramebuffer(int width, int height)
{
this.framebufferWidth = width;
this.framebufferHeight = height;
this.framebufferTextureWidth = width;
this.framebufferTextureHeight = height;
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferClear();
}
else
{
this.framebufferObject = OpenGlHelper.glGenFramebuffers();
this.framebufferTexture = TextureUtil.glGenTextures();
if (this.useDepth)
{
this.depthBuffer = OpenGlHelper.glGenRenderbuffers();
}
this.setFramebufferFilter(9728);
GlStateManager.bindTexture(this.framebufferTexture);
GlStateManager.glTexImage2D(3553, 0, 32856, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, 6408, 5121, (IntBuffer)null);
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0);
if (this.useDepth)
{
OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
if (!this.stencilEnabled)
{
OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight);
OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
}
else
{
OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.framebufferTextureWidth, this.framebufferTextureHeight);
OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
}
}
this.framebufferClear();
this.unbindFramebufferTexture();
}
}
示例12: framebufferRenderExt
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_)
{
if (OpenGlHelper.isFramebufferEnabled())
{
GlStateManager.colorMask(true, true, true, false);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity();
GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D);
GlStateManager.matrixMode(5888);
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, 0.0F, -2000.0F);
GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_);
GlStateManager.enableTexture2D();
GlStateManager.disableLighting();
GlStateManager.disableAlpha();
if (p_178038_3_)
{
GlStateManager.disableBlend();
GlStateManager.enableColorMaterial();
}
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.bindFramebufferTexture();
float f = (float)p_178038_1_;
float f1 = (float)p_178038_2_;
float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
tessellator.draw();
this.unbindFramebufferTexture();
GlStateManager.depthMask(true);
GlStateManager.colorMask(true, true, true, true);
}
}