Skip to content

Commit da4c871

Browse files
SiegeLordExSiegeLord
authored andcommitted
Remove the accidentally added #version 330 from the non-GL3 shader.
Also, add support for forcing GL3 shaders when forward-compatible context is requested.
1 parent 7854e7d commit da4c871

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/shader.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,19 +416,19 @@ char const *al_get_default_shader_source(ALLEGRO_SHADER_PLATFORM platform,
416416
{
417417
(void)type;
418418
bool use_gl3_shader = false;
419+
ALLEGRO_DISPLAY *display = al_get_current_display();
419420
#ifdef ALLEGRO_MACOSX
420-
{
421-
ALLEGRO_DISPLAY *display = al_get_current_display();
422-
423-
424-
/* Apple's glsl implementation supports either 1.20 shaders, or strictly
425-
* versioned 3.2+ shaders which do not use deprecated features.
426-
*/
427-
if (display && (display->flags & ALLEGRO_OPENGL_3_0)) {
428-
use_gl3_shader = true;
429-
}
421+
/* Apple's glsl implementation supports either 1.20 shaders, or strictly
422+
* versioned 3.2+ shaders which do not use deprecated features.
423+
*/
424+
if (display && (display->flags & ALLEGRO_OPENGL_3_0)) {
425+
use_gl3_shader = true;
430426
}
431427
#endif
428+
if (display && (display->flags & (ALLEGRO_OPENGL_3_0 | ALLEGRO_OPENGL_FORWARD_COMPATIBLE))) {
429+
use_gl3_shader = true;
430+
}
431+
432432
switch (resolve_platform(al_get_current_display(), platform)) {
433433
case ALLEGRO_SHADER_GLSL:
434434
#ifdef ALLEGRO_CFG_SHADER_GLSL

src/shader_source.inc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static const char *default_glsl_vertex_source =
3838
"}\n";
3939

4040
static const char *default_glsl_pixel_source =
41-
"#version 330 core\n"
4241
"#ifdef GL_ES\n"
4342
"precision lowp float;\n"
4443
"#endif\n"

0 commit comments

Comments
 (0)