本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.bindTexture方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.bindTexture方法的具体用法?Java GlStateManager.bindTexture怎么用?Java GlStateManager.bindTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.bindTexture方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTextureMinMagFilter
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
static void updateTextureMinMagFilter()
{
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
ITextureObject itextureobject = texturemanager.getTexture(TextureMap.locationBlocksTexture);
if (itextureobject != null)
{
MultiTexID multitexid = itextureobject.getMultiTexID();
GlStateManager.bindTexture(multitexid.base);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilB]);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilB]);
GlStateManager.bindTexture(multitexid.norm);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilN]);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilN]);
GlStateManager.bindTexture(multitexid.spec);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, Shaders.texMinFilValue[Shaders.configTexMinFilS]);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, Shaders.texMagFilValue[Shaders.configTexMagFilS]);
GlStateManager.bindTexture(0);
}
}
示例2: setBlurMipmapDirect
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void setBlurMipmapDirect(boolean p_174937_1_, boolean p_174937_2_)
{
this.blur = p_174937_1_;
this.mipmap = p_174937_2_;
boolean flag = true;
boolean flag1 = true;
int i;
short short1;
if (p_174937_1_)
{
i = p_174937_2_ ? 9987 : 9729;
short1 = 9729;
}
else
{
i = p_174937_2_ ? 9986 : 9728;
short1 = 9728;
}
GlStateManager.bindTexture(this.getGlTextureId());
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, short1);
}
示例3: endShader
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void endShader()
{
OpenGlHelper.glUseProgram(0);
currentProgram = -1;
staticShaderManager = null;
field_148000_e = true;
for (int i = 0; i < this.shaderSamplerLocations.size(); ++i)
{
if (this.shaderSamplers.get(this.samplerNames.get(i)) != null)
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.bindTexture(0);
}
}
}
示例4: initDynamicTexture
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void initDynamicTexture(int texID, int width, int height, DynamicTexture tex)
{
MultiTexID multitexid = tex.getMultiTexID();
int[] aint = tex.getTextureData();
int i = width * height;
Arrays.fill(aint, i, i * 2, -8421377);
Arrays.fill((int[])aint, i * 2, i * 3, (int)0);
TextureUtil.allocateTexture(multitexid.base, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.norm, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
TextureUtil.allocateTexture(multitexid.spec, width, height);
TextureUtil.setTextureBlurMipmap(false, false);
TextureUtil.setTextureClamped(false);
GlStateManager.bindTexture(multitexid.base);
}
示例5: uploadTexSubForLoadAtlas
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void uploadTexSubForLoadAtlas(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp)
{
TextureUtil.uploadTextureMipmap(data, width, height, xoffset, yoffset, linear, clamp);
boolean flag = false;
if (Shaders.configNormalMap)
{
int[][] aint = readImageAndMipmaps(iconName + "_n", width, height, data.length, flag, -8421377);
GlStateManager.bindTexture(updatingTex.norm);
TextureUtil.uploadTextureMipmap(aint, width, height, xoffset, yoffset, linear, clamp);
}
if (Shaders.configSpecularMap)
{
int[][] aint1 = readImageAndMipmaps(iconName + "_s", width, height, data.length, flag, 0);
GlStateManager.bindTexture(updatingTex.spec);
TextureUtil.uploadTextureMipmap(aint1, width, height, xoffset, yoffset, linear, clamp);
}
GlStateManager.bindTexture(updatingTex.base);
}
示例6: uploadTexSub
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void uploadTexSub(int[][] data, int width, int height, int xoffset, int yoffset, boolean linear, boolean clamp)
{
TextureUtil.uploadTextureMipmap(data, width, height, xoffset, yoffset, linear, clamp);
if (Shaders.configNormalMap || Shaders.configSpecularMap)
{
if (Shaders.configNormalMap)
{
GlStateManager.bindTexture(updatingTex.norm);
uploadTexSub1(data, width, height, xoffset, yoffset, 1);
}
if (Shaders.configSpecularMap)
{
GlStateManager.bindTexture(updatingTex.spec);
uploadTexSub1(data, width, height, xoffset, yoffset, 2);
}
GlStateManager.bindTexture(updatingTex.base);
}
}
示例7: createFramebuffer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的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: unsetBrightness
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void unsetBrightness()
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_ALPHA, OpenGlHelper.GL_PRIMARY_COLOR);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_ALPHA, 770);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2);
GlStateManager.disableTexture2D();
GlStateManager.bindTexture(0);
GlStateManager.glTexEnvi(8960, 8704, OpenGlHelper.GL_COMBINE);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_RGB, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND1_RGB, 768);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_RGB, 5890);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_COMBINE_ALPHA, 8448);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_OPERAND0_ALPHA, 770);
GlStateManager.glTexEnvi(8960, OpenGlHelper.GL_SOURCE0_ALPHA, 5890);
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例9: bindFramebufferTexture
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void bindFramebufferTexture()
{
if (OpenGlHelper.isFramebufferEnabled())
{
GlStateManager.bindTexture(this.framebufferTexture);
}
}
示例10: unsetBrightness
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void unsetBrightness()
{
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.enableTexture2D();
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, OpenGlHelper.defaultTexUnit);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PRIMARY_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, OpenGlHelper.defaultTexUnit);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_ALPHA, OpenGlHelper.GL_PRIMARY_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_ALPHA, GL11.GL_SRC_ALPHA);
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, GL11.GL_TEXTURE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.setActiveTexture(OpenGlHelper.GL_TEXTURE2);
GlStateManager.disableTexture2D();
GlStateManager.bindTexture(0);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, OpenGlHelper.GL_COMBINE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_RGB, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND1_RGB, GL11.GL_SRC_COLOR);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_RGB, GL11.GL_TEXTURE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE1_RGB, OpenGlHelper.GL_PREVIOUS);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_COMBINE_ALPHA, GL11.GL_MODULATE);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_OPERAND0_ALPHA, GL11.GL_SRC_ALPHA);
GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, OpenGlHelper.GL_SOURCE0_ALPHA, GL11.GL_TEXTURE);
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例11: bindCustomTextures
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private static void bindCustomTextures(CustomTexture[] cts)
{
if (cts != null)
{
for (int i = 0; i < cts.length; ++i)
{
CustomTexture customtexture = cts[i];
GlStateManager.setActiveTexture(33984 + customtexture.getTextureUnit());
ITextureObject itextureobject = customtexture.getTexture();
GlStateManager.bindTexture(itextureobject.getGlTextureId());
}
}
}
示例12: HFNoiseTexture
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public HFNoiseTexture(int width, int height)
{
byte[] abyte = this.genHFNoiseImage(width, height);
ByteBuffer bytebuffer = BufferUtils.createByteBuffer(abyte.length);
bytebuffer.put(abyte);
bytebuffer.flip();
GlStateManager.bindTexture(this.texID);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, width, height, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)bytebuffer);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GlStateManager.bindTexture(0);
}
示例13: readImageAndMipmaps
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static int[][] readImageAndMipmaps(String name, int width, int height, int numLevels, boolean border, int defColor)
{
int[][] aint = new int[numLevels][];
int[] aint1;
aint[0] = aint1 = new int[width * height];
boolean flag = false;
BufferedImage bufferedimage = readImage(updatingTextureMap.completeResourceLocation(new ResourceLocation(name)));
if (bufferedimage != null)
{
int i = bufferedimage.getWidth();
int j = bufferedimage.getHeight();
if (i + (border ? 16 : 0) == width)
{
flag = true;
bufferedimage.getRGB(0, 0, i, i, aint1, 0, i);
}
}
if (!flag)
{
Arrays.fill(aint1, defColor);
}
GlStateManager.bindTexture(updatingTex.spec);
aint = genMipmapsSimple(aint.length - 1, width, aint);
return aint;
}
示例14: updateDynamicTexture
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void updateDynamicTexture(int texID, int[] src, int width, int height, DynamicTexture tex)
{
MultiTexID multitexid = tex.getMultiTexID();
GlStateManager.bindTexture(multitexid.base);
updateDynTexSubImage1(src, width, height, 0, 0, 0);
GlStateManager.bindTexture(multitexid.norm);
updateDynTexSubImage1(src, width, height, 0, 0, 1);
GlStateManager.bindTexture(multitexid.spec);
updateDynTexSubImage1(src, width, height, 0, 0, 2);
GlStateManager.bindTexture(multitexid.base);
}
示例15: preLoadShader
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void preLoadShader()
{
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
GlStateManager.disableDepth();
GlStateManager.disableAlpha();
GlStateManager.disableFog();
GlStateManager.disableLighting();
GlStateManager.disableColorMaterial();
GlStateManager.enableTexture2D();
GlStateManager.bindTexture(0);
}