mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
Start using egl_create_context in more drivers
This commit is contained in:
parent
f84c58e777
commit
01614bb7f4
@ -111,19 +111,10 @@ static bool gfx_ctx_qnx_init(void *data)
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, EGL_NO_CONTEXT, context_attributes);
|
||||
|
||||
if (g_egl_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
|
||||
if (g_use_hw_ctx)
|
||||
if (!egl_create_context(context_attributes))
|
||||
{
|
||||
g_egl_hw_ctx = eglCreateContext(g_egl_dpy, g_egl_config, g_egl_ctx,
|
||||
context_attributes);
|
||||
RARCH_LOG("[BLACKBERRY QNX/EGL]: Created shared context: %p.\n", (void*)g_egl_hw_ctx);
|
||||
|
||||
if (g_egl_hw_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
if(!screen_win)
|
||||
|
@ -137,10 +137,11 @@ static bool gfx_ctx_emscripten_init(void *data)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Create an EGL rendering context. */
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, EGL_NO_CONTEXT, context_attributes);
|
||||
if (!g_egl_ctx)
|
||||
if (!egl_create_context(context_attributes))
|
||||
{
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* create an EGL window surface. */
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, 0, NULL);
|
||||
|
@ -179,21 +179,10 @@ static bool gfx_ctx_vc_init(void *data)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Create an EGL rendering context. */
|
||||
g_egl_ctx = eglCreateContext(
|
||||
g_egl_dpy, g_egl_config, EGL_NO_CONTEXT,
|
||||
(g_api == GFX_CTX_OPENGL_ES_API) ? context_attributes : NULL);
|
||||
if (!g_egl_ctx)
|
||||
goto error;
|
||||
|
||||
if (g_use_hw_ctx)
|
||||
if (!egl_create_context((g_api == GFX_CTX_OPENGL_ES_API) ? context_attributes : NULL))
|
||||
{
|
||||
g_egl_hw_ctx = eglCreateContext(g_egl_dpy, g_egl_config, g_egl_ctx,
|
||||
context_attributes);
|
||||
RARCH_LOG("[VC/EGL]: Created shared context: %p.\n", (void*)g_egl_hw_ctx);
|
||||
|
||||
if (g_egl_hw_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Create an EGL window surface. */
|
||||
|
@ -128,6 +128,12 @@ static bool gfx_ctx_vivante_set_video_mode(void *data,
|
||||
g_width = width;
|
||||
g_height = height;
|
||||
|
||||
if (!egl_create_context(attribs))
|
||||
{
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
window = fbCreateWindow(fbGetDisplayByIndex(0), 0, 0, 0, 0);
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, window, 0);
|
||||
|
||||
@ -137,13 +143,6 @@ static bool gfx_ctx_vivante_set_video_mode(void *data,
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, 0, attribs);
|
||||
if (g_egl_ctx == EGL_NO_CONTEXT)
|
||||
{
|
||||
RARCH_ERR("eglCreateContext failed.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx))
|
||||
{
|
||||
RARCH_ERR("eglMakeCurrent failed.\n");
|
||||
|
@ -291,22 +291,10 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
||||
CWBorderPixel | CWColormap | CWEventMask | (true_full ? CWOverrideRedirect : 0), &swa);
|
||||
XSetWindowBackground(g_x11_dpy, g_x11_win, 0);
|
||||
|
||||
g_egl_ctx = eglCreateContext(g_egl_dpy, g_egl_config, EGL_NO_CONTEXT,
|
||||
attr != egl_attribs ? egl_attribs : NULL);
|
||||
|
||||
RARCH_LOG("[X/EGL]: Created context: %p.\n", (void*)g_egl_ctx);
|
||||
|
||||
if (g_egl_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
|
||||
if (g_use_hw_ctx)
|
||||
if (!egl_create_context((attr != egl_attribs) ? egl_attribs : NULL))
|
||||
{
|
||||
g_egl_hw_ctx = eglCreateContext(g_egl_dpy, g_egl_config, g_egl_ctx,
|
||||
attr != egl_attribs ? egl_attribs : NULL);
|
||||
RARCH_LOG("[X/EGL]: Created shared context: %p.\n", (void*)g_egl_hw_ctx);
|
||||
|
||||
if (g_egl_hw_ctx == EGL_NO_CONTEXT)
|
||||
goto error;
|
||||
egl_report_error();
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, (EGLNativeWindowType)g_x11_win, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user