X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=resource_pool.cpp;h=72b309519062b728d7b1b6ae73d05c0cc5086c9d;hp=4f2cc2b9ade1e6cc98ec50b50eb30fccbd550a55;hb=968ceb4cc1714e745b3f6425b57611864823f444;hpb=cfc161e0289c2169d4835c48751ff56b97355eb2 diff --git a/resource_pool.cpp b/resource_pool.cpp index 4f2cc2b..72b3095 100644 --- a/resource_pool.cpp +++ b/resource_pool.cpp @@ -105,6 +105,15 @@ GLuint ResourcePool::compile_glsl_program(const string& vertex_shader, const str glLinkProgram(glsl_program_num); check_error(); + GLint success; + glGetProgramiv(glsl_program_num, GL_LINK_STATUS, &success); + if (success == GL_FALSE) { + GLchar error_log[1024] = {0}; + glGetProgramInfoLog(glsl_program_num, 1024, NULL, error_log); + fprintf(stderr, "Error linking program: %s\n", error_log); + exit(1); + } + if (movit_debug_level == MOVIT_DEBUG_ON) { // Output shader to a temporary file, for easier debugging. static int compiled_shader_num = 0; @@ -181,8 +190,8 @@ GLuint ResourcePool::create_2d_texture(GLint internal_format, GLsizei width, GLs case GL_RG16F: format = GL_RG; break; - case GL_LUMINANCE8: - format = GL_LUMINANCE; + case GL_R8: + format = GL_RED; break; default: // TODO: Add more here as needed. @@ -250,7 +259,7 @@ size_t ResourcePool::estimate_texture_size(const Texture2D &texture_format) case GL_RG16F: bytes_per_pixel = 4; break; - case GL_LUMINANCE8: + case GL_R8: bytes_per_pixel = 1; break; default: