goat3dgfx
diff src/shader.cc @ 18:6f82b9b6d6c3
added the ability to render in fixed function with the mesh class
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 08 Dec 2013 01:35:30 +0200 |
parents | 7d6b667821cf |
children | dc5918c62a64 |
line diff
1.1 --- a/src/shader.cc Sun Dec 01 02:25:29 2013 +0200 1.2 +++ b/src/shader.cc Sun Dec 08 01:35:30 2013 +0200 1.3 @@ -26,6 +26,24 @@ 1.4 1.5 ShaderProg *ShaderProg::current; 1.6 1.7 +void goatgfx::bind_shader(const ShaderProg *sdr) 1.8 +{ 1.9 + if(sdr) { 1.10 + sdr->bind(); 1.11 + } else { 1.12 +#ifndef GL_ES_VERSION_2_0 1.13 + glUseProgram(0); 1.14 + ShaderProg::current = 0; 1.15 +#endif 1.16 + } 1.17 +} 1.18 + 1.19 +const ShaderProg *goatgfx::get_current_shader() 1.20 +{ 1.21 + return ShaderProg::current; 1.22 +} 1.23 + 1.24 + 1.25 Shader::Shader() 1.26 { 1.27 sdr = type = 0;