use of net.minecraft.client.texture.TextureManager in project BleachHack by BleachDrinker420.
the class ShaderLoader method loadEffect.
public static ShaderEffect loadEffect(Framebuffer framebuffer, Identifier id) throws JsonSyntaxException, IOException {
ResourceManager resMang = MinecraftClient.getInstance().getResourceManager();
TextureManager texMang = MinecraftClient.getInstance().getTextureManager();
return new ShaderEffect(texMang, new OpenResourceManager(resMang), framebuffer, id);
}
use of net.minecraft.client.texture.TextureManager in project Blockify by clownless.
the class RenderUtil method drawTexture.
public static void drawTexture(MatrixStack matrixStack, URLImage image, float x, float y, float scale) {
Identifier texture = image.getIdentifier();
int width = image.getWidth();
int height = image.getHeight();
TextureManager tex = MinecraftClient.getInstance().getTextureManager();
tex.bindTexture(texture);
RenderSystem.enableTexture();
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, texture);
RenderSystem.enableBlend();
RenderSystem.blendFunc(GlStateManager.SrcFactor.SRC_ALPHA, GlStateManager.DstFactor.ONE_MINUS_SRC_ALPHA);
RenderSystem.enableDepthTest();
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_TEXTURE);
Matrix4f matrices = matrixStack.peek().getPositionMatrix();
bufferBuilder.vertex(matrices, x, y + (height * scale), 0).texture(0, 1).next();
bufferBuilder.vertex(matrices, x + (width * scale), y + (height * scale), 0).texture(1, 1).next();
bufferBuilder.vertex(matrices, x + (width * scale), y, 0).texture(1, 0).next();
bufferBuilder.vertex(matrices, x, y, 0).texture(0, 0).next();
tessellator.draw();
RenderSystem.disableBlend();
}
use of net.minecraft.client.texture.TextureManager in project KiwiClient by TangyKiwi.
the class InGameHudMixin method render.
@Inject(method = "render", at = @At(value = "TAIL"), cancellable = true)
private void render(CallbackInfo info) {
if (!MinecraftClient.getInstance().options.debugEnabled) {
MinecraftClient client = MinecraftClient.getInstance();
TextRenderer textRenderer = client.textRenderer;
TextureManager textureManager = client.getTextureManager();
MatrixStack matrixStack = new MatrixStack();
RenderSystem.setShaderTexture(0, KiwiClient.DUCK);
client.inGameHud.drawTexture(matrixStack, 0, 0, 0, 0, 130, 130);
}
DrawOverlayEvent event = new DrawOverlayEvent(new MatrixStack());
KiwiClient.eventBus.post(event);
if (event.isCancelled())
info.cancel();
}
Aggregations