1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-10-06 09:07:19 +02:00

Fix segfault when failed to create shader object

This commit is contained in:
George Popoff 2019-02-09 19:45:13 +03:00 committed by Anonymous Maarten
parent d55fb3f0e5
commit 9b4ebc105c

View File

@ -17,6 +17,12 @@ constexpr GLuint kUBOIndexDraw = 2;
GLuint compileShader(GLenum type, const char* source) {
GLuint shader = glCreateShader(type);
if (shader == 0) {
RW_ERROR("[OGL] Failed to create shader object");
throw std::runtime_error("Compiling shader failed");
}
glShaderSource(shader, 1, &source, nullptr);
glCompileShader(shader);