Skip to content

Commit cb90d28

Browse files
committed
GLSL: Provide a dynamic #version directive to the shaders, in line with OpenGL standards
1 parent e4c98e8 commit cb90d28

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

code/graphics/gropenglshader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ void opengl_shader_shutdown()
304304
static char *opengl_load_shader(shader_type type_id, char *filename, int flags)
305305
{
306306
SCP_string sflags;
307+
char version_string[15];
308+
309+
sprintf(version_string, "#version %d \n", GLSL_version);
310+
sflags += version_string;
307311

308-
#ifdef __APPLE__
309-
sflags += "#version 120\n";
310-
#endif
311-
312312
if (GLSL_version >= 330) {
313313
sflags += "#define GLSL_VERSION 330\n";
314314
}

0 commit comments

Comments
 (0)