Package k8.buffer

Source Code of k8.buffer.VerticesBuffer

package k8.buffer;

import k8.buffer.var.VARVerticesBuffer;
import k8.buffer.vbo.VBOVerticesBuffer;

import org.lwjgl.opengl.GLContext;


public abstract class VerticesBuffer extends Buffer {
 
    /**
     * Creates an instance of VerticesBuffer.
     *
     * @param initialcapacity
     *          Initial capacity (number of vertices)
     */
    public VerticesBuffer(int initialcapacity) {
        super(3*initialcapacity);
    }
   
    /**
     * Gets an instance of VerticesBuffer.
     *
     * @param initialcapacity
     *          Initial capacity (number of vertices)
     */
    public static VerticesBuffer getInstance(int initialcapacity) {
        return ( GLContext.getCapabilities().GL_ARB_vertex_buffer_object ) ? new VBOVerticesBuffer(initialcapacity) : new VARVerticesBuffer(initialcapacity);
    }
   
    /** Gets a Slice of this buffer */
    public Slice getSlice() {
      return getSlice(36);
    }
   
    /** Tells OpenGL this buffer contains the vertices */
    public abstract void glVertexPointer();

}
TOP

Related Classes of k8.buffer.VerticesBuffer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.