Skip to content

Commit

Permalink
Closed cocos2d#3175: it has been fixed that cocos2d-html5 doesn't wor…
Browse files Browse the repository at this point in the history
…k on Chrome 31 WebGL mode
  • Loading branch information
dingpinglv committed Nov 13, 2013
1 parent ad1d0b4 commit 2f64937
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cocos2d/shaders/CCGLProgram.js
Expand Up @@ -258,9 +258,8 @@ cc.GLProgram = cc.Class.extend({
if (!source || !shader)
return false;

var preStr = (type == this._glContext.VERTEX_SHADER) ? "precision highp float;\n" : "precision mediump float;\n";

source = preStr
//var preStr = (type == this._glContext.VERTEX_SHADER) ? "precision highp float;\n" : "precision mediump float;\n";
source = "precision highp float; \n"
+ "uniform mat4 CC_PMatrix; \n"
+ "uniform mat4 CC_MVMatrix; \n"
+ "uniform mat4 CC_MVPMatrix; \n"
Expand Down Expand Up @@ -407,7 +406,7 @@ cc.GLProgram = cc.Class.extend({
if (cc.COCOS2D_DEBUG) {
var status = this._glContext.getProgramParameter(this._programObj, this._glContext.LINK_STATUS);
if (!status) {
cc.log("cocos2d: ERROR: Failed to link program: " + this._programObj);
cc.log("cocos2d: ERROR: Failed to link program: " + this._glContext.getProgramInfoLog(this._programObj));
cc.glDeleteProgram(this._programObj);
this._programObj = null;
return false;
Expand Down

0 comments on commit 2f64937

Please sign in to comment.