From 9b277bea387581e130444e244031a753a391e873 Mon Sep 17 00:00:00 2001 From: hybrid Date: Fri, 14 Jan 2011 17:30:24 +0000 Subject: [PATCH] Make shader path for ogles2 configurable via define. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@3561 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/IrrCompileConfig.h | 9 +++++++++ source/Irrlicht/COGLES2FixedPipelineShader.cpp | 4 ++-- source/Irrlicht/COGLES2NormalMapRenderer.cpp | 4 ++-- source/Irrlicht/COGLES2ParallaxMapRenderer.cpp | 4 ++-- source/Irrlicht/COGLES2Renderer2D.cpp | 4 ++-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index f3b5c842..847fa253 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -172,6 +172,9 @@ it should be usually the only HW accelerated one. OpenGL is currently disabled if using this driver, to avoid problems with the ogl-es emulators. */ //#define _IRR_COMPILE_WITH_OGLES1_ +#ifdef NO_IRR_COMPILE_WITH_OGLES1_ +#undef _IRR_COMPILE_WITH_OGLES1_ +#endif //! Define _IRR_COMPILE_WITH_OGLES2_ to compile the Irrlicht engine with OpenGL-ES 2.x. /** If you do not wish the engine to be compiled with OpenGL-ES 2.x, comment @@ -181,6 +184,12 @@ it should be usually the only HW accelerated one. OpenGL is currently disabled if using this driver, to avoid problems with the ogl-es emulators. */ //#define _IRR_COMPILE_WITH_OGLES2_ +#ifdef NO_IRR_COMPILE_WITH_OGLES2_ +#undef _IRR_COMPILE_WITH_OGLES2_ +#endif +#ifndef IRR_OGLES2_SHADER_PATH +#define IRR_OGLES2_SHADER_PATH "../../media/Shaders/" +#endif //! Define _IRR_COMPILE_WITH_SOFTWARE_ to compile the Irrlicht engine with software driver /** If you do not need the software driver, or want to use Burning's Video instead, diff --git a/source/Irrlicht/COGLES2FixedPipelineShader.cpp b/source/Irrlicht/COGLES2FixedPipelineShader.cpp index 3aa0a1a4..6a308272 100644 --- a/source/Irrlicht/COGLES2FixedPipelineShader.cpp +++ b/source/Irrlicht/COGLES2FixedPipelineShader.cpp @@ -57,8 +57,8 @@ namespace irr 0 }; - const c8 VertexShaderFile[] = "../../media/Shaders/COGLES2FixedPipeline.vsh"; - const c8 FragmentShaderFile[] = "../../media/Shaders/COGLES2FixedPipeline.fsh"; + const c8 VertexShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2FixedPipeline.vsh"; + const c8 FragmentShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2FixedPipeline.fsh"; COGLES2FixedPipelineShader::COGLES2FixedPipelineShader( video::COGLES2Driver *driver, io::IFileSystem* fs ) : COGLES2SLMaterialRenderer( driver, fs, 0, 0, sBuiltInShaderUniformNames, UNIFORM_COUNT ), Normalize( 0 ), AlphaTest( 0 ), AlphaValue( 0.f ), diff --git a/source/Irrlicht/COGLES2NormalMapRenderer.cpp b/source/Irrlicht/COGLES2NormalMapRenderer.cpp index 9324ed43..b8214b1c 100644 --- a/source/Irrlicht/COGLES2NormalMapRenderer.cpp +++ b/source/Irrlicht/COGLES2NormalMapRenderer.cpp @@ -32,8 +32,8 @@ namespace irr }; // Irrlicht Engine OGLES2 render path normal map vertex shader - const c8 VertexShaderFile[] = "../../media/Shaders/COGLES2NormalMap.vsh"; - const c8 FragmentShaderFile[] = "../../media/Shaders/COGLES2NormalMap.fsh"; + const c8 VertexShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2NormalMap.vsh"; + const c8 FragmentShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2NormalMap.fsh"; //! Constructor diff --git a/source/Irrlicht/COGLES2ParallaxMapRenderer.cpp b/source/Irrlicht/COGLES2ParallaxMapRenderer.cpp index c78e5dd6..fd8d657d 100644 --- a/source/Irrlicht/COGLES2ParallaxMapRenderer.cpp +++ b/source/Irrlicht/COGLES2ParallaxMapRenderer.cpp @@ -35,8 +35,8 @@ namespace irr }; // Irrlicht Engine OGLES2 render path normal map vertex shader - const c8 VertexShaderFile[] = "../../media/Shaders/COGLES2ParallaxMap.vsh"; - const c8 FragmentShaderFile[] = "../../media/Shaders/COGLES2ParallaxMap.fsh"; + const c8 VertexShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2ParallaxMap.vsh"; + const c8 FragmentShaderFile[] = IRR_OGLES2_SHADER_PATH "COGLES2ParallaxMap.fsh"; //! Constructor COGLES2ParallaxMapRenderer::COGLES2ParallaxMapRenderer( video::COGLES2Driver* driver, diff --git a/source/Irrlicht/COGLES2Renderer2D.cpp b/source/Irrlicht/COGLES2Renderer2D.cpp index 058ae797..bf870fd6 100644 --- a/source/Irrlicht/COGLES2Renderer2D.cpp +++ b/source/Irrlicht/COGLES2Renderer2D.cpp @@ -22,8 +22,8 @@ namespace irr 0 }; - static const char* vertexShaderFile = "../../media/Shaders/COGLES2Renderer2D.vsh"; - static const char* fragmentShaderFile = "../../media/Shaders/COGLES2Renderer2D.fsh"; + static const char* vertexShaderFile = IRR_OGLES2_SHADER_PATH "COGLES2Renderer2D.vsh"; + static const char* fragmentShaderFile = IRR_OGLES2_SHADER_PATH "COGLES2Renderer2D.fsh"; COGLES2Renderer2d::COGLES2Renderer2d( irr::video::COGLES2Driver *driver, irr::io::IFileSystem *fs ) : COGLES2SLMaterialRenderer( driver, fs, 0, 0, sBuiltInShaderUniformNames, UNIFORM_COUNT )