Example usage for org.lwjgl.opengl GL15 glGenBuffers

List of usage examples for org.lwjgl.opengl GL15 glGenBuffers

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL15 glGenBuffers.

Prototype

public static void glGenBuffers(@NativeType("GLuint *") int[] buffers) 

Source Link

Document

Array version of: #glGenBuffers GenBuffers

Usage

From source file:com.badlogic.gdx.backends.jglfw.JglfwGL20.java

License:Apache License

public void glGenBuffers(int n, IntBuffer buffers) {
    GL15.glGenBuffers(buffers);
}

From source file:com.dinasgames.engine.graphics.GL.java

public static int createVBOID() {
    if (version < 15) {
        return -1;
    }//from w w  w . java  2s  .  c o m
    IntBuffer buffer = BufferUtils.createIntBuffer(1);
    GL15.glGenBuffers(buffer);
    return buffer.get(0);
}

From source file:com.github.begla.blockmania.rendering.manager.VertexBufferObjectManager.java

License:Apache License

private IntBuffer createVbos(int size) {
    IntBuffer buffer = BufferUtils.createIntBuffer(size);
    GL15.glGenBuffers(buffer);
    return buffer;
}

From source file:com.rvantwisk.cnctools.opengl.VBOHelper.java

License:Open Source License

/**
 * Cretae a VBO array with//from w  w w .ja  va  2s  . co  m
 *
 * @param data Array of float
 * @param i    Number of rows
 * @param b    set if it has it's own color
 * @return
 */
public static VBOHelper createLines(final float[] data, int i, boolean b) {
    VBOHelper vbo = new GLLines();
    vbo.vbRows = i;
    vbo.hasOwnColor = b;
    vbo.data = data;

    IntBuffer buffer = BufferUtils.createIntBuffer(1);
    GL15.glGenBuffers(buffer);
    vbo.vbID = buffer.get(0);

    FloatBuffer vertex_buffer_data = BufferUtils.createFloatBuffer(vbo.data.length);
    vertex_buffer_data.put(vbo.data);
    vertex_buffer_data.rewind();

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo.vbID);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vertex_buffer_data, GL15.GL_STATIC_DRAW);
    vbo.data = null;

    return vbo;
}

From source file:com.rvantwisk.cnctools.opengl.VBOHelper.java

License:Open Source License

public static VBOHelper createTriangles(final float[] data, int i, boolean b) {
    VBOHelper vbo = new GLTriangles();
    vbo.vbRows = i;/*from   w  w  w .  j a  v  a 2  s .  c o  m*/
    vbo.hasOwnColor = b;
    vbo.data = data;

    IntBuffer buffer = BufferUtils.createIntBuffer(1);
    GL15.glGenBuffers(buffer);
    vbo.vbID = buffer.get(0);

    FloatBuffer vertex_buffer_data = BufferUtils.createFloatBuffer(vbo.data.length);
    vertex_buffer_data.put(vbo.data);
    vertex_buffer_data.rewind();

    GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo.vbID);
    GL15.glBufferData(GL15.GL_ARRAY_BUFFER, vertex_buffer_data, GL15.GL_STATIC_DRAW);
    vbo.data = null;

    return vbo;
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static void glGenBuffers(int n, IntBuffer buffers) {
    GL15.glGenBuffers(buffers);
}

From source file:ion2d.INTextureAtlas.java

License:Open Source License

/**
 * Creates a texture atlas from the specified texture
 * @param INTexture2D texture//from   w  w w.  j a v a 2s . c  om
 * @param int capacity
 */
public INTextureAtlas(INTexture2D texture, int capacity) {
    this.quads = new ArrayList<QuadTexture3F>(capacity);
    this.texture = texture;
    this.capacity = capacity;
    this.totalQuads = 0;
    this.totalVisible = 0;
    this.lastTotalVisible = 0;

    this.vboBuffers = BufferUtils.createIntBuffer(2);
    GL15.glGenBuffers(this.vboBuffers);

    this.initIndices();
}

From source file:net.neilcsmith.praxis.video.opengl.internal.IndexBufferObject.java

License:Apache License

private int createBufferObject() {

    GL15.glGenBuffers(tmpHandle);
    return tmpHandle.get(0);

}

From source file:net.neilcsmith.praxis.video.opengl.internal.VertexBufferObject.java

License:Apache License

private int createBufferObject() {
    GL15.glGenBuffers(tmpHandle);
    return tmpHandle.get(0);
}

From source file:org.jogamp.glg2d.GLG2DUtils.java

License:Apache License

public static int genBufferId() {
    IntBuffer ids = BufferUtils.createIntBuffer(1);
    GL15.glGenBuffers(ids);
    return ids.get(0);
}