Mercurial > repos > blastem
comparison render_sdl.c @ 2523:573da2a2e6bb
Fix debug window crash on Mac OS
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 24 Oct 2024 21:08:10 -0700 |
parents | 50cff4c9286e |
children | f4a471730ba4 |
comparison
equal
deleted
inserted
replaced
2522:1de9eb7cbf38 | 2523:573da2a2e6bb |
---|---|
1552 #ifndef DISABLE_OPENGL | 1552 #ifndef DISABLE_OPENGL |
1553 if (render_gl) { | 1553 if (render_gl) { |
1554 extras[win_idx].gl_context = SDL_GL_CreateContext(extras[win_idx].win); | 1554 extras[win_idx].gl_context = SDL_GL_CreateContext(extras[win_idx].win); |
1555 SDL_GL_MakeCurrent(extras[win_idx].win, extras[win_idx].gl_context); | 1555 SDL_GL_MakeCurrent(extras[win_idx].win, extras[win_idx].gl_context); |
1556 glEnable(GL_DEBUG_OUTPUT); | 1556 glEnable(GL_DEBUG_OUTPUT); |
1557 glDebugMessageCallback(gl_message_callback, NULL); | 1557 if (glDebugMessageCallback) { |
1558 glDebugMessageCallback(gl_message_callback, NULL); | |
1559 } | |
1558 glGenTextures(2, extras[win_idx].gl_texture); | 1560 glGenTextures(2, extras[win_idx].gl_texture); |
1559 for (int i = 0; i < 2; i++) | 1561 for (int i = 0; i < 2; i++) |
1560 { | 1562 { |
1561 glBindTexture(GL_TEXTURE_2D, extras[win_idx].gl_texture[i]); | 1563 glBindTexture(GL_TEXTURE_2D, extras[win_idx].gl_texture[i]); |
1562 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 1564 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |