Commit 6859209c authored by Tobias WEBER's avatar Tobias WEBER

gl version defines

parent 68c5b1e4
......@@ -16,10 +16,13 @@
#include <iostream>
#include <boost/scope_exit.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/algorithm/string/replace.hpp>
namespace algo = boost::algorithm;
#pragma message("Compiling for GL version " BOOST_PP_STRINGIZE(_GL_MAJ_VER) "." BOOST_PP_STRINGIZE(_GL_MIN_VER) " and GLSL version " BOOST_PP_STRINGIZE(_GLSL_MAJ_VER) BOOST_PP_STRINGIZE(_GLSL_MIN_VER) "0.")
// ----------------------------------------------------------------------------
void set_gl_format(bool bCore, int iMajorVer, int iMinorVer, int iSamples)
......@@ -666,7 +669,7 @@ void main()
// set glsl version and constants
const std::string strGlsl = std::to_string(_GL_MAJ_VER*100 + _GL_MIN_VER*10);
const std::string strGlsl = std::to_string(_GLSL_MAJ_VER*100 + _GLSL_MIN_VER*10);
const std::string strPi = std::to_string(m::pi<t_real_gl>);
for(std::string* strSrc : { &strFragShader, &strVertexShader })
{
......
......@@ -39,8 +39,36 @@
#define _GL_MIN_VER 3
#endif
#if !defined(_GL_SUFFIX)
#if _GL_MAJ_VER<=3 && _GL_MIN_VER<2
#if !defined(_GL_SUFFIX)
#define _GL_SUFFIX
#endif
#if _GL_MAJ_VER==3 && _GL_MIN_VER==1
#define _GLSL_MAJ_VER 1
#define _GLSL_MIN_VER 4
#elif _GL_MAJ_VER==3 && _GL_MIN_VER==0
#define _GLSL_MAJ_VER 1
#define _GLSL_MIN_VER 3
#elif _GL_MAJ_VER==2 && _GL_MIN_VER==1
#define _GLSL_MAJ_VER 1
#define _GLSL_MIN_VER 2
#elif _GL_MAJ_VER==2 && _GL_MIN_VER==0
#define _GLSL_MAJ_VER 1
#define _GLSL_MIN_VER 1
#endif
#else
#if !defined(_GL_SUFFIX)
#define _GL_SUFFIX _Core
#endif
#if _GL_MAJ_VER==3 && _GL_MIN_VER==2
#define _GLSL_MAJ_VER 1
#define _GLSL_MIN_VER 5
#else
#define _GLSL_MAJ_VER _GL_MAJ_VER
#define _GLSL_MIN_VER _GL_MIN_VER
#endif
#endif
// GL functions include
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment