GLHelper.java 603 B

12345678910111213141516171819202122232425262728
  1. package me.hammerle.snuviengine.api;
  2. import org.lwjgl.opengl.GL15;
  3. import org.lwjgl.opengl.GL30;
  4. public class GLHelper
  5. {
  6. private static int currentVao = -1;
  7. private static int currentVbo = -1;
  8. protected static void glBindVertexArray(int vao)
  9. {
  10. if(vao != currentVao)
  11. {
  12. currentVao = vao;
  13. GL30.glBindVertexArray(vao);
  14. }
  15. }
  16. protected static void glBindBuffer(int vbo)
  17. {
  18. if(vbo != currentVbo)
  19. {
  20. currentVbo = vbo;
  21. GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
  22. }
  23. }
  24. }