turning openGL() smoothing off
in
Core Library Questions
•
2 years ago
this is really bugging me out:
i can't turn off the openGL smoothing.... i would like to draw images to screen with the benefit of openGL speed, but with no smoothing. (i like hard edges)
i found that noSmooth(); is no longer operational, and that i should use the hint(DISABLE_OPENGL_2X_SMOOTH); command, but this has no effect on the result.
below is a simple program showing my issues:
- import processing.opengl.*;
- PImage smiley;
- void setup() {
- size(400,400,OPENGL);
- smiley = loadImage("data/smiley.png");
- hint(DISABLE_OPENGL_2X_SMOOTH);
- }
- void draw () {
- image (smiley,200,200,100,100);
- float w = smiley.width*8;
- float h = smiley.height*8;
- noStroke();
- beginShape();
- texture(smiley);
- vertex(0,0,0,0);
- vertex(w,0,smiley.width,0);
- vertex(w,h,smiley.width,smiley.height);
- vertex(0,h,0,smiley.height);
- endShape();
- }
this should give some nice big pixels, no? as you can see i tried both with image command, and using the image as a texture as well.
but the result is smoothed:
here is the smiley, if you want to run the code:
can anyone help me out?
i am on a macbook pro 13" which has a NVIDIA GeForce 9400M graphics card.
thanks!
/j
1