mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Save current texture before using the lexica botania shader and rebind it afterwards. Closes #1533
This commit is contained in:
1 parent
6c88006941
commit
afdf57e070
1 file changed
+16
-2
@@ -19,7 +19,6 @@ import net.minecraft.util.StatCollector;
|
||||
import org.lwjgl.opengl.ARBMultitexture;
|
||||
import org.lwjgl.opengl.ARBShaderObjects;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL13;
|
||||
|
||||
import vazkii.botania.api.internal.ShaderCallback;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
@@ -50,11 +49,11 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
int texture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, r.getTexture(stencilResource).getGlTextureId());
|
||||
ARBShaderObjects.glUniform1iARB(maskUniform, ConfigHandler.glSecondaryTextureUnit);
|
||||
|
||||
ARBShaderObjects.glUniform1fARB(heightMatchUniform, heightMatch);
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB);
|
||||
}
|
||||
};
|
||||
static boolean boundStencil = false;
|
||||
@@ -101,9 +100,24 @@ public class GuiButtonCategory extends GuiButtonLexicon {
|
||||
}
|
||||
mc.renderEngine.bindTexture(resource);
|
||||
|
||||
int texture = 0;
|
||||
boolean shaders = ShaderHelper.useShaders();
|
||||
|
||||
if(shaders) {
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
texture = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
|
||||
}
|
||||
|
||||
ShaderHelper.useShader(ShaderHelper.categoryButton, shaderCallback);
|
||||
RenderHelper.drawTexturedModalRect(xPosition * 2, yPosition * 2, zLevel * 2, 0, 0, 32, 32, s, s);
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
if(shaders) {
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB + ConfigHandler.glSecondaryTextureUnit);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
|
||||
OpenGlHelper.setActiveTexture(ARBMultitexture.GL_TEXTURE0_ARB);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(inside)
|
||||
|
||||
Reference in new issue
Block a user