vrshoot

annotate src/sdrman.cc @ 3:c179c72369be

rename candy->vr
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 03 Feb 2014 08:52:13 +0200
parents
children
rev   line source
nuclear@0 1 #include "sdrman.h"
nuclear@0 2
nuclear@0 3 ShaderSet vsdrset(GL_VERTEX_SHADER);
nuclear@0 4 ShaderSet psdrset(GL_FRAGMENT_SHADER);
nuclear@0 5
nuclear@0 6 ShaderProg *get_sdrprog(const char *vname, const char *pname)
nuclear@0 7 {
nuclear@0 8 Shader *vsdr = vname ? vsdrset.get(vname) : 0;
nuclear@0 9 Shader *psdr = pname ? psdrset.get(pname) : 0;
nuclear@0 10
nuclear@0 11 if(vname && !vsdr) {
nuclear@0 12 return 0;
nuclear@0 13 }
nuclear@0 14 if(pname && !psdr) {
nuclear@0 15 return 0;
nuclear@0 16 }
nuclear@0 17 if(!vsdr && !psdr) {
nuclear@0 18 return 0;
nuclear@0 19 }
nuclear@0 20
nuclear@0 21 ShaderProg *prog = new ShaderProg;
nuclear@0 22 if(!prog->create(vsdr, psdr)) {
nuclear@0 23 delete prog;
nuclear@0 24 return 0;
nuclear@0 25 }
nuclear@0 26 return prog;
nuclear@0 27 }