mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Removing the group of OpenGL examples
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
// Draws a triangle using low-level OpenGL calls.
|
||||
import java.nio.*;
|
||||
|
||||
PGraphicsOpenGL pg;
|
||||
PGL pgl;
|
||||
|
||||
PShader flatShader;
|
||||
|
||||
int vertLoc;
|
||||
@@ -18,8 +16,6 @@ FloatBuffer colorData;
|
||||
void setup() {
|
||||
size(640, 360, P3D);
|
||||
|
||||
pg = (PGraphicsOpenGL)g;
|
||||
|
||||
// Loads a shader to render geometry w/out
|
||||
// textures and lights.
|
||||
flatShader = loadShader("frag.glsl", "vert.glsl");
|
||||
@@ -36,11 +32,11 @@ void draw() {
|
||||
|
||||
// The geometric transformations will be automatically passed
|
||||
// to the shader.
|
||||
rotate(frameCount * 0.01f, width, height, 0);
|
||||
rotate(frameCount * 0.01, width, height, 0);
|
||||
|
||||
updateGeometry();
|
||||
|
||||
pgl = pg.beginPGL();
|
||||
pgl = beginPGL();
|
||||
flatShader.bind();
|
||||
|
||||
vertLoc = pgl.getAttribLocation(flatShader.glProgram, "inVertex");
|
||||
@@ -58,7 +54,8 @@ void draw() {
|
||||
pgl.disableVertexAttribArray(colorLoc);
|
||||
|
||||
flatShader.unbind();
|
||||
pg.endPGL();
|
||||
|
||||
endPGL();
|
||||
}
|
||||
|
||||
void updateGeometry() {
|
||||
|
||||
Reference in New Issue
Block a user