mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 03:41:15 +01:00
Updated OpenGL examples
This commit is contained in:
@@ -40,25 +40,25 @@ void draw() {
|
||||
|
||||
updateGeometry();
|
||||
|
||||
pgl = pg.beginGL();
|
||||
pgl = pg.beginPGL();
|
||||
flatShader.bind();
|
||||
|
||||
vertLoc = pgl.glGetAttribLocation(flatShader.glProgram, "inVertex");
|
||||
colorLoc = pgl.glGetAttribLocation(flatShader.glProgram, "inColor");
|
||||
vertLoc = pgl.getAttribLocation(flatShader.glProgram, "inVertex");
|
||||
colorLoc = pgl.getAttribLocation(flatShader.glProgram, "inColor");
|
||||
|
||||
pgl.glEnableVertexAttribArray(vertLoc);
|
||||
pgl.glEnableVertexAttribArray(colorLoc);
|
||||
pgl.enableVertexAttribArray(vertLoc);
|
||||
pgl.enableVertexAttribArray(colorLoc);
|
||||
|
||||
pgl.glVertexAttribPointer(vertLoc, 4, PGL.GL_FLOAT, false, 0, vertData);
|
||||
pgl.glVertexAttribPointer(colorLoc, 4, PGL.GL_FLOAT, false, 0, colorData);
|
||||
pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, vertData);
|
||||
pgl.vertexAttribPointer(colorLoc, 4, PGL.FLOAT, false, 0, colorData);
|
||||
|
||||
pgl.glDrawArrays(PGL.GL_TRIANGLES, 0, 3);
|
||||
pgl.drawArrays(PGL.TRIANGLES, 0, 3);
|
||||
|
||||
pgl.glDisableVertexAttribArray(vertLoc);
|
||||
pgl.glDisableVertexAttribArray(colorLoc);
|
||||
pgl.disableVertexAttribArray(vertLoc);
|
||||
pgl.disableVertexAttribArray(colorLoc);
|
||||
|
||||
flatShader.unbind();
|
||||
pg.endGL();
|
||||
pg.endPGL();
|
||||
}
|
||||
|
||||
void updateGeometry() {
|
||||
|
||||
7
java/examples/OpenGL/Tests/SpecsTest/SpecsTest.pde
Normal file
7
java/examples/OpenGL/Tests/SpecsTest/SpecsTest.pde
Normal file
@@ -0,0 +1,7 @@
|
||||
size(100, 100, P3D);
|
||||
PGraphicsOpenGL pg = (PGraphicsOpenGL)g;
|
||||
println(pg.OPENGL_VENDOR);
|
||||
println(pg.OPENGL_RENDERER);
|
||||
println(pg.OPENGL_VERSION);
|
||||
println(pg.GLSL_VERSION);
|
||||
println(pg.OPENGL_EXTENSIONS);
|
||||
Reference in New Issue
Block a user