GLuint ShaderAPITest::make_shader(GLenum type, const char *src) { GLuint id; assert_no_error(); id = glCreateShader_func(type); glShaderSource_func(id, 1, &src, NULL); glCompileShader_func(id); check_compile_status(id); assert_no_error(); return id; }
static void LoadAndCompileShader(GLuint shader, const char *text) { GLint stat; glShaderSource_func(shader, 1, (const GLchar **) &text, NULL); glCompileShader_func(shader); glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); if (!stat) { GLchar log[1000]; GLsizei len; glGetShaderInfoLog_func(shader, 1000, &len, log); fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log); exit(1); } }