ld33_umonster
view src/shader.cc @ 2:35349df5392d
wtf?
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 22 Aug 2015 23:55:21 +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 }