2013-12-18 10:41:09 +08:00
|
|
|
/****************************************************************************
|
|
|
|
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.
|
|
|
|
****************************************************************************/
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2013-12-17 16:34:05 +08:00
|
|
|
#include "NewRendererTest.h"
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
USING_NS_CC;
|
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
NewRendererTests::NewRendererTests()
|
2013-11-13 03:19:18 +08:00
|
|
|
{
|
2015-04-03 14:31:03 +08:00
|
|
|
ADD_TEST_CASE(NewSpriteTest);
|
|
|
|
ADD_TEST_CASE(GroupCommandTest);
|
|
|
|
ADD_TEST_CASE(NewClippingNodeTest);
|
|
|
|
ADD_TEST_CASE(NewDrawNodeTest);
|
|
|
|
ADD_TEST_CASE(NewCullingTest);
|
|
|
|
ADD_TEST_CASE(VBOFullTest);
|
|
|
|
ADD_TEST_CASE(CaptureScreenTest);
|
2016-05-07 22:10:53 +08:00
|
|
|
ADD_TEST_CASE(CaptureNodeTest);
|
2016-02-09 03:25:37 +08:00
|
|
|
ADD_TEST_CASE(BugAutoCulling);
|
|
|
|
ADD_TEST_CASE(RendererBatchQuadTri);
|
2016-08-08 05:51:02 +08:00
|
|
|
ADD_TEST_CASE(RendererUniformBatch);
|
|
|
|
ADD_TEST_CASE(RendererUniformBatch2);
|
2013-11-13 03:19:18 +08:00
|
|
|
};
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string MultiSceneTest::title() const
|
2013-11-13 03:19:18 +08:00
|
|
|
{
|
2014-02-28 23:02:22 +08:00
|
|
|
return "New Renderer";
|
2013-11-13 03:19:18 +08:00
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string MultiSceneTest::subtitle() const
|
2013-11-13 03:19:18 +08:00
|
|
|
{
|
2014-02-28 23:02:22 +08:00
|
|
|
return "MultiSceneTest";
|
2013-11-13 03:19:18 +08:00
|
|
|
}
|
|
|
|
|
2013-11-13 03:23:10 +08:00
|
|
|
NewSpriteTest::NewSpriteTest()
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
auto touchListener = EventListenerTouchAllAtOnce::create();
|
2013-11-13 03:23:10 +08:00
|
|
|
touchListener->onTouchesEnded = CC_CALLBACK_2(NewSpriteTest::onTouchesEnded, this);
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2013-11-08 08:50:53 +08:00
|
|
|
createSpriteTest();
|
2013-11-05 01:14:22 +08:00
|
|
|
createNewSpriteTest();
|
|
|
|
}
|
|
|
|
|
2013-11-13 03:23:10 +08:00
|
|
|
NewSpriteTest::~NewSpriteTest()
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
void NewSpriteTest::createSpriteTest()
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
Size winSize = Director::getInstance()->getWinSize();
|
|
|
|
|
|
|
|
Sprite* parent = Sprite::create("Images/grossini.png");
|
2013-11-08 07:48:37 +08:00
|
|
|
parent->setPosition(winSize.width/4, winSize.height/2);
|
2013-11-05 01:14:22 +08:00
|
|
|
Sprite* child1 = Sprite::create("Images/grossinis_sister1.png");
|
|
|
|
child1->setPosition(0.0f, -20.0f);
|
|
|
|
Sprite* child2 = Sprite::create("Images/grossinis_sister2.png");
|
|
|
|
child2->setPosition(20.0f, -20.0f);
|
|
|
|
Sprite* child3 = Sprite::create("Images/grossinis_sister1.png");
|
|
|
|
child3->setPosition(40.0f, -20.0f);
|
2013-11-08 07:48:37 +08:00
|
|
|
Sprite* child4 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
child4->setPosition(60.0f, -20.0f);
|
2013-11-08 07:48:37 +08:00
|
|
|
Sprite* child5 = Sprite::create("Images/grossinis_sister2.png");
|
|
|
|
child5->setPosition(80.0f, -20.0f);
|
|
|
|
Sprite* child6 = Sprite::create("Images/grossinis_sister2.png");
|
|
|
|
child6->setPosition(100.0f, -20.0f);
|
|
|
|
Sprite* child7 = Sprite::create("Images/grossinis_sister2.png");
|
|
|
|
child7->setPosition(120.0f, -20.0f);
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
parent->addChild(child1);
|
|
|
|
parent->addChild(child2);
|
|
|
|
parent->addChild(child3);
|
|
|
|
parent->addChild(child4);
|
2013-11-08 07:48:37 +08:00
|
|
|
parent->addChild(child5);
|
|
|
|
parent->addChild(child6);
|
|
|
|
parent->addChild(child7);
|
2013-11-05 01:14:22 +08:00
|
|
|
addChild(parent);
|
|
|
|
}
|
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
void NewSpriteTest::createNewSpriteTest()
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
Size winSize = Director::getInstance()->getWinSize();
|
|
|
|
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* parent = Sprite::create("Images/grossini.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
parent->setPosition(winSize.width*2/3, winSize.height/2);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child1 = Sprite::create("Images/grossinis_sister1.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
child1->setPosition(0.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child2 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
child2->setPosition(20.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child3 = Sprite::create("Images/grossinis_sister1.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
child3->setPosition(40.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child4 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-05 01:14:22 +08:00
|
|
|
child4->setPosition(60.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child5 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-08 07:48:37 +08:00
|
|
|
child5->setPosition(80.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child6 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-08 07:48:37 +08:00
|
|
|
child6->setPosition(100.0f, -20.0f);
|
2013-12-23 21:07:25 +08:00
|
|
|
Sprite* child7 = Sprite::create("Images/grossinis_sister2.png");
|
2013-11-08 07:48:37 +08:00
|
|
|
child7->setPosition(120.0f, -20.0f);
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
parent->addChild(child1);
|
|
|
|
parent->addChild(child2);
|
|
|
|
parent->addChild(child3);
|
|
|
|
parent->addChild(child4);
|
2013-11-08 07:48:37 +08:00
|
|
|
parent->addChild(child5);
|
|
|
|
parent->addChild(child6);
|
|
|
|
parent->addChild(child7);
|
2013-11-05 01:14:22 +08:00
|
|
|
addChild(parent);
|
|
|
|
}
|
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
void NewSpriteTest::onTouchesEnded(const std::vector<Touch *> &touches, Event *event)
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewSpriteTest::title() const
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
2014-03-06 03:50:12 +08:00
|
|
|
return "Renderer";
|
2013-11-13 03:19:18 +08:00
|
|
|
}
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewSpriteTest::subtitle() const
|
2013-11-13 03:19:18 +08:00
|
|
|
{
|
|
|
|
return "SpriteTest";
|
2013-11-05 01:14:22 +08:00
|
|
|
}
|
2013-11-13 03:53:53 +08:00
|
|
|
|
2014-04-07 22:31:24 +08:00
|
|
|
class SpriteInGroupCommand : public Sprite
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
GroupCommand _spriteWrapperCommand;
|
|
|
|
public:
|
|
|
|
static SpriteInGroupCommand* create(const std::string& filename);
|
|
|
|
|
2014-05-31 07:42:05 +08:00
|
|
|
virtual void draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) override;
|
2014-04-07 22:31:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
SpriteInGroupCommand* SpriteInGroupCommand::create(const std::string &filename)
|
|
|
|
{
|
2014-08-28 07:31:57 +08:00
|
|
|
SpriteInGroupCommand* sprite = new (std::nothrow) SpriteInGroupCommand();
|
2014-04-07 22:31:24 +08:00
|
|
|
sprite->initWithFile(filename);
|
|
|
|
sprite->autorelease();
|
|
|
|
return sprite;
|
|
|
|
}
|
|
|
|
|
2014-05-31 07:42:05 +08:00
|
|
|
void SpriteInGroupCommand::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags)
|
2014-04-07 22:31:24 +08:00
|
|
|
{
|
|
|
|
CCASSERT(renderer, "Render is null");
|
|
|
|
_spriteWrapperCommand.init(_globalZOrder);
|
|
|
|
renderer->addCommand(&_spriteWrapperCommand);
|
|
|
|
renderer->pushGroup(_spriteWrapperCommand.getRenderQueueID());
|
2014-05-31 07:42:05 +08:00
|
|
|
Sprite::draw(renderer, transform, flags);
|
2014-04-07 22:31:24 +08:00
|
|
|
renderer->popGroup();
|
|
|
|
}
|
|
|
|
|
2014-04-07 22:02:43 +08:00
|
|
|
GroupCommandTest::GroupCommandTest()
|
|
|
|
{
|
2014-04-07 22:31:24 +08:00
|
|
|
auto sprite = SpriteInGroupCommand::create("Images/grossini.png");
|
2014-04-07 22:02:43 +08:00
|
|
|
Size winSize = Director::getInstance()->getWinSize();
|
|
|
|
sprite->setPosition(winSize.width/2,winSize.height/2);
|
|
|
|
addChild(sprite);
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupCommandTest::~GroupCommandTest()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string GroupCommandTest::title() const
|
|
|
|
{
|
|
|
|
return "Renderer";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string GroupCommandTest::subtitle() const
|
|
|
|
{
|
|
|
|
return "GroupCommandTest: You should see a sprite";
|
|
|
|
}
|
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
NewClippingNodeTest::NewClippingNodeTest()
|
|
|
|
{
|
2013-11-16 09:32:29 +08:00
|
|
|
auto s = Director::getInstance()->getWinSize();
|
|
|
|
|
2013-12-24 14:08:57 +08:00
|
|
|
auto clipper = ClippingNode::create();
|
2013-11-16 03:29:11 +08:00
|
|
|
clipper->setTag( kTagClipperNode );
|
|
|
|
clipper->setContentSize( Size(200, 200) );
|
2014-05-15 01:07:09 +08:00
|
|
|
clipper->setAnchorPoint( Vec2(0.5, 0.5) );
|
|
|
|
clipper->setPosition( Vec2(s.width / 2, s.height / 2) );
|
2013-11-19 07:52:47 +08:00
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
clipper->runAction(RepeatForever::create(RotateBy::create(1, 45)));
|
|
|
|
this->addChild(clipper);
|
|
|
|
|
2014-08-30 03:54:24 +08:00
|
|
|
// TODO: Fix draw node as clip node
|
2013-11-19 06:58:41 +08:00
|
|
|
// auto stencil = NewDrawNode::create();
|
2014-05-15 01:07:09 +08:00
|
|
|
// Vec2 rectangle[4];
|
|
|
|
// rectangle[0] = Vec2(0, 0);
|
|
|
|
// rectangle[1] = Vec2(clipper->getContentSize().width, 0);
|
|
|
|
// rectangle[2] = Vec2(clipper->getContentSize().width, clipper->getContentSize().height);
|
|
|
|
// rectangle[3] = Vec2(0, clipper->getContentSize().height);
|
2013-11-19 06:58:41 +08:00
|
|
|
//
|
|
|
|
// Color4F white(1, 1, 1, 1);
|
|
|
|
// stencil->drawPolygon(rectangle, 4, white, 1, white);
|
2013-11-16 09:32:29 +08:00
|
|
|
// clipper->setStencil(stencil);
|
2013-11-19 06:58:41 +08:00
|
|
|
|
2013-11-20 03:06:26 +08:00
|
|
|
//Test with alpha Test
|
2013-11-19 07:52:47 +08:00
|
|
|
clipper->setAlphaThreshold(0.05f);
|
2013-12-23 21:07:25 +08:00
|
|
|
auto stencil = Sprite::create("Images/grossini.png");
|
2013-11-19 06:58:41 +08:00
|
|
|
stencil->setPosition(s.width/2, s.height/2);
|
|
|
|
clipper->setStencil(stencil);
|
2013-11-16 03:29:11 +08:00
|
|
|
|
2013-12-23 21:07:25 +08:00
|
|
|
auto content = Sprite::create("Images/background2.png");
|
2013-11-16 03:29:11 +08:00
|
|
|
content->setTag( kTagContentNode );
|
2014-05-15 01:07:09 +08:00
|
|
|
content->setAnchorPoint( Vec2(0.5, 0.5) );
|
|
|
|
content->setPosition( Vec2(clipper->getContentSize().width / 2, clipper->getContentSize().height / 2) );
|
2013-11-16 03:29:11 +08:00
|
|
|
clipper->addChild(content);
|
|
|
|
|
|
|
|
_scrolling = false;
|
|
|
|
|
|
|
|
auto listener = EventListenerTouchAllAtOnce::create();
|
|
|
|
listener->onTouchesBegan = CC_CALLBACK_2(NewClippingNodeTest::onTouchesBegan, this);
|
|
|
|
listener->onTouchesMoved = CC_CALLBACK_2(NewClippingNodeTest::onTouchesMoved, this);
|
|
|
|
listener->onTouchesEnded = CC_CALLBACK_2(NewClippingNodeTest::onTouchesEnded, this);
|
|
|
|
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
NewClippingNodeTest::~NewClippingNodeTest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewClippingNodeTest::title() const
|
2013-11-16 03:29:11 +08:00
|
|
|
{
|
|
|
|
return "New Render";
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewClippingNodeTest::subtitle() const
|
2013-11-16 03:29:11 +08:00
|
|
|
{
|
|
|
|
return "ClipNode";
|
|
|
|
}
|
|
|
|
|
|
|
|
void NewClippingNodeTest::onTouchesBegan(const std::vector<Touch *> &touches, Event *event)
|
|
|
|
{
|
|
|
|
Touch *touch = touches[0];
|
|
|
|
auto clipper = this->getChildByTag(kTagClipperNode);
|
2014-05-15 01:07:09 +08:00
|
|
|
Vec2 point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
|
2013-11-16 03:29:11 +08:00
|
|
|
auto rect = Rect(0, 0, clipper->getContentSize().width, clipper->getContentSize().height);
|
|
|
|
_scrolling = rect.containsPoint(point);
|
|
|
|
_lastPoint = point;
|
|
|
|
}
|
|
|
|
|
|
|
|
void NewClippingNodeTest::onTouchesMoved(const std::vector<Touch *> &touches, Event *event)
|
|
|
|
{
|
|
|
|
if (!_scrolling) return;
|
|
|
|
Touch *touch = touches[0];
|
|
|
|
auto clipper = this->getChildByTag(kTagClipperNode);
|
|
|
|
auto point = clipper->convertToNodeSpace(Director::getInstance()->convertToGL(touch->getLocationInView()));
|
2014-05-15 01:07:09 +08:00
|
|
|
Vec2 diff = point - _lastPoint;
|
2013-11-16 03:29:11 +08:00
|
|
|
auto content = clipper->getChildByTag(kTagContentNode);
|
|
|
|
content->setPosition(content->getPosition() + diff);
|
|
|
|
_lastPoint = point;
|
|
|
|
}
|
|
|
|
|
|
|
|
void NewClippingNodeTest::onTouchesEnded(const std::vector<Touch *> &touches, Event *event)
|
|
|
|
{
|
|
|
|
if (!_scrolling) return;
|
|
|
|
_scrolling = false;
|
|
|
|
}
|
2013-11-20 05:57:39 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* NewDrawNode
|
|
|
|
*/
|
|
|
|
NewDrawNodeTest::NewDrawNodeTest()
|
|
|
|
{
|
|
|
|
auto s = Director::getInstance()->getWinSize();
|
|
|
|
|
|
|
|
auto parent = Node::create();
|
|
|
|
parent->setPosition(s.width/2, s.height/2);
|
|
|
|
addChild(parent);
|
|
|
|
|
2013-12-19 03:45:30 +08:00
|
|
|
auto rectNode = DrawNode::create();
|
2014-05-15 01:07:09 +08:00
|
|
|
Vec2 rectangle[4];
|
|
|
|
rectangle[0] = Vec2(-50, -50);
|
|
|
|
rectangle[1] = Vec2(50, -50);
|
|
|
|
rectangle[2] = Vec2(50, 50);
|
|
|
|
rectangle[3] = Vec2(-50, 50);
|
2013-11-20 05:57:39 +08:00
|
|
|
|
|
|
|
Color4F white(1, 1, 1, 1);
|
|
|
|
rectNode->drawPolygon(rectangle, 4, white, 1, white);
|
|
|
|
parent->addChild(rectNode);
|
|
|
|
}
|
|
|
|
|
|
|
|
NewDrawNodeTest::~NewDrawNodeTest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewDrawNodeTest::title() const
|
2013-11-20 05:57:39 +08:00
|
|
|
{
|
|
|
|
return "New Render";
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewDrawNodeTest::subtitle() const
|
2013-11-20 05:57:39 +08:00
|
|
|
{
|
|
|
|
return "DrawNode";
|
|
|
|
}
|
2013-11-27 10:35:23 +08:00
|
|
|
|
|
|
|
NewCullingTest::NewCullingTest()
|
|
|
|
{
|
2014-04-14 11:33:40 +08:00
|
|
|
Size size = Director::getInstance()->getWinSize();
|
|
|
|
auto sprite = Sprite::create("Images/btn-about-normal-vertical.png");
|
2014-04-15 07:46:19 +08:00
|
|
|
sprite->setRotation(5);
|
2014-05-15 01:07:09 +08:00
|
|
|
sprite->setPosition(Vec2(size.width/2,size.height/3));
|
2014-04-14 11:33:40 +08:00
|
|
|
sprite->setScale(2);
|
|
|
|
addChild(sprite);
|
2014-04-15 22:21:04 +08:00
|
|
|
|
2014-04-14 11:33:40 +08:00
|
|
|
auto sprite2 = Sprite::create("Images/btn-about-normal-vertical.png");
|
|
|
|
sprite2->setRotation(-85);
|
2014-05-15 01:07:09 +08:00
|
|
|
sprite2->setPosition(Vec2(size.width/2,size.height * 2/3));
|
2014-04-14 11:33:40 +08:00
|
|
|
sprite2->setScale(2);
|
|
|
|
addChild(sprite2);
|
2013-11-27 10:35:23 +08:00
|
|
|
|
2014-04-14 11:33:40 +08:00
|
|
|
auto listener = EventListenerTouchOneByOne::create();
|
2014-04-14 11:45:06 +08:00
|
|
|
listener->setSwallowTouches(true);
|
2013-11-27 14:30:38 +08:00
|
|
|
|
2014-04-14 11:45:06 +08:00
|
|
|
listener->onTouchBegan = CC_CALLBACK_2(NewCullingTest::onTouchBegan, this);
|
|
|
|
listener->onTouchMoved = CC_CALLBACK_2(NewCullingTest::onTouchMoved, this);
|
2014-04-14 11:33:40 +08:00
|
|
|
|
2014-04-14 11:45:06 +08:00
|
|
|
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
|
2014-04-14 11:33:40 +08:00
|
|
|
|
|
|
|
}
|
2013-11-27 14:30:38 +08:00
|
|
|
|
2014-04-14 11:33:40 +08:00
|
|
|
bool NewCullingTest::onTouchBegan(Touch* touch, Event *event)
|
|
|
|
{
|
2014-04-14 11:45:06 +08:00
|
|
|
auto pos = touch->getLocation();
|
|
|
|
_lastPos = pos;
|
|
|
|
return true;
|
2014-04-14 11:33:40 +08:00
|
|
|
}
|
2013-11-27 14:30:38 +08:00
|
|
|
|
2014-04-14 11:33:40 +08:00
|
|
|
void NewCullingTest::onTouchMoved(Touch* touch, Event *event)
|
2014-04-14 11:45:06 +08:00
|
|
|
{
|
|
|
|
auto pos = touch->getLocation();
|
2014-04-14 11:33:40 +08:00
|
|
|
|
2014-04-14 11:45:06 +08:00
|
|
|
auto offset = pos - _lastPos;
|
2014-04-14 11:33:40 +08:00
|
|
|
|
2014-04-14 11:45:06 +08:00
|
|
|
auto layerPos = getPosition();
|
|
|
|
auto newPos = layerPos + offset;
|
2014-04-14 11:33:40 +08:00
|
|
|
|
2014-04-14 11:45:06 +08:00
|
|
|
setPosition(newPos);
|
|
|
|
_lastPos = pos;
|
2013-11-27 10:35:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
NewCullingTest::~NewCullingTest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewCullingTest::title() const
|
2013-11-27 10:35:23 +08:00
|
|
|
{
|
|
|
|
return "New Render";
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string NewCullingTest::subtitle() const
|
2013-11-27 10:35:23 +08:00
|
|
|
{
|
2014-04-14 11:33:40 +08:00
|
|
|
return "Drag the layer to test the result of culling";
|
2013-11-27 10:35:23 +08:00
|
|
|
}
|
|
|
|
|
2014-01-15 09:03:54 +08:00
|
|
|
VBOFullTest::VBOFullTest()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
Node* parent = Node::create();
|
2014-10-16 18:30:01 +08:00
|
|
|
parent->setPosition(0,0);
|
2014-01-15 09:03:54 +08:00
|
|
|
addChild(parent);
|
|
|
|
|
2014-10-16 18:30:01 +08:00
|
|
|
for (int i=0; i< Renderer::VBO_SIZE / 3.9; ++i)
|
2014-01-15 09:03:54 +08:00
|
|
|
{
|
|
|
|
Sprite* sprite = Sprite::create("Images/grossini_dance_01.png");
|
2015-01-15 10:07:23 +08:00
|
|
|
sprite->setScale(0.1f, 0.1f);
|
2014-10-16 18:30:01 +08:00
|
|
|
float x = ((float)std::rand()) /RAND_MAX;
|
|
|
|
float y = ((float)std::rand()) /RAND_MAX;
|
|
|
|
sprite->setPosition(Vec2(x * s.width, y * s.height));
|
2014-01-15 09:03:54 +08:00
|
|
|
parent->addChild(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VBOFullTest::~VBOFullTest()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string VBOFullTest::title() const
|
|
|
|
{
|
|
|
|
return "New Renderer";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string VBOFullTest::subtitle() const
|
|
|
|
{
|
2014-01-15 09:06:22 +08:00
|
|
|
return "VBO full Test, everthing should render normally";
|
2014-01-15 09:11:32 +08:00
|
|
|
}
|
2014-05-13 16:23:35 +08:00
|
|
|
|
|
|
|
CaptureScreenTest::CaptureScreenTest()
|
|
|
|
{
|
2014-05-13 17:17:15 +08:00
|
|
|
Size s = Director::getInstance()->getWinSize();
|
2014-05-26 20:18:11 +08:00
|
|
|
Vec2 left(s.width / 4, s.height / 2);
|
|
|
|
Vec2 right(s.width / 4 * 3, s.height / 2);
|
2014-05-13 16:23:35 +08:00
|
|
|
|
2014-05-13 17:17:15 +08:00
|
|
|
auto sp1 = Sprite::create("Images/grossini.png");
|
|
|
|
sp1->setPosition(left);
|
2014-05-26 20:18:11 +08:00
|
|
|
auto move1 = MoveBy::create(1, Vec2(s.width/2, 0));
|
2014-05-14 10:40:56 +08:00
|
|
|
auto seq1 = RepeatForever::create(Sequence::create(move1, move1->reverse(), nullptr));
|
2014-05-13 17:17:15 +08:00
|
|
|
addChild(sp1);
|
|
|
|
sp1->runAction(seq1);
|
|
|
|
auto sp2 = Sprite::create("Images/grossinis_sister1.png");
|
|
|
|
sp2->setPosition(right);
|
2014-05-26 20:18:11 +08:00
|
|
|
auto move2 = MoveBy::create(1, Vec2(-s.width/2, 0));
|
2014-05-14 10:40:56 +08:00
|
|
|
auto seq2 = RepeatForever::create(Sequence::create(move2, move2->reverse(), nullptr));
|
2014-05-13 17:17:15 +08:00
|
|
|
addChild(sp2);
|
|
|
|
sp2->runAction(seq2);
|
|
|
|
|
|
|
|
auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture all");
|
2014-05-26 13:42:47 +08:00
|
|
|
auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureScreenTest::onCaptured, this));
|
|
|
|
auto menu = Menu::create(mi1, nullptr);
|
2014-05-13 17:17:15 +08:00
|
|
|
addChild(menu);
|
|
|
|
menu->setPosition(s.width / 2, s.height / 4);
|
2014-05-13 18:34:35 +08:00
|
|
|
|
2014-05-14 01:06:26 +08:00
|
|
|
_filename = "";
|
2014-05-13 16:23:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
CaptureScreenTest::~CaptureScreenTest()
|
|
|
|
{
|
2014-05-19 01:12:56 +08:00
|
|
|
Director::getInstance()->getTextureCache()->removeTextureForKey(_filename);
|
2014-05-13 16:23:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string CaptureScreenTest::title() const
|
|
|
|
{
|
2014-05-13 17:17:15 +08:00
|
|
|
return "New Renderer";
|
2014-05-13 16:23:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
std::string CaptureScreenTest::subtitle() const
|
|
|
|
{
|
2014-05-26 16:32:13 +08:00
|
|
|
return "Capture screen test, press the menu items to capture the screen";
|
2014-05-13 16:23:35 +08:00
|
|
|
}
|
|
|
|
|
2014-05-26 13:42:47 +08:00
|
|
|
void CaptureScreenTest::onCaptured(Ref*)
|
2014-05-13 16:23:35 +08:00
|
|
|
{
|
2014-05-14 01:06:26 +08:00
|
|
|
Director::getInstance()->getTextureCache()->removeTextureForKey(_filename);
|
2014-05-26 16:32:13 +08:00
|
|
|
removeChildByTag(childTag);
|
2014-05-14 01:06:26 +08:00
|
|
|
_filename = "CaptureScreenTest.png";
|
2014-05-27 14:29:52 +08:00
|
|
|
utils::captureScreen(CC_CALLBACK_2(CaptureScreenTest::afterCaptured, this), _filename);
|
2014-05-13 16:23:35 +08:00
|
|
|
}
|
|
|
|
|
2014-05-14 01:06:26 +08:00
|
|
|
void CaptureScreenTest::afterCaptured(bool succeed, const std::string& outputFile)
|
2014-05-13 16:23:35 +08:00
|
|
|
{
|
2014-05-13 17:17:15 +08:00
|
|
|
if (succeed)
|
|
|
|
{
|
2014-05-14 10:40:56 +08:00
|
|
|
auto sp = Sprite::create(outputFile);
|
2014-05-26 16:32:13 +08:00
|
|
|
addChild(sp, 0, childTag);
|
2014-05-14 10:40:56 +08:00
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
sp->setPosition(s.width / 2, s.height / 2);
|
|
|
|
sp->setScale(0.25);
|
2014-05-14 01:06:26 +08:00
|
|
|
_filename = outputFile;
|
2014-05-13 17:17:15 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-05-26 16:24:57 +08:00
|
|
|
log("Capture screen failed.");
|
2014-05-13 17:17:15 +08:00
|
|
|
}
|
2014-05-14 16:25:47 +08:00
|
|
|
}
|
2015-06-29 17:25:13 +08:00
|
|
|
|
2016-05-07 22:10:53 +08:00
|
|
|
CaptureNodeTest::CaptureNodeTest()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
Vec2 left(s.width / 4, s.height / 2);
|
|
|
|
Vec2 right(s.width / 4 * 3, s.height / 2);
|
|
|
|
|
|
|
|
auto sp1 = Sprite::create("Images/grossini.png");
|
|
|
|
sp1->setPosition(left);
|
|
|
|
auto move1 = MoveBy::create(1, Vec2(s.width / 2, 0));
|
|
|
|
auto seq1 = RepeatForever::create(Sequence::create(move1, move1->reverse(), nullptr));
|
|
|
|
addChild(sp1);
|
|
|
|
sp1->runAction(seq1);
|
|
|
|
auto sp2 = Sprite::create("Images/grossinis_sister1.png");
|
|
|
|
sp2->setPosition(right);
|
|
|
|
auto move2 = MoveBy::create(1, Vec2(-s.width / 2, 0));
|
|
|
|
auto seq2 = RepeatForever::create(Sequence::create(move2, move2->reverse(), nullptr));
|
|
|
|
addChild(sp2);
|
|
|
|
sp2->runAction(seq2);
|
|
|
|
|
|
|
|
auto label1 = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "capture this scene");
|
|
|
|
auto mi1 = MenuItemLabel::create(label1, CC_CALLBACK_1(CaptureNodeTest::onCaptured, this));
|
|
|
|
auto menu = Menu::create(mi1, nullptr);
|
|
|
|
addChild(menu);
|
|
|
|
menu->setPosition(s.width / 2, s.height / 4);
|
|
|
|
|
|
|
|
_filename = "";
|
|
|
|
}
|
|
|
|
|
|
|
|
CaptureNodeTest::~CaptureNodeTest()
|
|
|
|
{
|
|
|
|
Director::getInstance()->getTextureCache()->removeTextureForKey(_filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CaptureNodeTest::title() const
|
|
|
|
{
|
|
|
|
return "New Renderer";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string CaptureNodeTest::subtitle() const
|
|
|
|
{
|
|
|
|
return "Capture node test, press the menu items to capture this scene with scale 0.5";
|
|
|
|
}
|
|
|
|
|
|
|
|
void CaptureNodeTest::onCaptured(Ref*)
|
|
|
|
{
|
|
|
|
Director::getInstance()->getTextureCache()->removeTextureForKey(_filename);
|
|
|
|
removeChildByTag(childTag);
|
|
|
|
|
|
|
|
_filename = FileUtils::getInstance()->getWritablePath() + "/CaptureNodeTest.png";
|
|
|
|
|
|
|
|
// capture this
|
|
|
|
auto image = utils::captureNode(this, 0.5);
|
|
|
|
|
|
|
|
// create a sprite with the captured image directly
|
|
|
|
auto sp = Sprite::createWithTexture(Director::getInstance()->getTextureCache()->addImage(image, _filename));
|
|
|
|
addChild(sp, 0, childTag);
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
sp->setPosition(s.width / 2, s.height / 2);
|
|
|
|
|
|
|
|
// store to disk
|
|
|
|
image->saveToFile(_filename);
|
|
|
|
|
|
|
|
// release the captured image
|
|
|
|
image->release();
|
|
|
|
}
|
|
|
|
|
2015-06-29 17:25:13 +08:00
|
|
|
BugAutoCulling::BugAutoCulling()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
2015-07-30 15:07:03 +08:00
|
|
|
auto fastmap = cocos2d::experimental::TMXTiledMap::create("TileMaps/orthogonal-test2.tmx");
|
|
|
|
this->addChild(fastmap);
|
|
|
|
for (int i = 0; i < 30; i++) {
|
2015-06-29 17:25:13 +08:00
|
|
|
auto sprite = Sprite::create("Images/grossini.png");
|
|
|
|
sprite->setPosition(s.width/2 + s.width/10 * i, s.height/2);
|
|
|
|
this->addChild(sprite);
|
2015-07-30 13:59:50 +08:00
|
|
|
auto label = Label::createWithTTF(TTFConfig("fonts/arial.ttf"), "Label");
|
|
|
|
label->setPosition(s.width/2 + s.width/10 * i, s.height/2);
|
|
|
|
this->addChild(label);
|
2015-06-29 17:25:13 +08:00
|
|
|
}
|
|
|
|
this->scheduleOnce([=](float){
|
|
|
|
auto camera = Director::getInstance()->getRunningScene()->getCameras().front();
|
|
|
|
auto move = MoveBy::create(2.0, Vec2(2 * s.width, 0));
|
|
|
|
camera->runAction(Sequence::create(move, move->reverse(),nullptr));
|
|
|
|
}, 1.0f, "lambda-autoculling-bug");
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string BugAutoCulling::title() const
|
|
|
|
{
|
|
|
|
return "Bug-AutoCulling";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string BugAutoCulling::subtitle() const
|
|
|
|
{
|
|
|
|
return "Moving the camera to the right instead of moving the layer";
|
2016-02-09 03:25:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// RendererBatchQuadTri
|
|
|
|
//
|
|
|
|
|
|
|
|
RendererBatchQuadTri::RendererBatchQuadTri()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
|
|
|
|
for (int i=0; i<250; i++)
|
|
|
|
{
|
|
|
|
int x = CCRANDOM_0_1() * s.width;
|
|
|
|
int y = CCRANDOM_0_1() * s.height;
|
|
|
|
|
|
|
|
auto label = LabelAtlas::create("This is a label", "fonts/tuffy_bold_italic-charmap.plist");
|
|
|
|
label->setColor(Color3B::RED);
|
|
|
|
label->setPosition(Vec2(x,y));
|
|
|
|
addChild(label);
|
|
|
|
|
|
|
|
auto sprite = Sprite::create("fonts/tuffy_bold_italic-charmap.png");
|
|
|
|
sprite->setTextureRect(Rect(0,0,100,100));
|
|
|
|
sprite->setPosition(Vec2(x,y));
|
|
|
|
sprite->setColor(Color3B::BLUE);
|
|
|
|
addChild(sprite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererBatchQuadTri::title() const
|
|
|
|
{
|
|
|
|
return "RendererBatchQuadTri";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererBatchQuadTri::subtitle() const
|
|
|
|
{
|
|
|
|
return "QuadCommand and TriangleCommands are batched together";
|
2016-05-07 22:10:53 +08:00
|
|
|
}
|
2016-08-08 05:51:02 +08:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// RendererUniformBatch
|
|
|
|
//
|
|
|
|
|
|
|
|
RendererUniformBatch::RendererUniformBatch()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
|
|
|
|
auto glBlurState = createBlurGLProgramState();
|
|
|
|
auto glSepiaState = createSepiaGLProgramState();
|
|
|
|
|
|
|
|
auto x_inc = s.width / 20;
|
|
|
|
auto y_inc = s.height / 6;
|
|
|
|
|
|
|
|
for (int y=0; y<6; ++y)
|
|
|
|
{
|
|
|
|
for (int x=0; x<20; ++x)
|
|
|
|
{
|
|
|
|
auto sprite = Sprite::create("Images/grossini.png");
|
|
|
|
sprite->setPosition(Vec2(x * x_inc, y * y_inc));
|
|
|
|
sprite->setScale(0.4);
|
|
|
|
addChild(sprite);
|
|
|
|
|
|
|
|
if (y>=4) {
|
|
|
|
sprite->setGLProgramState(glSepiaState);
|
|
|
|
} else if(y>=2) {
|
|
|
|
sprite->setGLProgramState(glBlurState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GLProgramState* RendererUniformBatch::createBlurGLProgramState()
|
|
|
|
{
|
|
|
|
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
|
|
const std::string shaderName("Shaders/example_Blur.fsh");
|
|
|
|
#else
|
|
|
|
const std::string shaderName("Shaders/example_Blur_winrt.fsh");
|
|
|
|
#endif
|
|
|
|
// outline shader
|
|
|
|
auto fileUtiles = FileUtils::getInstance();
|
|
|
|
auto fragmentFullPath = fileUtiles->fullPathForFilename(shaderName);
|
|
|
|
auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath);
|
|
|
|
auto glprogram = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource.c_str());
|
|
|
|
auto glprogramstate = (glprogram == nullptr ? nullptr : GLProgramState::getOrCreateWithGLProgram(glprogram));
|
|
|
|
|
|
|
|
glprogramstate->setUniformVec2("resolution", Vec2(85,121));
|
|
|
|
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
|
|
glprogramstate->setUniformFloat("blurRadius", 10);
|
|
|
|
glprogramstate->setUniformFloat("sampleNum", 5);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return glprogramstate;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLProgramState* RendererUniformBatch::createSepiaGLProgramState()
|
|
|
|
{
|
|
|
|
const std::string shaderName("Shaders/example_Sepia.fsh");
|
|
|
|
|
|
|
|
// outline shader
|
|
|
|
auto fileUtiles = FileUtils::getInstance();
|
|
|
|
auto fragmentFullPath = fileUtiles->fullPathForFilename(shaderName);
|
|
|
|
auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath);
|
|
|
|
auto glprogram = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource.c_str());
|
|
|
|
auto glprogramstate = (glprogram == nullptr ? nullptr : GLProgramState::getOrCreateWithGLProgram(glprogram));
|
|
|
|
|
|
|
|
return glprogramstate;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererUniformBatch::title() const
|
|
|
|
{
|
|
|
|
return "RendererUniformBatch";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererUniformBatch::subtitle() const
|
|
|
|
{
|
|
|
|
return "Only 9 draw calls should appear";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// RendererUniformBatch2
|
|
|
|
//
|
|
|
|
|
|
|
|
RendererUniformBatch2::RendererUniformBatch2()
|
|
|
|
{
|
|
|
|
Size s = Director::getInstance()->getWinSize();
|
|
|
|
|
|
|
|
auto glBlurState = createBlurGLProgramState();
|
|
|
|
auto glSepiaState = createSepiaGLProgramState();
|
|
|
|
|
|
|
|
auto x_inc = s.width / 20;
|
|
|
|
auto y_inc = s.height / 6;
|
|
|
|
|
|
|
|
for (int y=0; y<6; ++y)
|
|
|
|
{
|
|
|
|
for (int x=0; x<20; ++x)
|
|
|
|
{
|
|
|
|
auto sprite = Sprite::create("Images/grossini.png");
|
|
|
|
sprite->setPosition(Vec2(x * x_inc, y * y_inc));
|
|
|
|
sprite->setScale(0.4);
|
|
|
|
addChild(sprite);
|
|
|
|
|
|
|
|
auto r = CCRANDOM_0_1();
|
|
|
|
if (r < 0.33)
|
|
|
|
sprite->setGLProgramState(glSepiaState);
|
|
|
|
else if (r < 0.66)
|
|
|
|
sprite->setGLProgramState(glBlurState);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GLProgramState* RendererUniformBatch2::createBlurGLProgramState()
|
|
|
|
{
|
|
|
|
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
|
|
const std::string shaderName("Shaders/example_Blur.fsh");
|
|
|
|
#else
|
|
|
|
const std::string shaderName("Shaders/example_Blur_winrt.fsh");
|
|
|
|
#endif
|
|
|
|
// outline shader
|
|
|
|
auto fileUtiles = FileUtils::getInstance();
|
|
|
|
auto fragmentFullPath = fileUtiles->fullPathForFilename(shaderName);
|
|
|
|
auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath);
|
|
|
|
auto glprogram = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource.c_str());
|
|
|
|
auto glprogramstate = (glprogram == nullptr ? nullptr : GLProgramState::getOrCreateWithGLProgram(glprogram));
|
|
|
|
|
|
|
|
glprogramstate->setUniformVec2("resolution", Vec2(85,121));
|
|
|
|
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WINRT)
|
|
|
|
glprogramstate->setUniformFloat("blurRadius", 10);
|
|
|
|
glprogramstate->setUniformFloat("sampleNum", 5);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return glprogramstate;
|
|
|
|
}
|
|
|
|
|
|
|
|
GLProgramState* RendererUniformBatch2::createSepiaGLProgramState()
|
|
|
|
{
|
|
|
|
const std::string shaderName("Shaders/example_Sepia.fsh");
|
|
|
|
|
|
|
|
// outline shader
|
|
|
|
auto fileUtiles = FileUtils::getInstance();
|
|
|
|
auto fragmentFullPath = fileUtiles->fullPathForFilename(shaderName);
|
|
|
|
auto fragSource = fileUtiles->getStringFromFile(fragmentFullPath);
|
|
|
|
auto glprogram = GLProgram::createWithByteArrays(ccPositionTextureColor_noMVP_vert, fragSource.c_str());
|
|
|
|
auto glprogramstate = (glprogram == nullptr ? nullptr : GLProgramState::getOrCreateWithGLProgram(glprogram));
|
|
|
|
|
|
|
|
return glprogramstate;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererUniformBatch2::title() const
|
|
|
|
{
|
|
|
|
return "RendererUniformBatch 2";
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string RendererUniformBatch2::subtitle() const
|
|
|
|
{
|
|
|
|
return "Mixing different shader states should work ok";
|
|
|
|
}
|