goat3dgfx

view src/sdrman.cc @ 10:b4c9a24c946e

wrote an awesome configure script added "main" 3d engine source file with global init/cleanup
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 24 Nov 2013 13:30:44 +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 }