mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-08 11:46:53 +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 {
|
- (void) flush {
|
||||||
if (!_verticesCount) return;
|
if (!_verticesCount) return;
|
||||||
|
|
||||||
ccGLBindVAO(0);
|
|
||||||
ccGLBindTexture2D(_texture.name);
|
ccGLBindTexture2D(_texture.name);
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||||
|
|||||||
@ -134,6 +134,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0};
|
|||||||
|
|
||||||
- (void) draw {
|
- (void) draw {
|
||||||
CC_NODE_DRAW_SETUP();
|
CC_NODE_DRAW_SETUP();
|
||||||
|
ccGLBindVAO(0);
|
||||||
|
|
||||||
ccColor3B nodeColor = self.color;
|
ccColor3B nodeColor = self.color;
|
||||||
_skeleton->r = nodeColor.r / (float)255;
|
_skeleton->r = nodeColor.r / (float)255;
|
||||||
|
|||||||
@ -88,7 +88,6 @@
|
|||||||
- (void) flush {
|
- (void) flush {
|
||||||
if (!_verticesCount) return;
|
if (!_verticesCount) return;
|
||||||
|
|
||||||
ccGLBindVAO(0);
|
|
||||||
ccGLBindTexture2D(_texture.name);
|
ccGLBindTexture2D(_texture.name);
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||||
|
|||||||
@ -135,6 +135,7 @@ static const int quadTriangles[6] = {0, 1, 2, 2, 3, 0};
|
|||||||
|
|
||||||
- (void) draw {
|
- (void) draw {
|
||||||
CC_NODE_DRAW_SETUP();
|
CC_NODE_DRAW_SETUP();
|
||||||
|
ccGLBindVAO(0);
|
||||||
|
|
||||||
CCColor* nodeColor = self.color;
|
CCColor* nodeColor = self.color;
|
||||||
_skeleton->r = nodeColor.red;
|
_skeleton->r = nodeColor.red;
|
||||||
|
|||||||
@ -93,7 +93,6 @@ void PolygonBatch::add (CCTexture2D* addTexture,
|
|||||||
void PolygonBatch::flush () {
|
void PolygonBatch::flush () {
|
||||||
if (!verticesCount) return;
|
if (!verticesCount) return;
|
||||||
|
|
||||||
ccGLBindVAO(0);
|
|
||||||
ccGLBindTexture2D(texture->getName());
|
ccGLBindTexture2D(texture->getName());
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
glEnableVertexAttribArray(kCCVertexAttrib_Position);
|
||||||
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
glEnableVertexAttribArray(kCCVertexAttrib_Color);
|
||||||
|
|||||||
@ -136,6 +136,7 @@ void SkeletonRenderer::update (float deltaTime) {
|
|||||||
|
|
||||||
void SkeletonRenderer::draw () {
|
void SkeletonRenderer::draw () {
|
||||||
CC_NODE_DRAW_SETUP();
|
CC_NODE_DRAW_SETUP();
|
||||||
|
ccGLBindVAO(0);
|
||||||
|
|
||||||
ccColor3B nodeColor = getColor();
|
ccColor3B nodeColor = getColor();
|
||||||
skeleton->r = nodeColor.r / (float)255;
|
skeleton->r = nodeColor.r / (float)255;
|
||||||
|
|||||||
@ -93,7 +93,6 @@ void PolygonBatch::add (const Texture2D* addTexture,
|
|||||||
void PolygonBatch::flush () {
|
void PolygonBatch::flush () {
|
||||||
if (!verticesCount) return;
|
if (!verticesCount) return;
|
||||||
|
|
||||||
GL::bindVAO(0);
|
|
||||||
GL::bindTexture2D(texture->getName());
|
GL::bindTexture2D(texture->getName());
|
||||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
|
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
|
||||||
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
|
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) {
|
void SkeletonRenderer::drawSkeleton (const kmMat4& transform, bool transformUpdated) {
|
||||||
getShaderProgram()->use();
|
getShaderProgram()->use();
|
||||||
getShaderProgram()->setUniformsForBuiltins(transform);
|
getShaderProgram()->setUniformsForBuiltins(transform);
|
||||||
|
GL::bindVAO(0);
|
||||||
|
|
||||||
Color3B nodeColor = getColor();
|
Color3B nodeColor = getColor();
|
||||||
skeleton->r = nodeColor.r / (float)255;
|
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) {
|
void SkeletonRenderer::drawSkeleton (const Matrix &transform, bool transformUpdated) {
|
||||||
getGLProgram()->use();
|
getGLProgram()->use();
|
||||||
getGLProgram()->setUniformsForBuiltins(transform);
|
getGLProgram()->setUniformsForBuiltins(transform);
|
||||||
|
GL::bindVAO(0);
|
||||||
|
|
||||||
Color3B nodeColor = getColor();
|
Color3B nodeColor = getColor();
|
||||||
skeleton->r = nodeColor.r / (float)255;
|
skeleton->r = nodeColor.r / (float)255;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user