Texture coords and repat clamp in V2.0a6
in
Core Library Questions
•
1 year ago
I have found the following way to enable texture repeats.
Is directly accessing g (line 7) an acceptable way of doing this (the website used to discourage this) or is there a function (in 2.0a6) to control texture repeating and clamping?
Is directly accessing g (line 7) an acceptable way of doing this (the website used to discourage this) or is there a function (in 2.0a6) to control texture repeating and clamping?
- PImage img;
- void setup(){
- size(400,400, OPENGL);
- img = loadImage("picture.jpg");
- textureMode(NORMAL);
- ((PGraphicsOpenGL)g).textureWrap = Texture.REPEAT;
- }
- void draw(){
- background(0);
- beginShape(QUADS);
- texture(img);
- vertex(0,0,0,0);
- vertex(0,400,0,2.5);
- vertex(400,400,2.5,2.5);
- vertex(400,0,2.5,0);
- endShape();
- }
1