title: No context is current or a function that is not available in the current context when trying to load voa
body: <p>source: </p>
  
  <pre><code>import java.nio.FloatBuffer;
  import java.util.ArrayList;
  import java.util.List;
  
  import org.lwjgl.BufferUtils;
  import org.lwjgl.opengl.GL11;
  import org.lwjgl.opengl.GL15;
  import org.lwjgl.opengl.GL20;
  import org.lwjgl.opengl.GL30;
  
  public class Loader {
      private List&lt;Integer&gt; vaos = new ArrayList&lt;Integer&gt;();
      private List&lt;Integer&gt; vbos = new ArrayList&lt;Integer&gt;();
  
      public RawModel loadToVAO(float[] positions) {
          int vaoID = createVAO();
          storeDataInAttributeList(0,positions);
          unbindVAO();
          return new RawModel(vaoID,positions.length/3);
      }
  
      public void cleanUP() {
          for(int vao:vaos) {
              GL30.glDeleteVertexArrays(vao);
          }
          for(int vbo:vbos) {
              GL30.glDeleteVertexArrays(vbo);
          }
      }
  
      private int createVAO() {
          int vaoID = GL30.glGenVertexArrays();
          vaos.add(vaoID);
          GL30.glBindVertexArray(vaoID);
          return vaoID;
      }
  
      private void storeDataInAttributeList(int attributeNumber,float[] data) {
          int vaoID = GL15.glGenBuffers();
          vbos.add(vaoID);
          GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vaoID);
          FloatBuffer buffer = storeDataImFloatBuffer(data);
          GL15.glBufferData(GL15.GL_ARRAY_BUFFER, buffer, GL15.GL_STATIC_DRAW);
          GL20.glVertexAttribPointer(attributeNumber, 3, GL11.GL_FLOAT, false, 0, 0);
          GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
  
      }
      private void unbindVAO(){
          GL30.glBindVertexArray(0);
      }
  
      private FloatBuffer storeDataImFloatBuffer(float[] data) {
          FloatBuffer buffer = BufferUtils.createFloatBuffer(data.length);
          buffer.put(data);
          buffer.flip();
          return buffer;
      }
  }
  </code></pre>
  
  <p>error: </p>
  
  <pre><code>FATAL ERROR in native method: Thread[main,5,main]: No context is current or a function that is not available in the current context was called.
   The JVM will abort execution.
   at org.lwjgl.opengl.GL30C.nglGenVertexArrays(Native Method) 
   at org.lwjgl.opengl.GL30C.glGenVertexArrays(GL30C.java:2420) 
   at org.lwjgl.opengl.GL30.glGenVertexArrays(GL30.java:2369) at Loader.createVAO(Loader.java:32) 
   at Loader.loadToVAO(Loader.java:16) at MainGameLoop.main(MainGameLoop.java:21)
  </code></pre>