diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp index 7cfc32de..12bd9c0c 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp +++ b/src/Graphics/OpenGLContext/GLSL/glsl_CombinerProgramBuilder.cpp @@ -197,13 +197,13 @@ public: } else if (_glinfo.isGLESX) { std::stringstream ss; - ss << "#version " << std::to_string(_glinfo.majorVersion) << std::to_string(_glinfo.minorVersion) << "0 es " << std::endl; + ss << "#version " << Utils::to_string(_glinfo.majorVersion) << Utils::to_string(_glinfo.minorVersion) << "0 es " << std::endl; ss << "# define IN in" << std::endl << "# define OUT out" << std::endl; m_part = ss.str(); } else { std::stringstream ss; - ss << "#version " << std::to_string(_glinfo.majorVersion) << std::to_string(_glinfo.minorVersion) << "0 core " << std::endl; + ss << "#version " << Utils::to_string(_glinfo.majorVersion) << Utils::to_string(_glinfo.minorVersion) << "0 core " << std::endl; ss << "# define IN in" << std::endl << "# define OUT out" << std::endl; m_part = ss.str(); } @@ -423,14 +423,14 @@ public: } else if (_glinfo.isGLESX) { std::stringstream ss; - ss << "#version " << std::to_string(_glinfo.majorVersion) << std::to_string(_glinfo.minorVersion) << "0 es " << std::endl; + ss << "#version " << Utils::to_string(_glinfo.majorVersion) << Utils::to_string(_glinfo.minorVersion) << "0 es " << std::endl; ss << "# define IN in" << std::endl << "# define OUT out" << std::endl << "# define texture2D texture" << std::endl; m_part = ss.str(); } else { std::stringstream ss; - ss << "#version " << std::to_string(_glinfo.majorVersion) << std::to_string(_glinfo.minorVersion) << "0 core " << std::endl; + ss << "#version " << Utils::to_string(_glinfo.majorVersion) << Utils::to_string(_glinfo.minorVersion) << "0 core " << std::endl; ss << "# define IN in" << std::endl << "# define OUT out" << std::endl << "# define texture2D texture" << std::endl; diff --git a/src/Graphics/OpenGLContext/GLSL/glsl_Utils.h b/src/Graphics/OpenGLContext/GLSL/glsl_Utils.h index 269277db..8233679a 100644 --- a/src/Graphics/OpenGLContext/GLSL/glsl_Utils.h +++ b/src/Graphics/OpenGLContext/GLSL/glsl_Utils.h @@ -1,5 +1,6 @@ #pragma once #include +#include #include namespace glsl { @@ -10,5 +11,17 @@ namespace glsl { static bool checkProgramLinkStatus(GLuint obj); static void logErrorShader(GLenum _shaderType, const std::string & _strShader); static GLuint createRectShaderProgram(const char * _strVertex, const char * _strFragment); + + template + static std::string to_string(T value) + { +#ifdef ANDROID + std::ostringstream os ; + os << value ; + return os.str() ; +#else + return std::to_string(value); +#endif + } }; }