vrshoot
view src/sdrman.cc @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line source
1 #include "sdrman.h"
3 ShaderSet vsdrset(GL_VERTEX_SHADER);
4 ShaderSet psdrset(GL_FRAGMENT_SHADER);
6 ShaderProg *get_sdrprog(const char *vname, const char *pname)
7 {
8 Shader *vsdr = vname ? vsdrset.get(vname) : 0;
9 Shader *psdr = pname ? psdrset.get(pname) : 0;
11 if(vname && !vsdr) {
12 return 0;
13 }
14 if(pname && !psdr) {
15 return 0;
16 }
17 if(!vsdr && !psdr) {
18 return 0;
19 }
21 ShaderProg *prog = new ShaderProg;
22 if(!prog->create(vsdr, psdr)) {
23 delete prog;
24 return 0;
25 }
26 return prog;
27 }