Java Code Examples for com.jogamp.opengl.GL4#glGenVertexArrays()
The following examples show how to use
com.jogamp.opengl.GL4#glGenVertexArrays() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_420_draw_base_instance.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { boolean validated = true; gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.POSITION)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0); gl4.glVertexAttribDivisor(Semantic.Attr.POSITION, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.COLOR)); gl4.glVertexAttribPointer(Semantic.Attr.COLOR, 4, GL_FLOAT, false, 0, 0); gl4.glVertexAttribDivisor(Semantic.Attr.COLOR, 1); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR); } gl4.glBindVertexArray(0); return validated; }
Example 2
Source File: Gl_450_clip_control.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { boolean validated = true; gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glVertexAttribBinding(Semantic.Attr.POSITION, Semantic.Buffer.STATIC); gl4.glVertexAttribFormat(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0); gl4.glVertexAttribBinding(Semantic.Attr.TEXCOORD, Semantic.Buffer.STATIC); gl4.glVertexAttribFormat(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vec2.SIZE); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); gl4.glBindVertexBuffer(Semantic.Buffer.STATIC, bufferName.get(Buffer.VERTEX), 0, glf.Vertex_v2fv2f.SIZE); } gl4.glBindVertexArray(0); return validated; }
Example 3
Source File: Gl_410_program_separate.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, Vec2.SIZE); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 4
Source File: Gl_440_transform_feedback.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(Program.MAX, vertexArrayName, 0); gl4.glBindVertexArray(vertexArrayName[Program.TRANSFORM]); { gl4.glVertexAttribFormat(Semantic.Attr.POSITION, 4, GL_FLOAT, false, 0); gl4.glVertexAttribBinding(Semantic.Attr.POSITION, Semantic.Buffer.STATIC); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); gl4.glBindVertexArray(vertexArrayName[Program.FEEDBACK]); { gl4.glVertexAttribFormat(Semantic.Attr.POSITION, 4, GL_FLOAT, false, 0); gl4.glVertexAttribBinding(Semantic.Attr.POSITION, Semantic.Buffer.STATIC); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glVertexAttribFormat(Semantic.Attr.COLOR, 4, GL_FLOAT, false, Vec4.SIZE); gl4.glVertexAttribBinding(Semantic.Attr.COLOR, Semantic.Buffer.STATIC); gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 5
Source File: Gl_420_image_unpack.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, Vec2.SIZE); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); } gl4.glBindVertexArray(0); return true; }
Example 6
Source File: Gl_420_picking.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, Vec2.SIZE); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); } gl4.glBindVertexArray(0); return true; }
Example 7
Source File: Gl_440_fbo_depth_stencil.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(Program.MAX, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(Program.TEXTURE)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vertex_v2fv2f.SIZE, Vec2.SIZE); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); } gl4.glBindVertexArray(0); gl4.glBindVertexArray(vertexArrayName.get(Program.SPLASH)); gl4.glBindVertexArray(0); return true; }
Example 8
Source File: Gl_410_primitive_tessellation2.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, arrayBufferName.get(0)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vertex_v2fc4f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.COLOR, 4, GL_FLOAT, false, Vertex_v2fc4f.SIZE, Vec2.SIZE); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 9
Source File: Gl_430_program_compute.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); } gl4.glBindVertexArray(0); return true; }
Example 10
Source File: Gl_320_draw_instanced.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 11
Source File: Gl_500_glsl_vote_arb.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); } gl4.glBindVertexArray(0); return true; }
Example 12
Source File: Gl_400_fbo_rtt.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 13
Source File: Gl_430_query_conditional.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 14
Source File: Gl_450_query_conditional.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); return true; }
Example 15
Source File: Gl_420_interface_matching.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(0)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION + 0, 2, GL_FLOAT, false, Vertex_v2fc4f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.POSITION + 1, 2, GL_FLOAT, false, Vertex_v2fc4f.SIZE, 0); gl4.glVertexAttribPointer(Semantic.Attr.COLOR, 4, GL_FLOAT, false, (2 + 4) * Float.BYTES, 2 * Float.BYTES); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION + 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION + 1); gl4.glEnableVertexAttribArray(Semantic.Attr.COLOR); } gl4.glBindVertexArray(0); VertexAttrib[] valid = new VertexAttrib[16]; for (int i = 0; i < valid.length; i++) { valid[i] = new VertexAttrib(); } valid[Semantic.Attr.POSITION + 0] = new VertexAttrib(GL_TRUE, 0, 2, Vertex_v2fc4f.SIZE, GL_FLOAT, false, GL_FALSE, GL_FALSE, 0, 0); valid[Semantic.Attr.POSITION + 1] = new VertexAttrib(GL_TRUE, 0, 2, Vertex_v2fc4f.SIZE, GL_FLOAT, false, GL_FALSE, GL_FALSE, 0, 0); valid[Semantic.Attr.COLOR] = new VertexAttrib(GL_TRUE, 0, 4, Vertex_v2fc4f.SIZE, GL_FLOAT, false, GL_FALSE, GL_FALSE, 0, Vec2.SIZE); validate(gl4, vertexArrayName.get(0), valid); return true; }
Example 16
Source File: Gl_500_texture_cube_arb.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vec2.SIZE, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); return true; }
Example 17
Source File: Gl_400_texture_cube.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vec2.SIZE, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); return true; }
Example 18
Source File: Gl_400_primitive_instanced.java From jogl-samples with MIT License | 5 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0, 0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }
Example 19
Source File: Gl_440_buffer_type.java From jogl-samples with MIT License | 4 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(VertexFormat.MAX, vertexArrayName); gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX)); int currentOffset = 0; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.F32)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_FLOAT, false, Vec2.SIZE, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); currentOffset += positionSizeF32; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.I8)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_BYTE, false, Vec2i8.SIZE, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); currentOffset += positionSizeI8; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.I32)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_INT, false, Vec2i.SIZE, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); currentOffset += positionSizeI32; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.RGB10A2)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 4, GL_INT_2_10_10_10_REV, true, Integer.BYTES, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); currentOffset += positionSizeRGB10A2; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.F16)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 2, GL_HALF_FLOAT, false, Short.BYTES * 2, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); currentOffset += positionSizeF16; gl4.glBindVertexArray(vertexArrayName.get(VertexFormat.RG11B10F)); gl4.glVertexAttribPointer(Semantic.Attr.POSITION, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, false, Integer.BYTES, currentOffset); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glBindVertexArray(0); gl4.glBindBuffer(GL_ARRAY_BUFFER, 0); return checkError(gl4, "initVertexArray"); }
Example 20
Source File: GLUtil.java From runelite with BSD 2-Clause "Simplified" License | 4 votes |
static int glGenVertexArrays(GL4 gl) { gl.glGenVertexArrays(1, buf, 0); return buf[0]; }