@@ -36,60 +36,6 @@ if (cc.ENABLE_GL_STATE_CACHE) {
36
36
cc . _GLServerState = 0 ;
37
37
if ( cc . TEXTURE_ATLAS_USE_VAO )
38
38
cc . _uVAO = 0 ;
39
-
40
- var _currBuffers = { } ;
41
-
42
- WebGLRenderingContext . prototype . glBindBuffer = WebGLRenderingContext . prototype . bindBuffer ;
43
- WebGLRenderingContext . prototype . bindBuffer = function ( target , buffer ) {
44
- if ( _currBuffers [ target ] !== buffer ) {
45
- this . glBindBuffer ( target , buffer ) ;
46
- _currBuffers [ target ] = buffer ;
47
- }
48
- } ;
49
-
50
- WebGLRenderingContext . prototype . glEnableVertexAttribArray = WebGLRenderingContext . prototype . enableVertexAttribArray ;
51
- WebGLRenderingContext . prototype . enableVertexAttribArray = function ( index ) {
52
- if ( index === cc . VERTEX_ATTRIB_FLAG_POSITION ) {
53
- if ( ! this . _vertexAttribPosition ) {
54
- this . glEnableVertexAttribArray ( index ) ;
55
- this . _vertexAttribPosition = true ;
56
- }
57
- }
58
- else if ( index === cc . VERTEX_ATTRIB_FLAG_COLOR ) {
59
- if ( ! this . _vertexAttribColor ) {
60
- this . glEnableVertexAttribArray ( index ) ;
61
- this . _vertexAttribColor = true ;
62
- }
63
- }
64
- else if ( index === cc . VERTEX_ATTRIB_FLAG_TEX_COORDS ) {
65
- if ( ! this . _vertexAttribTexCoords ) {
66
- this . glEnableVertexAttribArray ( index ) ;
67
- this . _vertexAttribTexCoords = true ;
68
- }
69
- }
70
- else {
71
- this . glEnableVertexAttribArray ( index ) ;
72
- }
73
- } ;
74
-
75
- WebGLRenderingContext . prototype . glDisableVertexAttribArray = WebGLRenderingContext . prototype . disableVertexAttribArray ;
76
- WebGLRenderingContext . prototype . disableVertexAttribArray = function ( index ) {
77
- if ( index === cc . VERTEX_ATTRIB_FLAG_COLOR ) {
78
- if ( this . _vertexAttribColor ) {
79
- this . glDisableVertexAttribArray ( index ) ;
80
- this . _vertexAttribColor = false ;
81
- }
82
- }
83
- else if ( index === cc . VERTEX_ATTRIB_FLAG_TEX_COORDS ) {
84
- if ( this . _vertexAttribTexCoords ) {
85
- this . glDisableVertexAttribArray ( index ) ;
86
- this . _vertexAttribTexCoords = false ;
87
- }
88
- }
89
- else if ( index !== 0 ) {
90
- this . glDisableVertexAttribArray ( index ) ;
91
- }
92
- } ;
93
39
}
94
40
95
41
// GL State Cache functions
0 commit comments