mirror of https://github.com/axmolengine/axmol.git
Merge pull request #10278 from huangshiwu/v3_fixbug
add glBindBuffer for drawnode and clippingnode to avoid crash
This commit is contained in:
commit
0ac7fca9f0
|
@ -219,6 +219,7 @@ void ClippingNode::drawFullScreenQuadClearStencil()
|
||||||
glProgram->setUniformsForBuiltins();
|
glProgram->setUniformsForBuiltins();
|
||||||
glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1);
|
glProgram->setUniformLocationWith4fv(colorLocation, (GLfloat*) &color.r, 1);
|
||||||
|
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );
|
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION );
|
||||||
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
|
|
@ -274,6 +274,8 @@ bool DrawNode::init()
|
||||||
glGenBuffers(1, &_vboGLPoint);
|
glGenBuffers(1, &_vboGLPoint);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
|
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
|
||||||
|
|
||||||
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK_GL_ERROR_DEBUG();
|
CHECK_GL_ERROR_DEBUG();
|
||||||
|
|
Loading…
Reference in New Issue