#52 fixes macOS OpenGL core profile
This commit is contained in:
parent
7229a2a34e
commit
05d665dea9
3 changed files with 60 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include "opengl_utils.h"
|
||||
#include "dd.h"
|
||||
|
||||
PFNWGLCREATECONTEXTPROC xwglCreateContext;
|
||||
PFNWGLDELETECONTEXTPROC xwglDeleteContext;
|
||||
|
@ -209,7 +210,7 @@ void oglu_init()
|
|||
glEnableVertexAttribArray && glUniform2fv && glUniformMatrix4fv && glGenVertexArrays && glBindVertexArray &&
|
||||
glGetUniformLocation;
|
||||
|
||||
if (g_oglu_got_version3 && glversion && glversion[0] == '2') // macOS
|
||||
if (g_ddraw->wine && glversion && glversion[0] == '2') // macOS
|
||||
{
|
||||
g_oglu_got_version3 = FALSE;
|
||||
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)xwglGetProcAddress("wglCreateContextAttribsARB");
|
||||
|
|
|
@ -79,8 +79,8 @@ static HGLRC ogl_create_core_context(HDC hdc)
|
|||
|
||||
if (made_current)
|
||||
{
|
||||
g_oglu_got_version3 = TRUE;
|
||||
xwglDeleteContext(g_ogl.context);
|
||||
oglu_init();
|
||||
return context;
|
||||
}
|
||||
else if (context)
|
||||
|
@ -169,10 +169,20 @@ static void ogl_build_programs()
|
|||
if (g_ddraw->bpp == 8)
|
||||
{
|
||||
g_ogl.main_program = oglu_build_program(PASSTHROUGH_VERT_SHADER, PALETTE_FRAG_SHADER);
|
||||
|
||||
if (!g_ogl.main_program)
|
||||
{
|
||||
g_ogl.main_program = oglu_build_program(PASSTHROUGH_VERT_SHADER_CORE, PALETTE_FRAG_SHADER_CORE);
|
||||
}
|
||||
}
|
||||
else if (g_ddraw->bpp == 16)
|
||||
{
|
||||
g_ogl.main_program = oglu_build_program(PASSTHROUGH_VERT_SHADER, PASSTHROUGH_FRAG_SHADER);
|
||||
|
||||
if (!g_ogl.main_program)
|
||||
{
|
||||
g_ogl.main_program = oglu_build_program(PASSTHROUGH_VERT_SHADER_CORE, PASSTHROUGH_FRAG_SHADER_CORE);
|
||||
}
|
||||
}
|
||||
|
||||
if (g_ogl.main_program)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue