From fb777b1a1d4fab425af305f44e35e607c9005b89 Mon Sep 17 00:00:00 2001 From: shujunqiao Date: Tue, 8 Apr 2014 14:52:17 +0800 Subject: [PATCH] [ci skip], delete ShaderFail sample in ShaderTest.cpp. --- .../Classes/ShaderTest/ShaderTest.cpp | 55 +------------------ .../cpp-tests/Classes/ShaderTest/ShaderTest.h | 8 --- 2 files changed, 1 insertion(+), 62 deletions(-) diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp index db28d8b8f8..259ba79ef6 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.cpp @@ -6,7 +6,7 @@ static int sceneIdx = -1; -#define MAX_LAYER 9 +#define MAX_LAYER 8 static Layer* createShaderLayer(int nIndex) { @@ -20,7 +20,6 @@ static Layer* createShaderLayer(int nIndex) case 5: return new ShaderPlasma(); case 6: return new ShaderBlur(); case 7: return new ShaderRetroEffect(); - case 8: return new ShaderFail(); } return NULL; @@ -745,58 +744,6 @@ std::string ShaderRetroEffect::subtitle() const return "sin() effect with moving colors"; } -// ShaderFail -const GLchar *shader_frag_fail = "\n\ -#ifdef GL_ES \n\ -precision lowp float; \n\ -#endif \n\ -\n\ -varying vec2 v_texCoord; \n\ -uniform sampler2D CC_Texture0; \n\ -\n\ -vec4 colors[10]; \n\ -\n\ -void main(void) \n\ -{ \n\ -colors[0] = vec4(1,0,0,1); \n\ -colors[1] = vec4(0,1,0,1); \n\ -colors[2] = vec4(0,0,1,1); \n\ -colors[3] = vec4(0,1,1,1); \n\ -colors[4] = vec4(1,0,1,1); \n\ -colors[5] = vec4(1,1,0,1); \n\ -colors[6] = vec4(1,1,1,1); \n\ -colors[7] = vec4(1,0.5,0,1); \n\ -colors[8] = vec4(1,0.5,0.5,1); \n\ -colors[9] = vec4(0.5,0.5,1,1); \n\ -\n\ -int y = int( mod(gl_FragCoord.y / 3.0, 10.0 ) ); \n\ -gl_FragColor = colors[y] * texture2D(CC_Texture0, v_texCoord); \n\ -} \n\ -\n"; - -ShaderFail::ShaderFail() -{ - auto p = new GLProgram(); - p->initWithByteArrays(ccPositionTexture_vert, shader_frag_fail); - - p->bindAttribLocation(GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION); - p->bindAttribLocation(GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORDS); - - p->link(); - p->updateUniforms(); - p->release(); -} - -std::string ShaderFail::title() const -{ - return "Shader: Invalid shader"; -} - -std::string ShaderFail::subtitle() const -{ - return "See console for output with useful error log"; -} - ///--------------------------------------- // // ShaderTestScene diff --git a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h index 59e178abc1..ec606e621f 100644 --- a/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h +++ b/tests/cpp-tests/Classes/ShaderTest/ShaderTest.h @@ -137,14 +137,6 @@ protected: CustomCommand _customCommand; }; -class ShaderFail : public ShaderTestDemo -{ -public: - ShaderFail(); - virtual std::string title() const override; - virtual std::string subtitle() const override; -}; - class ShaderTestScene : public TestScene { public: