ld33_umonster
annotate src/shader.cc @ 10:1b30bd381667
sweep curve mesh gen and dragon horns
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 27 Aug 2015 05:25:04 +0300 |
parents | |
children |
rev | line source |
---|---|
nuclear@0 | 1 #include "shader.h" |
nuclear@0 | 2 #include "sdr.h" |
nuclear@0 | 3 |
nuclear@0 | 4 static unsigned int cur_sdr; |
nuclear@0 | 5 static unsigned int sover; |
nuclear@0 | 6 |
nuclear@0 | 7 void set_shader(unsigned int sdr) |
nuclear@0 | 8 { |
nuclear@0 | 9 cur_sdr = sdr; |
nuclear@0 | 10 if(!sover) { |
nuclear@0 | 11 bind_program(sdr); |
nuclear@0 | 12 } |
nuclear@0 | 13 } |
nuclear@0 | 14 |
nuclear@0 | 15 unsigned int current_shader() |
nuclear@0 | 16 { |
nuclear@0 | 17 return sover ? sover : cur_sdr; |
nuclear@0 | 18 } |
nuclear@0 | 19 |
nuclear@0 | 20 void override_shader(unsigned int sdr) |
nuclear@0 | 21 { |
nuclear@0 | 22 sover = sdr; |
nuclear@0 | 23 if(sover) { |
nuclear@0 | 24 bind_program(sdr); |
nuclear@0 | 25 } else { |
nuclear@0 | 26 bind_program(cur_sdr); |
nuclear@0 | 27 } |
nuclear@0 | 28 } |