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);
31 fseek(fp, 0, SEEK_END);
35 char *buf = new char[fsz + 1];
37 if(fread(buf, 1, fsz, fp) < fsz) {
38 fprintf(stderr, "Failed to read shader: %s\n", fname);
47 create(buf, fsz, fname);
51 SType Shader::get_type()
56 ShaderProgram::ShaderProgram()
58 int len = sizeof shaders / sizeof *shaders;
59 for(int i=0; i<len; ++i) {
64 ShaderProgram::~ShaderProgram()
66 int len = sizeof shaders / sizeof *shaders;
68 for(int i=0; i<len; ++i) {