GLGraphics Texturing Question
in
Contributed Library Questions
•
2 years ago
How would I do an example similar to
this with the GLGraphics library?
- size(100, 100, P3D);
- noStroke();
- PImage a = loadImage("arch.jpg");
- beginShape();
- texture(a);
- vertex(10, 20, 0, 0);
- vertex(80, 5, 100, 0);
- vertex(95, 90, 100, 100);
- vertex(40, 95, 0, 100);
- endShape();
I didn't see any examples of drawing shapes. Is it just straight GL calls?
- PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
- GL gl = pgl.beginGL();
- gl.glBegin(QUADS);
- gl.glVertex2f(0.0f, 0.0f);
- gl.glVertex2f(1.0f, 0.0f);
- gl.glVertex2f(1.0f, 1.0f);
- gl.glVertex2f(0.0f, 1.0f);
- gl.glEnd();
- pgl.endGL();
and then finally binding a texture:
- GLTexture tex;
- gl.glBindTexture(gl.GL_TEXTURE_2D, tex.getTextureID());
???
1