mirror of https://github.com/axmolengine/axmol.git
commit
8554eaa46c
|
@ -251,7 +251,9 @@ void Renderer::render()
|
|||
CCASSERT(cmdQuadCount < VBO_SIZE, "VBO is not big enough for quad data, please break the quad data down or use customized render command");
|
||||
|
||||
//Draw batched quads if VBO is full
|
||||
_lastCommand --;
|
||||
drawBatchedQuads();
|
||||
_lastCommand ++;
|
||||
}
|
||||
|
||||
memcpy(_quads + _numQuads, cmd->getQuad(), sizeof(V3F_C4B_T2F_Quad) * cmdQuadCount);
|
||||
|
@ -414,7 +416,7 @@ void Renderer::drawBatchedQuads()
|
|||
}
|
||||
|
||||
|
||||
_firstCommand = _lastCommand;
|
||||
_firstCommand = _lastCommand + 1;
|
||||
_numQuads = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ static std::function<Layer*()> createFunctions[] =
|
|||
CL(NewClippingNodeTest),
|
||||
CL(NewDrawNodeTest),
|
||||
CL(NewCullingTest),
|
||||
CL(VBOFullTest),
|
||||
};
|
||||
|
||||
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
||||
|
@ -485,3 +486,32 @@ std::string NewCullingTest::subtitle() const
|
|||
return "Culling";
|
||||
}
|
||||
|
||||
VBOFullTest::VBOFullTest()
|
||||
{
|
||||
Size s = Director::getInstance()->getWinSize();
|
||||
Node* parent = Node::create();
|
||||
parent->setPosition(s.width/2, s.height/2);
|
||||
addChild(parent);
|
||||
|
||||
for (int i=0; i<Renderer::VBO_SIZE * 2; ++i)
|
||||
{
|
||||
Sprite* sprite = Sprite::create("Images/grossini_dance_01.png");
|
||||
sprite->setPosition(Point(0,0));
|
||||
parent->addChild(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
VBOFullTest::~VBOFullTest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string VBOFullTest::title() const
|
||||
{
|
||||
return "New Renderer";
|
||||
}
|
||||
|
||||
std::string VBOFullTest::subtitle() const
|
||||
{
|
||||
return "VBO full Test, everthing should render normally";
|
||||
}
|
||||
|
|
|
@ -118,4 +118,16 @@ protected:
|
|||
virtual ~NewCullingTest();
|
||||
};
|
||||
|
||||
class VBOFullTest : public MultiSceneTest
|
||||
{
|
||||
public:
|
||||
CREATE_FUNC(VBOFullTest);
|
||||
virtual std::string title() const override;
|
||||
virtual std::string subtitle() const override;
|
||||
|
||||
protected:
|
||||
VBOFullTest();
|
||||
virtual ~VBOFullTest();
|
||||
};
|
||||
|
||||
#endif //__NewRendererTest_H_
|
||||
|
|
Loading…
Reference in New Issue