kind parameter in shader(shader, kind) overrides shader type specified

by #define or autodetection using uniforms.
This commit is contained in:
codeanticode
2014-06-14 18:43:12 -04:00
parent 32e3c6854f
commit 23744dc031

View File

@@ -6680,9 +6680,13 @@ public class PGraphicsOpenGL extends PGraphics {
@Override
// TODO: deprecate this method, the kind arguments is not used anymore
public void shader(PShader shader, int kind) {
shader(shader);
flush(); // Flushing geometry drawn with a different shader.
if (kind == TRIANGLES) polyShader = shader;
else if (kind == LINES) lineShader = shader;
else if (kind == POINTS) pointShader = shader;
else PGraphics.showWarning(UNKNOWN_SHADER_KIND_ERROR);
}