mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Add special version of to_string for Android.
This commit is contained in:
parent
85fc5ec31f
commit
48cd94ec46
|
@ -197,13 +197,13 @@ public:
|
||||||
}
|
}
|
||||||
else if (_glinfo.isGLESX) {
|
else if (_glinfo.isGLESX) {
|
||||||
std::stringstream ss;
|
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;
|
ss << "# define IN in" << std::endl << "# define OUT out" << std::endl;
|
||||||
m_part = ss.str();
|
m_part = ss.str();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::stringstream ss;
|
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;
|
ss << "# define IN in" << std::endl << "# define OUT out" << std::endl;
|
||||||
m_part = ss.str();
|
m_part = ss.str();
|
||||||
}
|
}
|
||||||
|
@ -423,14 +423,14 @@ public:
|
||||||
}
|
}
|
||||||
else if (_glinfo.isGLESX) {
|
else if (_glinfo.isGLESX) {
|
||||||
std::stringstream ss;
|
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
|
ss << "# define IN in" << std::endl
|
||||||
<< "# define OUT out" << std::endl
|
<< "# define OUT out" << std::endl
|
||||||
<< "# define texture2D texture" << std::endl;
|
<< "# define texture2D texture" << std::endl;
|
||||||
m_part = ss.str();
|
m_part = ss.str();
|
||||||
} else {
|
} else {
|
||||||
std::stringstream ss;
|
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
|
ss << "# define IN in" << std::endl
|
||||||
<< "# define OUT out" << std::endl
|
<< "# define OUT out" << std::endl
|
||||||
<< "# define texture2D texture" << std::endl;
|
<< "# define texture2D texture" << std::endl;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
#include <Graphics/OpenGLContext/GLFunctions.h>
|
#include <Graphics/OpenGLContext/GLFunctions.h>
|
||||||
|
|
||||||
namespace glsl {
|
namespace glsl {
|
||||||
|
@ -10,5 +11,17 @@ namespace glsl {
|
||||||
static bool checkProgramLinkStatus(GLuint obj);
|
static bool checkProgramLinkStatus(GLuint obj);
|
||||||
static void logErrorShader(GLenum _shaderType, const std::string & _strShader);
|
static void logErrorShader(GLenum _shaderType, const std::string & _strShader);
|
||||||
static GLuint createRectShaderProgram(const char * _strVertex, const char * _strFragment);
|
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
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user