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:
parent
d55fb3f0e5
commit
9b4ebc105c
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user