PuzzleSDK
MaterialSystemTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2015-2016 Chukong Technologies Inc.
3 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
4
5 http://www.cocos2d-x.org
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 THE SOFTWARE.
24 ****************************************************************************/
25
26#pragma once
27
28#include "../BaseTest.h"
29#include "renderer/backend/Types.h"
30#include "renderer/backend/ProgramState.h"
31
32#include <vector>
33
34DEFINE_TEST_SUITE(MaterialSystemTest);
35
37{
38public:
39 virtual std::string title() const override;
40};
41
43{
44public:
46
47 virtual void onEnter() override;
48 virtual std::string subtitle() const override;
49
50};
51
53{
54public:
56
57 virtual void onEnter() override;
58 virtual std::string subtitle() const override;
59};
60
62{
63public:
65
66 virtual void onEnter() override;
67 virtual std::string subtitle() const override;
68 void updateCCTimeUniforms(float);
69
70private:
71 struct Locations {
72 Locations(cocos2d::backend::ProgramState *ps, cocos2d::backend::UniformLocation loc)
73 : programState(ps), location(loc) {}
74
75 cocos2d::backend::ProgramState *programState = nullptr;
76 cocos2d::backend::UniformLocation location;
77 };
78 std::vector<Locations> timeUniforms;
79};
80
83{
84public:
86
88 virtual ~Material_AutoBindings();
89
90 virtual void onEnter() override;
91 virtual std::string subtitle() const override;
92
93 void updateUniformTime(float);
94
95private:
96 cocos2d::backend::UniformLocation _locationTime;
98 cocos2d::backend::ProgramState *_noiseProgramState = nullptr;
99};
100
102{
103public:
105
106 virtual void onEnter() override;
107 virtual std::string subtitle() const override;
108
109private:
110 void changeMaterial(float dt);
111
112 cocos2d::Sprite3D* _sprite;
114};
115
117{
118public:
120
121 virtual void onEnter() override;
122 virtual std::string subtitle() const override;
123};
124
126{
127public:
129
130 virtual void onEnter() override;
131 virtual std::string subtitle() const override;
132 void parsingTesting(unsigned int count);
133protected:
134 unsigned int _maxParsingCoumt;
135};
136
137
138
DEFINE_TEST_SUITE(MaterialSystemTest)
virtual void onEnter() override
void updateCCTimeUniforms(float)
std::vector< Locations > timeUniforms
CREATE_FUNC(Material_2DEffects)
virtual std::string subtitle() const override
EffectAutoBindingResolver * _resolver
virtual void onEnter() override
cocos2d::backend::ProgramState * _noiseProgramState
CREATE_FUNC(Material_AutoBindings)
cocos2d::backend::UniformLocation _locationTime
virtual std::string subtitle() const override
virtual std::string subtitle() const override
CREATE_FUNC(Material_MultipleSprite3D)
virtual void onEnter() override
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(Material_Sprite3DTest)
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(Material_clone)
virtual void onEnter() override
CREATE_FUNC(Material_parsePerformance)
void parsingTesting(unsigned int count)
virtual std::string subtitle() const override
cocos2d::Sprite3D * _sprite
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(Material_setTechnique)
virtual std::string title() const override
Locations(cocos2d::backend::ProgramState *ps, cocos2d::backend::UniformLocation loc)
cocos2d::backend::UniformLocation location
cocos2d::backend::ProgramState * programState