From 2a918ab4e08b1ed3246c7bd32e364f0f5df7d416 Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Mon, 25 Jun 2012 18:50:59 -0700 Subject: [PATCH] Added IOS/OSX defines to shaderc. --- src/renderer_gl.h | 13 +++++++++++++ tools/shaderc.cpp | 20 +++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/renderer_gl.h b/src/renderer_gl.h index fbcb03e9..fdc07daa 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -16,6 +16,19 @@ # include # include # undef GL_PROTOTYPES +# elif BX_PLATFORM_OSX +# define GL_PROTOTYPES +# define GL_GLEXT_LEGACY +# define GL_VERSION_1_2 +# define GL_VERSION_1_3 +# define GL_VERSION_1_5 +# define GL_VERSION_2_0 +# include +# undef GL_VERSION_2_0 +# undef GL_VERSION_1_5 +# undef GL_VERSION_1_3 +# undef GL_VERSION_1_2 +# undef GL_PROTOTYPES # else # include # endif // BX_PLATFORM_ diff --git a/tools/shaderc.cpp b/tools/shaderc.cpp index 9b65488b..edc67496 100644 --- a/tools/shaderc.cpp +++ b/tools/shaderc.cpp @@ -678,10 +678,12 @@ int main(int _argc, const char* _argv[]) Preprocessor preprocessor(filePath); preprocessor.setDefaultDefine("BX_PLATFORM_ANDROID"); + preprocessor.setDefaultDefine("BX_PLATFORM_IOS"); + preprocessor.setDefaultDefine("BX_PLATFORM_LINUX"); preprocessor.setDefaultDefine("BX_PLATFORM_NACL"); + preprocessor.setDefaultDefine("BX_PLATFORM_OSX"); preprocessor.setDefaultDefine("BX_PLATFORM_WINDOWS"); preprocessor.setDefaultDefine("BX_PLATFORM_XBOX360"); - preprocessor.setDefaultDefine("BX_PLATFORM_LINUX"); preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_GLSL"); preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_HLSL"); preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_FRAGMENT"); @@ -695,15 +697,27 @@ int main(int _argc, const char* _argv[]) preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); glsl = true; } + else if (0 == _stricmp(platform, "ios") ) + { + preprocessor.setDefine("BX_PLATFORM_IOS=1"); + preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); + glsl = true; + } + else if (0 == _stricmp(platform, "linux") ) + { + preprocessor.setDefine("BX_PLATFORM_IOS=1"); + preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); + glsl = true; + } else if (0 == _stricmp(platform, "nacl") ) { preprocessor.setDefine("BX_PLATFORM_NACL=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); glsl = true; } - else if (0 == _stricmp(platform, "linux")) + else if (0 == _stricmp(platform, "osx") ) { - preprocessor.setDefine("BX_PLATFORM_LINUX=1"); + preprocessor.setDefine("BX_PLATFORM_OSX=1"); preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1"); glsl = true; }