vrshoot
view src/sdrman.cc @ 2:334d17aed7de
visual studio project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Feb 2014 18:36:38 +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 }