Java Code Examples for com.jogamp.opengl.GL4#glVertexAttribBinding()
The following examples show how to use
com.jogamp.opengl.GL4#glVertexAttribBinding() .
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_430_draw_vertex_attrib_binding.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { 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, Vertex_v2fv2f.SIZE); } gl4.glBindVertexArray(0); return true; }
Example 2
Source File: Gl_430_program_compute_variable_group_size.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { int bindingIndex = 0; gl4.glVertexAttribFormat(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0); gl4.glVertexAttribFormat(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vec2.SIZE); gl4.glVertexAttribBinding(Semantic.Attr.POSITION, bindingIndex); gl4.glVertexAttribBinding(Semantic.Attr.TEXCOORD, bindingIndex); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); gl4.glBindVertexBuffer(bindingIndex, bufferName.get(Buffer.VERTEX), 0, Vertex_v2fv2f.SIZE); gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT)); } gl4.glBindVertexArray(0); return true; }
Example 3
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 4
Source File: Gl_450_query_statistics_arb.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(0, bufferName.get(Buffer.VERTEX), 0, glf.Vertex_v2fv2f.SIZE); } gl4.glBindVertexArray(0); return validated; }
Example 5
Source File: Gl_450_texture_derivative.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 6
Source File: Gl_450_transform_feedback_arb.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(Program.MAX, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(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.get(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 true; }
Example 7
Source File: Gl_450_culling.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { 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(0, bufferName.get(Buffer.VERTEX), 0, glf.Vertex_v2fv2f.SIZE); } gl4.glBindVertexArray(0); return true; }
Example 8
Source File: Gl_440_texture_compressed.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { 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 true; }
Example 9
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 10
Source File: Gl_440_sampler_wrap.java From jogl-samples with MIT License | 6 votes |
private boolean initVertexArray(GL4 gl4) { gl4.glGenVertexArrays(1, vertexArrayName); gl4.glBindVertexArray(vertexArrayName.get(0)); { gl4.glVertexAttribFormat(Semantic.Attr.POSITION, 2, GL_FLOAT, false, 0); gl4.glVertexAttribBinding(Semantic.Attr.POSITION, Semantic.Buffer.STATIC); gl4.glEnableVertexAttribArray(Semantic.Attr.POSITION); gl4.glVertexAttribFormat(Semantic.Attr.TEXCOORD, 2, GL_FLOAT, false, Vec2.SIZE); gl4.glVertexAttribBinding(Semantic.Attr.TEXCOORD, Semantic.Buffer.STATIC); gl4.glEnableVertexAttribArray(Semantic.Attr.TEXCOORD); } gl4.glBindVertexArray(0); return checkError(gl4, "initVertexArray"); }