diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2013-12-10 21:19:37 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2013-12-10 21:19:37 -0700 |
| commit | 5b39ce854345509b92fd9aee76d504eaac87aa65 (patch) | |
| tree | cf3f191fe65f1b248fe21be8c8db12360c8400c3 /sons_of_sol/private_db/ApplicationInit.cpp | |
| parent | 80199c0ef697c6b2d8309c2dcf2e4e466f528d13 (diff) | |
| download | SonsOfSol-5b39ce854345509b92fd9aee76d504eaac87aa65.tar.gz SonsOfSol-5b39ce854345509b92fd9aee76d504eaac87aa65.tar.bz2 SonsOfSol-5b39ce854345509b92fd9aee76d504eaac87aa65.zip | |
added fallback shader
Diffstat (limited to 'sons_of_sol/private_db/ApplicationInit.cpp')
| -rw-r--r-- | sons_of_sol/private_db/ApplicationInit.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sons_of_sol/private_db/ApplicationInit.cpp b/sons_of_sol/private_db/ApplicationInit.cpp index 1794fd5..ea409ed 100644 --- a/sons_of_sol/private_db/ApplicationInit.cpp +++ b/sons_of_sol/private_db/ApplicationInit.cpp @@ -180,8 +180,19 @@ bool SonsOfSolApplication::initialize( int argc, char** argv ) { } m_earth_prog = new GloxProgram() ; + + + printf( "Using GLSL version %s\n", glGetString( GL_SHADING_LANGUAGE_VERSION ) ); + + const char* earth_frag_shader = "shaders/earth.fp"; + float version = atof( (const char*) glGetString( GL_SHADING_LANGUAGE_VERSION ) ); + if( version < 1.29 ) { + fprintf( stderr, "Using version %02f, unfortunately, I must use the fallback shader\n", version ); + earth_frag_shader = "shaders/earth_fallback.fp"; + } + if( m_earth_prog->attachShaderFromFile( "shaders/earth.vp", GL_VERTEX_SHADER ) || - m_earth_prog->attachShaderFromFile( "shaders/earth.fp", GL_FRAGMENT_SHADER ) || + m_earth_prog->attachShaderFromFile( earth_frag_shader, GL_FRAGMENT_SHADER ) || m_earth_prog->link() ) { cerr << "Warning Unable to load shaders: " << GloxShader::getMessage() << endl; |