1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Add special version of to_string for Android.

This commit is contained in:
Francisco Zurita 2017-01-29 22:09:45 +07:00 committed by Sergey Lipskiy
parent 85fc5ec31f
commit 48cd94ec46
2 changed files with 17 additions and 4 deletions

View File

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

View File

@ -1,5 +1,6 @@
#pragma once
#include <string>
#include <sstream>
#include <Graphics/OpenGLContext/GLFunctions.h>
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 <typename T>
static std::string to_string(T value)
{
#ifdef ANDROID
std::ostringstream os ;
os << value ;
return os.str() ;
#else
return std::to_string(value);
#endif
}
};
}