Skip to content

Commit ee02e84

Browse files
authored
Merge pull request #1913 from mlarghydracept/webgl-shape-texture
Immediate mode shapes with texturing
2 parents fcf17b0 + 32e255c commit ee02e84

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/webgl/material.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ p5.prototype.texture = function(){
121121
args[i] = arguments[i];
122122
}
123123
var gl = this._renderer.GL;
124+
this._renderer.drawMode = 'texture';
124125
var shaderProgram = this._renderer._getShader('lightVert',
125126
'lightTextureFrag');
126127
gl.useProgram(shaderProgram);

src/webgl/p5.RendererGL.Immediate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function(mode, isCurve, isBezier,isQuadratic, isContour, shapeKind){
7676
this.immediateMode.vertexPositions,
7777
this.immediateMode.vertexColors);
7878
if(mode){
79-
if(this.drawMode === 'fill'){
79+
if(this.drawMode === 'fill' || this.drawMode ==='texture'){
8080
switch(this.immediateMode.shapeMode){
8181
case constants.LINE_STRIP:
8282
this.immediateMode.shapeMode = constants.TRIANGLE_FAN;

0 commit comments

Comments
 (0)