From e699a3b765bce5c1a870dd654f7a0002770c59b9 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Thu, 5 Dec 2013 19:04:01 -0800 Subject: [PATCH] Uses MV in Quad Command --- .../project.pbxproj.REMOVED.git-id | 2 +- cocos/2d/CCAtlasNode.h | 2 +- cocos/2d/CCDirector.cpp | 8 +-- cocos/2d/CCGLProgram.cpp | 13 ++-- cocos/2d/CCGLProgram.h | 1 + cocos/2d/CCLabelAtlas.cpp | 5 +- cocos/2d/CCParticleSystemQuad.cpp | 59 ++++++++-------- cocos/2d/CCSprite.cpp | 8 ++- cocos/2d/renderer/CCNewLabelAtlas.cpp | 68 +++++++++++++++++++ cocos/2d/renderer/CCNewLabelAtlas.h | 52 ++++++++++++++ cocos/2d/renderer/CCNewSprite.cpp | 6 +- cocos/2d/renderer/CCNewSpriteBatchNode.cpp | 7 +- cocos/2d/renderer/QuadCommand.cpp | 53 ++++++++++++++- cocos/2d/renderer/QuadCommand.h | 8 ++- 14 files changed, 240 insertions(+), 52 deletions(-) create mode 100644 cocos/2d/renderer/CCNewLabelAtlas.cpp create mode 100644 cocos/2d/renderer/CCNewLabelAtlas.h diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 0be606068f..8f468680fe 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -b266b35a737f7500465360bf16cb73ce109762e2 \ No newline at end of file +9bfb5237a1dfb299a770a4f5a9b81d5b63e5a3a4 \ No newline at end of file diff --git a/cocos/2d/CCAtlasNode.h b/cocos/2d/CCAtlasNode.h index b196f45a1d..0516c004e0 100644 --- a/cocos/2d/CCAtlasNode.h +++ b/cocos/2d/CCAtlasNode.h @@ -98,7 +98,7 @@ protected: bool initWithTileFile(const std::string& tile, long tileWidth, long tileHeight, long itemsToRender); /** initializes an AtlasNode with a texture the width and height of each item measured in points and the quantity of items to render*/ - bool initWithTexture(Texture2D* texture, long tileWidth, long tileHeight, long itemsToRender); + virtual bool initWithTexture(Texture2D* texture, long tileWidth, long tileHeight, long itemsToRender); void calculateMaxItems(); void updateBlendFunc(); diff --git a/cocos/2d/CCDirector.cpp b/cocos/2d/CCDirector.cpp index e232a55039..5d3387b1b9 100644 --- a/cocos/2d/CCDirector.cpp +++ b/cocos/2d/CCDirector.cpp @@ -45,7 +45,7 @@ THE SOFTWARE. #include "platform/CCFileUtils.h" #include "CCApplication.h" #include "CCLabelBMFont.h" -#include "CCLabelAtlas.h" +#include "CCNewLabelAtlas.h" #include "CCActionManager.h" #include "CCAnimationCache.h" #include "CCTouch.h" @@ -926,17 +926,17 @@ void Director::createStatsLabel() */ float factor = EGLView::getInstance()->getDesignResolutionSize().height / 320.0f; - _FPSLabel = new LabelAtlas(); + _FPSLabel = new NewLabelAtlas; _FPSLabel->setIgnoreContentScaleFactor(true); _FPSLabel->initWithString("00.0", texture, 12, 32 , '.'); _FPSLabel->setScale(factor); - _SPFLabel = new LabelAtlas(); + _SPFLabel = new NewLabelAtlas; _SPFLabel->setIgnoreContentScaleFactor(true); _SPFLabel->initWithString("0.000", texture, 12, 32, '.'); _SPFLabel->setScale(factor); - _drawsLabel = new LabelAtlas(); + _drawsLabel = new NewLabelAtlas; _drawsLabel->setIgnoreContentScaleFactor(true); _drawsLabel->initWithString("000", texture, 12, 32, '.'); _drawsLabel->setScale(factor); diff --git a/cocos/2d/CCGLProgram.cpp b/cocos/2d/CCGLProgram.cpp index 81afbdc09f..5c6ab07e30 100644 --- a/cocos/2d/CCGLProgram.cpp +++ b/cocos/2d/CCGLProgram.cpp @@ -234,8 +234,9 @@ void GLProgram::updateUniforms() _uniforms[UNIFORM_SAMPLER] = glGetUniformLocation(_program, UNIFORM_NAME_SAMPLER); + _flags.usesP = _uniforms[UNIFORM_P_MATRIX] != -1; + _flags.usesMV = _uniforms[UNIFORM_MV_MATRIX] != -1; _flags.usesMVP = _uniforms[UNIFORM_MVP_MATRIX] != -1; - _flags.usesMV = (_uniforms[UNIFORM_MV_MATRIX] != -1 && _uniforms[UNIFORM_P_MATRIX] != -1 ); _flags.usesTime = ( _uniforms[UNIFORM_TIME] != -1 || _uniforms[UNIFORM_SIN_TIME] != -1 || @@ -553,16 +554,18 @@ void GLProgram::setUniformsForBuiltins() kmGLGetMatrix(KM_GL_MODELVIEW, &matrixMV); + if(_flags.usesP) + setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MVP_MATRIX], matrixP.mat, 1); + + if(_flags.usesMV) + setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MV_MATRIX], matrixMV.mat, 1); + if(_flags.usesMVP) { kmMat4 matrixMVP; kmMat4Multiply(&matrixMVP, &matrixP, &matrixMV); setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MVP_MATRIX], matrixMVP.mat, 1); } - if(_flags.usesMV) { - setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_P_MATRIX], matrixP.mat, 1); - setUniformLocationWithMatrix4fv(_uniforms[UNIFORM_MV_MATRIX], matrixMV.mat, 1); - } if(_flags.usesTime) { Director *director = Director::getInstance(); diff --git a/cocos/2d/CCGLProgram.h b/cocos/2d/CCGLProgram.h index 2d66baf3bb..d96edd474a 100644 --- a/cocos/2d/CCGLProgram.h +++ b/cocos/2d/CCGLProgram.h @@ -255,6 +255,7 @@ private: unsigned int usesTime:1; unsigned int usesMVP:1; unsigned int usesMV:1; + unsigned int usesP:1; unsigned int usesRandom:1; // handy way to initialize the bitfield diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 4c64ca3418..b6aa433ef6 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -62,7 +62,7 @@ bool LabelAtlas::initWithString(const std::string& string, const std::string& ch bool LabelAtlas::initWithString(const std::string& string, Texture2D* texture, long itemWidth, long itemHeight, long startCharMap) { - if (AtlasNode::initWithTexture(texture, itemWidth, itemHeight, string.size())) + if (initWithTexture(texture, itemWidth, itemHeight, string.size())) { _mapStartChar = startCharMap; this->setString(string); @@ -169,7 +169,8 @@ void LabelAtlas::updateAtlasValues() quads[i].tr.vertices.x = (float)(i * _itemWidth + _itemWidth); quads[i].tr.vertices.y = (float)(_itemHeight); quads[i].tr.vertices.z = 0.0f; - Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity); +// Color4B c(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity); + Color4B c(255,255,255,255); quads[i].tl.colors = c; quads[i].tr.colors = c; quads[i].bl.colors = c; diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index f723480d36..5f49ca60d3 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -415,35 +415,38 @@ void ParticleSystemQuad::draw() //quad command if(_particleIdx > 0) { - //transform vertices - std::vector drawQuads(_particleIdx); - memcpy(&drawQuads[0], _quads, sizeof(V3F_C4B_T2F_Quad) * _particleIdx); - AffineTransform worldTM = getNodeToWorldTransform(); - for(int index = 0; index <_particleIdx; ++index) - { - V3F_C4B_T2F_Quad* quad = _quads + index; - - Point pt(0,0); - pt = PointApplyAffineTransform( Point(quad->bl.vertices.x, quad->bl.vertices.y), worldTM); - drawQuads[index].bl.vertices.x = pt.x; - drawQuads[index].bl.vertices.y = pt.y; - - pt = PointApplyAffineTransform( Point(quad->br.vertices.x, quad->br.vertices.y), worldTM); - drawQuads[index].br.vertices.x = pt.x; - drawQuads[index].br.vertices.y = pt.y; - - pt = PointApplyAffineTransform( Point(quad->tl.vertices.x, quad->tl.vertices.y), worldTM); - drawQuads[index].tl.vertices.x = pt.x; - drawQuads[index].tl.vertices.y = pt.y; - - pt = PointApplyAffineTransform( Point(quad->tr.vertices.x, quad->tr.vertices.y), worldTM); - drawQuads[index].tr.vertices.x = pt.x; - drawQuads[index].tr.vertices.y = pt.y; - - } - +// //transform vertices +// std::vector drawQuads(_particleIdx); +// memcpy(&drawQuads[0], _quads, sizeof(V3F_C4B_T2F_Quad) * _particleIdx); +// AffineTransform worldTM = getNodeToWorldTransform(); +// for(int index = 0; index <_particleIdx; ++index) +// { +// V3F_C4B_T2F_Quad* quad = _quads + index; +// +// Point pt(0,0); +// pt = PointApplyAffineTransform( Point(quad->bl.vertices.x, quad->bl.vertices.y), worldTM); +// drawQuads[index].bl.vertices.x = pt.x; +// drawQuads[index].bl.vertices.y = pt.y; +// +// pt = PointApplyAffineTransform( Point(quad->br.vertices.x, quad->br.vertices.y), worldTM); +// drawQuads[index].br.vertices.x = pt.x; +// drawQuads[index].br.vertices.y = pt.y; +// +// pt = PointApplyAffineTransform( Point(quad->tl.vertices.x, quad->tl.vertices.y), worldTM); +// drawQuads[index].tl.vertices.x = pt.x; +// drawQuads[index].tl.vertices.y = pt.y; +// +// pt = PointApplyAffineTransform( Point(quad->tr.vertices.x, quad->tr.vertices.y), worldTM); +// drawQuads[index].tr.vertices.x = pt.x; +// drawQuads[index].tr.vertices.y = pt.y; +// +// } + + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); + QuadCommand* cmd = QuadCommand::getCommandPool().generateCommand(); - cmd->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &drawQuads[0], _particleIdx); + cmd->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, _quads, _particleIdx, mv); Renderer::getInstance()->addCommand(cmd); } diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 3045297798..680bafe578 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -663,10 +663,14 @@ void Sprite::updateTransform(void) void Sprite::draw(void) { - updateQuadVertices(); +// updateQuadVertices(); + + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); + //TODO implement z order QuadCommand* renderCommand = QuadCommand::getCommandPool().generateCommand(); - renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1); + renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv); Renderer::getInstance()->addCommand(renderCommand); } diff --git a/cocos/2d/renderer/CCNewLabelAtlas.cpp b/cocos/2d/renderer/CCNewLabelAtlas.cpp new file mode 100644 index 0000000000..aba1711220 --- /dev/null +++ b/cocos/2d/renderer/CCNewLabelAtlas.cpp @@ -0,0 +1,68 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + + +#include "CCNewLabelAtlas.h" +#include "RenderCommand.h" +#include "Renderer.h" +#include "QuadCommand.h" +#include "CCMenuItem.h" +#include "Frustum.h" +#include "CCDirector.h" +#include "CCTextureAtlas.h" +#include "CCShaderCache.h" + +NS_CC_BEGIN + +bool NewLabelAtlas::initWithTexture(Texture2D* texture, long tileWidth, long tileHeight, long itemsToRender) +{ + LabelAtlas::initWithTexture(texture, tileWidth, tileHeight, itemsToRender); + + // shader stuff + setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR)); + + return true; +} + + +void NewLabelAtlas::draw() +{ +// LabelAtlas::draw(); +// _renderCommand.init(0, _vertexZ, _textureAtlas->getTexture()->getName(), _shaderProgram, _blendFunc, +// _textureAtlas->getQuads(), _textureAtlas->getTotalQuads() ); +// +// Renderer::getInstance()->addCommand(&_renderCommand); + + + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); + + QuadCommand* cmd = QuadCommand::getCommandPool().generateCommand(); + cmd->init(0, _vertexZ, _textureAtlas->getTexture()->getName(), _shaderProgram, _blendFunc, _textureAtlas->getQuads(), _textureAtlas->getTotalQuads(), mv); + + Renderer::getInstance()->addCommand(cmd); + +} + +NS_CC_END \ No newline at end of file diff --git a/cocos/2d/renderer/CCNewLabelAtlas.h b/cocos/2d/renderer/CCNewLabelAtlas.h new file mode 100644 index 0000000000..c5eaafc751 --- /dev/null +++ b/cocos/2d/renderer/CCNewLabelAtlas.h @@ -0,0 +1,52 @@ +/**************************************************************************** + Copyright (c) 2013 cocos2d-x.org + + http://www.cocos2d-x.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + ****************************************************************************/ + + +#ifndef __CCNEWLABELATLAS_H_ +#define __CCNEWLABELATLAS_H_ + +#include "CCLabelAtlas.h" +#include "CCPlatformMacros.h" +#include "QuadCommand.h" + +NS_CC_BEGIN + +class NewLabelAtlas : public LabelAtlas +{ + +public: + NewLabelAtlas() {} + virtual ~NewLabelAtlas() {} + + virtual bool initWithTexture(Texture2D* texture, long tileWidth, long tileHeight, long itemsToRender); + + virtual void draw(void) override; + +protected: + QuadCommand _renderCommand; +}; + +NS_CC_END + +#endif /* defined(__CCNEWLABELATLAS_H_) */ diff --git a/cocos/2d/renderer/CCNewSprite.cpp b/cocos/2d/renderer/CCNewSprite.cpp index 047259f534..197d0f2676 100644 --- a/cocos/2d/renderer/CCNewSprite.cpp +++ b/cocos/2d/renderer/CCNewSprite.cpp @@ -108,15 +108,17 @@ void NewSprite::updateQuadVertices() void NewSprite::draw(void) { - updateQuadVertices(); +// updateQuadVertices(); if(!culling()) { return; } + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); //TODO implement z order QuadCommand* renderCommand = QuadCommand::getCommandPool().generateCommand(); - renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1); + renderCommand->init(0, _vertexZ, _texture->getName(), _shaderProgram, _blendFunc, &_quad, 1, mv); Renderer::getInstance()->addCommand(renderCommand); } diff --git a/cocos/2d/renderer/CCNewSpriteBatchNode.cpp b/cocos/2d/renderer/CCNewSpriteBatchNode.cpp index 6c28176e32..389de382b3 100644 --- a/cocos/2d/renderer/CCNewSpriteBatchNode.cpp +++ b/cocos/2d/renderer/CCNewSpriteBatchNode.cpp @@ -60,11 +60,14 @@ void NewSpriteBatchNode::draw() for(const auto &child: _children) child->updateTransform(); - + // arrayMakeObjectsPerformSelector(_children, updateTransform, NewSprite*); + kmMat4 mv; + kmGLGetMatrix(KM_GL_MODELVIEW, &mv); + QuadCommand* cmd = QuadCommand::getCommandPool().generateCommand(); - cmd->init(0, _vertexZ, _textureAtlas->getTexture()->getName(), _shaderProgram, _blendFunc, _textureAtlas->getQuads(), _textureAtlas->getTotalQuads()); + cmd->init(0, _vertexZ, _textureAtlas->getTexture()->getName(), _shaderProgram, _blendFunc, _textureAtlas->getQuads(), _textureAtlas->getTotalQuads(), mv); Renderer::getInstance()->addCommand(cmd); } diff --git a/cocos/2d/renderer/QuadCommand.cpp b/cocos/2d/renderer/QuadCommand.cpp index 1c5b190a1d..543396611b 100644 --- a/cocos/2d/renderer/QuadCommand.cpp +++ b/cocos/2d/renderer/QuadCommand.cpp @@ -16,13 +16,14 @@ QuadCommand::QuadCommand() ,_textureID(0) ,_blendType(BlendFunc::DISABLE) ,_quadCount(0) +,_capacity(0) { _type = QUAD_COMMAND; _shader = nullptr; _quad = nullptr; } -void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount) +void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount, const kmMat4 &mv) { _viewport = viewport; _depth = depth; @@ -30,9 +31,55 @@ void QuadCommand::init(int viewport, int32_t depth, GLuint textureID, GLProgram* _blendType = blendType; _quadCount = quadCount; _shader = shader; - free(_quad); - _quad = (V3F_C4B_T2F_Quad*)malloc(sizeof(V3F_C4B_T2F_Quad) * quadCount); + + if(quadCount > _capacity ) { +// _quad = (V3F_C4B_T2F_Quad*)malloc(sizeof(V3F_C4B_T2F_Quad) * quadCount); + _quad = (V3F_C4B_T2F_Quad*) realloc(_quad, sizeof(*quad) * quadCount ); + _capacity = quadCount; + } + + _quadCount = quadCount; memcpy(_quad, quad, sizeof(V3F_C4B_T2F_Quad) * quadCount); + + for(int i=0; ibl.vertices.x; + vec1.y = q->bl.vertices.y; + vec1.z = q->bl.vertices.z; + kmVec3Transform(&out1, &vec1, &mv); + q->bl.vertices.x = out1.x; + q->bl.vertices.y = out1.y; + q->bl.vertices.z = out1.z; + + kmVec3 vec2, out2; + vec2.x = q->br.vertices.x; + vec2.y = q->br.vertices.y; + vec2.z = q->br.vertices.z; + kmVec3Transform(&out2, &vec2, &mv); + q->br.vertices.x = out2.x; + q->br.vertices.y = out2.y; + q->br.vertices.z = out2.z; + + kmVec3 vec3, out3; + vec3.x = q->tr.vertices.x; + vec3.y = q->tr.vertices.y; + vec3.z = q->tr.vertices.z; + kmVec3Transform(&out3, &vec3, &mv); + q->tr.vertices.x = out3.x; + q->tr.vertices.y = out3.y; + q->tr.vertices.z = out3.z; + + kmVec3 vec4, out4; + vec4.x = q->tl.vertices.x; + vec4.y = q->tl.vertices.y; + vec4.z = q->tl.vertices.z; + kmVec3Transform(&out4, &vec4, &mv); + q->tl.vertices.x = out4.x; + q->tl.vertices.y = out4.y; + q->tl.vertices.z = out4.z; + } } QuadCommand::~QuadCommand() diff --git a/cocos/2d/renderer/QuadCommand.h b/cocos/2d/renderer/QuadCommand.h index 78e7323820..f128fc057b 100644 --- a/cocos/2d/renderer/QuadCommand.h +++ b/cocos/2d/renderer/QuadCommand.h @@ -10,6 +10,7 @@ #include "RenderCommand.h" #include "CCGLProgram.h" #include "RenderCommandPool.h" +#include "kazmath.h" NS_CC_BEGIN @@ -17,12 +18,13 @@ NS_CC_BEGIN class QuadCommand : public RenderCommand { -protected: +public: QuadCommand(); ~QuadCommand(); public: - void init(int viewport, int32_t depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount); + void init(int viewport, int32_t depth, GLuint texutreID, GLProgram* shader, BlendFunc blendType, V3F_C4B_T2F_Quad* quad, int quadCount, + const kmMat4& mv); // +----------+----------+-----+-----------------------------------+ // | | | | | | @@ -69,6 +71,8 @@ protected: V3F_C4B_T2F_Quad* _quad; int _quadCount; + int _capacity; + public: friend class RenderCommandPool; static RenderCommandPool& getCommandPool() { return _commandPool; }