Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Use RenderSystem instead of GlStateManager
Browse files Browse the repository at this point in the history
As the RenderSystem is simply a wrapper for the GlStateManager, we can
easily swap them. This will make it more futureproof.
Also removed the custom Projection as it does nothing useful.
  • Loading branch information
pascallj committed Jun 12, 2020
1 parent 7ffc93e commit 90f7e9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static org.lwjgl.glfw.GLFW.GLFW_KEY_LEFT_CONTROL;
import static org.lwjgl.opengl.GL11.GL_PROJECTION;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
Expand All @@ -28,7 +28,6 @@
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;

import nl.pascalroeleven.minecraft.mineshotrevived.client.util.ChatUtils;
import nl.pascalroeleven.minecraft.mineshotrevived.client.wrapper.Projection;

@EventBusSubscriber(bus = EventBusSubscriber.Bus.FORGE)
public class OrthoViewHandler {
Expand Down Expand Up @@ -206,7 +205,6 @@ public void onClientTickEvent(final ClientTickEvent event) {
tick++;
}

@SuppressWarnings("deprecation")
@SubscribeEvent
public void onFogDensity(EntityViewRenderEvent.FogDensity evt) {
if (!enabled) {
Expand All @@ -230,10 +228,9 @@ public void onFogDensity(EntityViewRenderEvent.FogDensity evt) {
float height = zoom;

// override projection matrix
GlStateManager.matrixMode(GL_PROJECTION);
GlStateManager.loadIdentity();

Projection.ortho(-width, width, -height, height, clip ? 0 : -9999, 9999);
RenderSystem.matrixMode(GL_PROJECTION);
RenderSystem.loadIdentity();
RenderSystem.ortho(-width, width, -height, height, clip ? 0 : -9999, 9999);
}

@SubscribeEvent
Expand Down

This file was deleted.

0 comments on commit 90f7e9f

Please sign in to comment.