goat3dgfx

view src/sdrman.cc @ 0:1873dfd13f2d

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 14 Nov 2013 05:27:09 +0200
parents
children 7d6b667821cf
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 }