package me.hammerle.snuviengine.api; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL30; public class GLHelper { private static int currentVao = -1; private static int currentVbo = -1; private static int currentTexture = -1; protected static void glBindVertexArray(int vao) { if(vao != currentVao) { currentVao = vao; GL30.glBindVertexArray(vao); } } protected static void glBindBuffer(int vbo) { if(vbo != currentVbo) { currentVbo = vbo; GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo); } } protected static void glBindTexture(int texture) { if(texture != currentTexture) { currentTexture = texture; GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); } } }