Added IOS/OSX defines to shaderc.

This commit is contained in:
bkaradzic 2012-06-25 18:50:59 -07:00
parent 42271092a0
commit 2a918ab4e0
2 changed files with 30 additions and 3 deletions

View file

@ -16,6 +16,19 @@
# include <GL/gl.h>
# include <GL/glx.h>
# 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 <OpenGL/gl.h>
# 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 <GL/gl.h>
# endif // BX_PLATFORM_

View file

@ -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;
}