Skip to content

Commit 36c5980

Browse files
j-w-c-bSiegeLord
authored andcommitted
Don't call opengl from src/shader.c
1 parent 0b135ad commit 36c5980

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/shader.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,13 @@ char const *al_get_default_shader_source(ALLEGRO_SHADER_PLATFORM platform,
418418
bool use_gl3_shader = false;
419419
#ifdef ALLEGRO_MACOSX
420420
{
421+
ALLEGRO_DISPLAY *display = al_get_current_display();
422+
423+
421424
/* Apple's glsl implementation supports either 1.20 shaders, or strictly
422425
* versioned 3.2+ shaders which do not use deprecated features.
423426
*/
424-
const char * shader_language = glGetString(GL_SHADING_LANGUAGE_VERSION);
425-
if (strcmp(shader_language, "1.20") != 0) {
427+
if (display && (display->flags & ALLEGRO_OPENGL_3_0)) {
426428
use_gl3_shader = true;
427429
}
428430
}

0 commit comments

Comments
 (0)