goat3dgfx

view src/sdrman.cc @ 22:92bfb0206969

- made all XFormNode functions virtual - added XFormNode::get_parent()
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 28 Dec 2013 06:48:23 +0200
parents 1873dfd13f2d
children
line source
1 #include "sdrman.h"
3 using namespace goatgfx;
5 namespace goatgfx {
7 ShaderSet vsdrset(GL_VERTEX_SHADER);
8 ShaderSet psdrset(GL_FRAGMENT_SHADER);
10 ShaderProg *get_sdrprog(const char *vname, const char *pname)
11 {
12 Shader *vsdr = vname ? vsdrset.get(vname) : 0;
13 Shader *psdr = pname ? psdrset.get(pname) : 0;
15 if(vname && !vsdr) {
16 return 0;
17 }
18 if(pname && !psdr) {
19 return 0;
20 }
21 if(!vsdr && !psdr) {
22 return 0;
23 }
25 ShaderProg *prog = new ShaderProg;
26 if(!prog->create(vsdr, psdr)) {
27 delete prog;
28 return 0;
29 }
30 return prog;
31 }
33 } // namespace goatgfx