11 bool Shader::load(const char *fname, SType type)
19 fprintf(stderr, "Invalid shader type used in loading.\n");
26 if(!(fp = fopen(fname, "rb"))) {
27 fprintf(stderr, "Failed to open shader: %s\n", fname);
30 fseek(fp, 0, SEEK_END);
34 char *buf = new char[fsz + 1];
36 if(fread(buf, 1, fsz, fp) < fsz) {
37 fprintf(stderr, "Failed to read shader: %s\n", fname);
46 return create(buf, fsz, fname);
49 SType Shader::get_type()
54 ShaderProgram::ShaderProgram()
56 int len = sizeof shaders / sizeof *shaders;
57 for(int i=0; i<len; ++i) {
62 ShaderProgram::~ShaderProgram()
64 int len = sizeof shaders / sizeof *shaders;
66 for(int i=0; i<len; ++i) {