// Path: src/main/java/clientapi/event/defaults/game/render/RenderWorldEvent.java
// public final class RenderWorldEvent extends RenderEvent {
// 
//     /**
//      * The Render pass this event was called from
//      */
//     private final Pass pass;
// 
//     public RenderWorldEvent(float partialTicks, int pass) {
//         super(partialTicks);
//         this.pass = Pass.values()[pass];
//     }
// 
//     /**
//      * @return The render pass that this event was called from
//      */
//     public final Pass getPass() {
//         return this.pass;
//     }
// 
//     public enum Pass {
//         ANAGLYPH_CYAN, ANAGLYPH_RED, NORMAL
//     }
// 
//     @Override
//     public String toString() {
//         return "RenderWorldEvent{" +
//                 "pass=" + pass +
//                 ", partialTicks=" + partialTicks +
//                 '}';
//     }
// }


import clientapi.ClientAPI;
import clientapi.event.defaults.game.render.RenderWorldEvent;
import clientapi.util.math.Vec3;
import clientapi.util.render.Colors;
import me.zero.alpine.listener.Listener;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.Display;
import org.lwjgl.util.glu.GLU;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import static org.lwjgl.opengl.GL11.*;
/*
 * Copyright 2018 ImpactDevelopment
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package clientapi.util.render.gl;




/**
 * OpenGL utils
 *
 * @author Brady
 * @since 2/20/2017
 */
public final class GLUtils {

    private GLUtils() {}

    private static final FloatBuffer MODELVIEW = BufferUtils.createFloatBuffer(16);
    private static final FloatBuffer PROJECTION = BufferUtils.createFloatBuffer(16);
    private static final IntBuffer VIEWPORT = BufferUtils.createIntBuffer(16);
    private static final FloatBuffer TO_SCREEN_BUFFER = BufferUtils.createFloatBuffer(3);
    private static final FloatBuffer TO_WORLD_BUFFER = BufferUtils.createFloatBuffer(3);

    public static void init() {
// Path: src/main/java/clientapi/event/defaults/game/render/RenderWorldEvent.java
// public final class RenderWorldEvent extends RenderEvent {
// 
//     /**
//      * The Render pass this event was called from
//      */
//     private final Pass pass;
// 
//     public RenderWorldEvent(float partialTicks, int pass) {
//         super(partialTicks);
//         this.pass = Pass.values()[pass];
//     }
// 
//     /**
//      * @return The render pass that this event was called from
//      */
//     public final Pass getPass() {
//         return this.pass;
//     }
// 
//     public enum Pass {
//         ANAGLYPH_CYAN, ANAGLYPH_RED, NORMAL
//     }
// 
//     @Override
//     public String toString() {
//         return "RenderWorldEvent{" +
//                 "pass=" + pass +
//                 ", partialTicks=" + partialTicks +
//                 '}';
//     }
// }


// Path: src/main/java/clientapi/util/render/gl/GLUtils.java
import clientapi.ClientAPI;
import clientapi.event.defaults.game.render.RenderWorldEvent;
import clientapi.util.math.Vec3;
import clientapi.util.render.Colors;
import me.zero.alpine.listener.Listener;
import net.minecraft.client.renderer.GlStateManager;
import org.lwjgl.BufferUtils;
import org.lwjgl.opengl.Display;
import org.lwjgl.util.glu.GLU;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
import static org.lwjgl.opengl.GL11.*;

/*
 * Copyright 2018 ImpactDevelopment
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package clientapi.util.render.gl;




/**
 * OpenGL utils
 *
 * @author Brady
 * @since 2/20/2017
 */
public final class GLUtils {

    private GLUtils() {}

    private static final FloatBuffer MODELVIEW = BufferUtils.createFloatBuffer(16);
    private static final FloatBuffer PROJECTION = BufferUtils.createFloatBuffer(16);
    private static final IntBuffer VIEWPORT = BufferUtils.createIntBuffer(16);
    private static final FloatBuffer TO_SCREEN_BUFFER = BufferUtils.createFloatBuffer(3);
    private static final FloatBuffer TO_WORLD_BUFFER = BufferUtils.createFloatBuffer(3);

    public static void init() {
        ClientAPI.EVENT_BUS.subscribe(new Listener<RenderWorldEvent>(event -> {