ld33_umonster
view src/shader.cc @ 4:7b1fa527b51b
added torus mesh gen
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 23 Aug 2015 04:31:29 +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 }