Search in sources :

Example 1 with GuiIngameForge

use of net.minecraftforge.client.GuiIngameForge in project GregTech by GregTechCE.

the class RenderUtil method applyScissor.

// applies scissor with gui-space coordinates and sizes
private static void applyScissor(int x, int y, int w, int h) {
    // translate upper-left to bottom-left
    ScaledResolution r = ((GuiIngameForge) Minecraft.getMinecraft().ingameGUI).getResolution();
    int s = r.getScaleFactor();
    int translatedY = r.getScaledHeight() - y - h;
    GL11.glScissor(x * s, translatedY * s, w * s, h * s);
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiIngameForge(net.minecraftforge.client.GuiIngameForge)

Aggregations

ScaledResolution (net.minecraft.client.gui.ScaledResolution)1 GuiIngameForge (net.minecraftforge.client.GuiIngameForge)1