mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Don't clear VAO on each PolygonBatch flush.
This commit is contained in:
parent
be09165723
commit
37c27ca3f9
@ -87,7 +87,6 @@
|
||||
- (void) flush {
|
||||
if (!_verticesCount) return;
|
||||
|
||||
ccGLBindVAO(0);
|
||||
ccGLBindTexture2D(_texture.name);
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||
|
||||
@ -134,6 +134,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0};
|
||||
|
||||
- (void) draw {
|
||||
CC_NODE_DRAW_SETUP();
|
||||
ccGLBindVAO(0);
|
||||
|
||||
ccColor3B nodeColor = self.color;
|
||||
_skeleton->r = nodeColor.r / (float)255;
|
||||
|
||||
@ -88,7 +88,6 @@
|
||||
- (void) flush {
|
||||
if (!_verticesCount) return;
|
||||
|
||||
ccGLBindVAO(0);
|
||||
ccGLBindTexture2D(_texture.name);
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||
|
||||
@ -135,6 +135,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0};
|
||||
|
||||
- (void) draw {
|
||||
CC_NODE_DRAW_SETUP();
|
||||
ccGLBindVAO(0);
|
||||
|
||||
CCColor* nodeColor = self.color;
|
||||
_skeleton->r = nodeColor.red;
|
||||
|
||||
@ -93,7 +93,6 @@ void PolygonBatch::add (CCTexture2D* addTexture,
|
||||
void PolygonBatch::flush () {
|
||||
if (!verticesCount) return;
|
||||
|
||||
ccGLBindVAO(0);
|
||||
ccGLBindTexture2D(texture->getName());
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||
|
||||
@ -136,6 +136,7 @@ void SkeletonRenderer::update (float deltaTime) {
|
||||
|
||||
void SkeletonRenderer::draw () {
|
||||
CC_NODE_DRAW_SETUP();
|
||||
ccGLBindVAO(0);
|
||||
|
||||
ccColor3B nodeColor = getColor();
|
||||
skeleton->r = nodeColor.r / (float)255;
|
||||
|
||||
@ -93,7 +93,6 @@ void PolygonBatch::add (const Texture2D* addTexture,
|
||||
void PolygonBatch::flush () {
|
||||
if (!verticesCount) return;
|
||||
|
||||
GL::bindVAO(0);
|
||||
GL::bindTexture2D(texture->getName());
|
||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
|
||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
|
||||
|
||||
@ -142,6 +142,7 @@ void SkeletonRenderer::draw(Renderer* renderer, const kmMat4& transform, bool tr
|
||||
void SkeletonRenderer::drawSkeleton (const kmMat4& transform, bool transformUpdated) {
|
||||
getShaderProgram()->use();
|
||||
getShaderProgram()->setUniformsForBuiltins(transform);
|
||||
GL::bindVAO(0);
|
||||
|
||||
Color3B nodeColor = getColor();
|
||||
skeleton->r = nodeColor.r / (float)255;
|
||||
|
||||
@ -142,6 +142,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Matrix& transform, bool t
|
||||
void SkeletonRenderer::drawSkeleton (const Matrix &transform, bool transformUpdated) {
|
||||
getGLProgram()->use();
|
||||
getGLProgram()->setUniformsForBuiltins(transform);
|
||||
GL::bindVAO(0);
|
||||
|
||||
Color3B nodeColor = getColor();
|
||||
skeleton->r = nodeColor.r / (float)255;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user