PuzzleSDK
Texture2dTest.h
浏览该文件的文档.
1/****************************************************************************
2 Copyright (c) 2012 cocos2d-x.org
3 Copyright (c) 2013-2016 Chukong Technologies Inc.
4 Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
5
6 http://www.cocos2d-x.org
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE.
25 ****************************************************************************/
26
27#ifndef __TEXTURE2D_TEST_H__
28#define __TEXTURE2D_TEST_H__
29
30#include "../BaseTest.h"
31
32DEFINE_TEST_SUITE(Texture2DTests);
33
34class TextureDemo : public TestCase
35{
36public:
37 virtual ~TextureDemo();
38 virtual void onEnter() override;
39};
40
41
42class TextureTGA : public TextureDemo
43{
44public:
46 virtual std::string title() const override;
47 virtual void onEnter() override;
48};
49
50class TexturePNG : public TextureDemo
51{
52public:
54 virtual std::string title() const override;
55 virtual std::string subtitle() const override;
56 virtual void onEnter() override;
57};
58
60{
61public:
63 virtual std::string title() const override;
64 virtual void onEnter() override;
65};
66
68{
69public:
71 virtual std::string title() const override;
72 virtual void onEnter() override;
73};
74
76{
77public:
79 virtual std::string title() const override;
80 virtual void onEnter() override;
81};
82
84{
85public:
87 virtual std::string title() const override;
88 virtual std::string subtitle() const override;
89 virtual void onEnter() override;
90};
91
93{
94public:
96 virtual std::string title() const override;
97 virtual void onEnter() override;
98};
99
101{
102public:
104 virtual std::string title() const override;
105 virtual void onEnter() override;
106};
107
109{
110public:
112 virtual std::string title() const override;
113 virtual void onEnter() override;
114};
115
117{
118public:
120 virtual std::string title() const override;
121 virtual void onEnter() override;
122};
123
125{
126public:
128 virtual std::string title() const override;
129 virtual void onEnter() override;
130};
131
133{
134public:
136 virtual std::string title() const override;
137 virtual void onEnter() override;
138};
139
141{
142public:
144 virtual std::string title() const override;
145 virtual std::string subtitle() const override;
146 virtual void onEnter() override;
147};
148
150{
151public:
153 virtual std::string title() const override;
154 virtual std::string subtitle() const override;
155 virtual void onEnter() override;
156};
157
159{
160public:
162 virtual std::string title() const override;
163 virtual void onEnter() override;
164};
165
167{
168public:
170 virtual std::string title() const override;
171 virtual void onEnter() override;
172};
173
175{
176public:
178 virtual std::string title() const override;
179 virtual void onEnter() override;
180};
181
183{
184public:
186 virtual std::string title() const override;
187 virtual void onEnter() override;
188};
189
191{
192public:
194 virtual std::string title() const override;
195 virtual void onEnter() override;
196};
197
199{
200public:
202 virtual std::string title() const override;
203 virtual void onEnter() override;
204};
205
207{
208public:
210 virtual std::string title() const override;
211 virtual std::string subtitle() const override;
212 virtual void onEnter() override;
213};
214
216{
217public:
219 virtual std::string title() const override;
220 virtual std::string subtitle() const override;
221 virtual void onEnter() override;
222};
223
225{
226public:
228 virtual std::string title() const override;
229 virtual std::string subtitle() const override;
230 virtual void onEnter() override;
231};
232
234{
235public:
237 virtual std::string title() const override;
238 virtual std::string subtitle() const override;
239 virtual void onEnter() override;
240};
241
243{
244public:
246 virtual std::string title() const override;
247 virtual std::string subtitle() const override;
248 virtual void onEnter() override;
249};
250
252{
253public:
255 virtual std::string title() const override;
256 virtual std::string subtitle() const override;
257 virtual void onEnter() override;
258};
259
261{
262public:
264 virtual std::string title() const override;
265 virtual std::string subtitle() const override;
266 virtual void onEnter() override;
267};
268
270{
271public:
273 virtual std::string title() const override;
274 virtual std::string subtitle() const override;
275 virtual void onEnter() override;
276};
277
279{
280public:
282 virtual std::string title() const override;
283 virtual std::string subtitle() const override;
284 virtual void onEnter() override;
285};
286
288{
289public:
291 virtual std::string title() const override;
292 virtual std::string subtitle() const override;
293 virtual void onEnter() override;
294};
295
297{
298public:
300 virtual std::string title() const override;
301 virtual std::string subtitle() const override;
302 virtual void onEnter() override;
303};
304
306{
307public:
309 virtual std::string title() const override;
310 virtual std::string subtitle() const override;
311 virtual void onEnter() override;
312};
313
315{
316public:
318 virtual std::string title() const override;
319 virtual std::string subtitle() const override;
320 virtual void onEnter() override;
321};
322
324{
325public:
327 virtual std::string title() const override;
328 virtual std::string subtitle() const override;
329 virtual void onEnter() override;
330};
331
333{
334public:
336 virtual std::string title() const override;
337 virtual std::string subtitle() const override;
338 virtual void onEnter() override;
339};
340
342{
343public:
345 virtual std::string title() const override;
346 virtual std::string subtitle() const override;
347 virtual void onEnter() override;
348};
349
351{
352public:
354 virtual std::string title() const override;
355 virtual std::string subtitle() const override;
356 virtual void onEnter() override;
357};
358
360{
361public:
363 virtual std::string title() const override;
364 virtual std::string subtitle() const override;
365 virtual void onEnter() override;
366};
367
369{
370public:
372 virtual std::string title() const override;
373 virtual std::string subtitle() const override;
374 virtual void onEnter() override;
375};
376
378{
379public:
381 virtual std::string title() const override;
382 virtual std::string subtitle() const override;
383 virtual void onEnter() override;
384};
385
387{
388public:
390 virtual std::string title() const override;
391 virtual std::string subtitle() const override;
392 virtual void onEnter() override;
393};
394
396{
397public:
399 virtual std::string title() const override;
400 virtual std::string subtitle() const override;
401 virtual void onEnter() override;
402};
403
405{
406public:
408 virtual ~TextureAsync();
409
410 virtual float getDuration() const override { return 5.0f; }
411 void loadImages(float dt);
412 void imageLoaded(cocos2d::Texture2D* texture);
413 virtual std::string title() const override;
414 virtual std::string subtitle() const override;
415 virtual void onEnter() override;
416private:
418};
419
421{
422public:
424 virtual ~TextureGlRepeat();
425 virtual std::string title() const override;
426
427 virtual void onEnter() override;
428};
429
431{
432public:
434 virtual ~TextureGlClamp();
435 virtual std::string title() const override;
436
437 virtual void onEnter() override;
438};
439
441{
442public:
444 virtual std::string title() const override;
445 virtual std::string subtitle() const override;
446 virtual void onEnter() override;
447};
448
450{
451public:
453 virtual std::string title() const override;
454 virtual std::string subtitle() const override;
455 virtual void onEnter() override;
456};
457
459{
460public:
463 virtual std::string title() const override;
464 virtual std::string subtitle() const override;
465 virtual void onEnter() override;
466 virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
467protected:
468 void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
469
470 cocos2d::Texture2D* _tex1, *_Tex2F;
471};
472
474{
475public:
478 virtual std::string title() const override;
479 virtual std::string subtitle() const override;
480 virtual void onEnter() override;
481 virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
482protected:
483 void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
484
485 cocos2d::Texture2D* _tex1, *_Tex2F;
486};
487
489{
490public:
492 virtual void onEnter() override;
493 virtual std::string title() const override;
494 virtual std::string subtitle() const override;
495 void updateImage(cocos2d::Ref* sender);
496 void changeBackgroundVisible(cocos2d::Ref* sender);
497private:
498 cocos2d::Sprite* _background;
499};
500
502{
503public:
506
507 virtual std::string title() const override;
508 virtual std::string subtitle() const override;
509
510 void transformSprite(cocos2d::Sprite *sprite);
511};
512
513// ETC1 texture format test
515{
516public:
518 TextureETC1();
519
520 virtual std::string title() const override;
521 virtual std::string subtitle() const override;
522};
523
524// S3TC Dxt1 texture format test
526{
527public:
530
531 virtual std::string title() const override;
532 virtual std::string subtitle() const override;
533};
534
535// S3TC Dxt3 texture format test
537{
538public:
541
542 virtual std::string title() const override;
543 virtual std::string subtitle() const override;
544};
545
546// S3TC Dxt5 texture format test
548{
549public:
552
553 virtual std::string title() const override;
554 virtual std::string subtitle() const override;
555};
556
557
558// S3TC texture with no mipmaps test
560{
561public:
564
565 virtual std::string title() const override;
566};
567
568// ATITC RGB texture format test
570{
571public:
574
575 virtual std::string title() const override;
576 virtual std::string subtitle() const override;
577};
578
579//ATITC RGBA Explicit texture format test
581{
582public:
585
586 virtual std::string title() const override;
587 virtual std::string subtitle() const override;
588};
589
590//ATITC RGBA Interpolated texture format test
592{
593public:
596
597 virtual std::string title() const override;
598 virtual std::string subtitle() const override;
599};
600
601
602// RGB888 texture convert test
604{
605public:
607 virtual void onEnter() override;
608 virtual std::string title() const override;
609 virtual std::string subtitle() const override;
610};
611
612// RGBA8888 texture convert test
614{
615public:
617 virtual void onEnter() override;
618 virtual std::string title() const override;
619 virtual std::string subtitle() const override;
620};
621
622// I8 texture convert test
624{
625public:
627 virtual void onEnter() override;
628 virtual std::string title() const override;
629 virtual std::string subtitle() const override;
630};
631
632// AI88 texture convert test
634{
635public:
637 virtual void onEnter() override;
638 virtual std::string title() const override;
639 virtual std::string subtitle() const override;
640};
641
642#endif // __TEXTURE2D_TEST_H__
DEFINE_TEST_SUITE(Texture2DTests)
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TextureATITCExplicit)
virtual std::string subtitle() const override
CREATE_FUNC(TextureATITCInterpolated)
virtual std::string title() const override
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TextureATITCRGB)
virtual std::string subtitle() const override
virtual std::string title() const override
CREATE_FUNC(TextureAlias)
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TextureAsync)
void imageLoaded(cocos2d::Texture2D *texture)
virtual void onEnter() override
virtual float getDuration() const override
virtual ~TextureAsync()
virtual std::string subtitle() const override
void loadImages(float dt)
virtual std::string subtitle() const override
CREATE_FUNC(TextureBlend)
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TextureCache1)
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TextureConvertAI88)
virtual std::string subtitle() const override
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(TextureConvertI8)
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TextureConvertRGB888)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TextureConvertRGBA8888)
virtual std::string title() const override
virtual void onEnter() override
virtual ~TextureDemo()
void onDraw(const cocos2d::Mat4 &transform, uint32_t flags)
virtual void onEnter() override
cocos2d::Texture2D * _tex1
virtual std::string title() const override
virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) override
cocos2d::Texture2D * _Tex2F
virtual std::string subtitle() const override
CREATE_FUNC(TextureDrawAtPoint)
virtual void onEnter() override
virtual std::string title() const override
cocos2d::Texture2D * _Tex2F
virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) override
virtual std::string subtitle() const override
CREATE_FUNC(TextureDrawInRect)
cocos2d::Texture2D * _tex1
void onDraw(const cocos2d::Mat4 &transform, uint32_t flags)
virtual std::string subtitle() const override
CREATE_FUNC(TextureETC1)
virtual std::string title() const override
virtual void onEnter() override
virtual ~TextureGlClamp()
CREATE_FUNC(TextureGlClamp)
virtual std::string title() const override
CREATE_FUNC(TextureGlRepeat)
virtual ~TextureGlRepeat()
virtual std::string title() const override
virtual void onEnter() override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TextureJPEG)
virtual void onEnter() override
virtual std::string subtitle() const override
cocos2d::Sprite * _background
void updateImage(cocos2d::Ref *sender)
void changeBackgroundVisible(cocos2d::Ref *sender)
CREATE_FUNC(TextureMemoryAlloc)
virtual std::string title() const override
CREATE_FUNC(TextureMipMap)
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePNG)
virtual std::string title() const override
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVR2BPP)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVR2BPPv3)
virtual std::string title() const override
CREATE_FUNC(TexturePVR4BPP)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVR4BPPv3)
virtual std::string title() const override
virtual std::string title() const override
CREATE_FUNC(TexturePVRA8)
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRA8v3)
virtual void onEnter() override
virtual std::string subtitle() const override
virtual std::string title() const override
CREATE_FUNC(TexturePVRAI88)
virtual void onEnter() override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRAI88v3)
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRBGRA8888)
virtual std::string title() const override
CREATE_FUNC(TexturePVRBGRA8888v3)
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRBadEncoding)
virtual std::string title() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRI8)
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRI8v3)
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVRII2BPPv3)
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRII4BPPv3)
virtual std::string title() const override
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVRMipMap2)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVRMipMap)
CREATE_FUNC(TexturePVRNPOT4444)
virtual std::string subtitle() const override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRNPOT8888)
virtual void onEnter() override
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRNonSquare)
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVRRGB565)
virtual void onEnter() override
virtual std::string title() const override
virtual std::string subtitle() const override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGB565v3)
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGB888)
virtual std::string title() const override
virtual std::string title() const override
CREATE_FUNC(TexturePVRRGB888v3)
virtual std::string subtitle() const override
virtual void onEnter() override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGBA4444CCZ)
virtual std::string subtitle() const override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGBA4444GZ)
virtual std::string subtitle() const override
virtual std::string title() const override
CREATE_FUNC(TexturePVRRGBA4444)
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGBA4444v3)
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TexturePVRRGBA5551)
virtual void onEnter() override
virtual std::string subtitle() const override
virtual std::string title() const override
CREATE_FUNC(TexturePVRRGBA5551v3)
virtual void onEnter() override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGBA8888)
virtual std::string subtitle() const override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRRGBA8888v3)
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TexturePVRTest)
virtual std::string title() const override
void transformSprite(cocos2d::Sprite *sprite)
virtual std::string subtitle() const override
CREATE_FUNC(TexturePVRv3Premult)
CREATE_FUNC(TexturePixelFormat)
virtual std::string subtitle() const override
virtual void onEnter() override
virtual std::string title() const override
CREATE_FUNC(TextureS3TCDxt1)
virtual std::string subtitle() const override
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TextureS3TCDxt3)
virtual std::string title() const override
CREATE_FUNC(TextureS3TCDxt5)
virtual std::string title() const override
virtual std::string subtitle() const override
CREATE_FUNC(TextureS3TCWithNoMipmaps)
virtual std::string title() const override
CREATE_FUNC(TextureSizeTest)
virtual std::string title() const override
virtual std::string subtitle() const override
virtual void onEnter() override
CREATE_FUNC(TextureTGA)
virtual void onEnter() override
virtual std::string title() const override
virtual std::string title() const override
virtual void onEnter() override
CREATE_FUNC(TextureWEBP)
CREATE_FUNC(TextureWEBPNoAlpha)
virtual void onEnter() override
virtual std::string title() const override