goat3dgfx

view src/sdrman.cc @ 19:7aea3639c411

fixed uninitialized idata_valid variable in Mesh
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 08 Dec 2013 02:18:37 +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