ld33_umonster
view 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 |
line source
1 #include "shader.h"
2 #include "sdr.h"
4 static unsigned int cur_sdr;
5 static unsigned int sover;
7 void set_shader(unsigned int sdr)
8 {
9 cur_sdr = sdr;
10 if(!sover) {
11 bind_program(sdr);
12 }
13 }
15 unsigned int current_shader()
16 {
17 return sover ? sover : cur_sdr;
18 }
20 void override_shader(unsigned int sdr)
21 {
22 sover = sdr;
23 if(sover) {
24 bind_program(sdr);
25 } else {
26 bind_program(cur_sdr);
27 }
28 }