mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Create egl_create_surface
This commit is contained in:
parent
1101bb34d3
commit
fc0f5f8889
@ -228,3 +228,16 @@ bool egl_create_context(EGLint *egl_attribs)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool egl_create_surface(NativeWindowType native_window)
|
||||
{
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, native_window, NULL);
|
||||
if (!g_egl_surf)
|
||||
return false;
|
||||
|
||||
/* Connect the context to the surface. */
|
||||
if (!eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -59,4 +59,6 @@ bool egl_init_context(NativeDisplayType display,
|
||||
|
||||
bool egl_create_context(EGLint *egl_attribs);
|
||||
|
||||
bool egl_create_surface(NativeWindowType native_window);
|
||||
|
||||
#endif
|
||||
|
@ -737,13 +737,7 @@ static bool gfx_ctx_drm_egl_set_video_mode(void *data,
|
||||
goto error;
|
||||
}
|
||||
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy,
|
||||
g_egl_config, (EGLNativeWindowType)drm->g_gbm_surface, NULL);
|
||||
if (!g_egl_surf)
|
||||
goto error;
|
||||
|
||||
if (!eglMakeCurrent(g_egl_dpy,
|
||||
g_egl_surf, g_egl_surf, g_egl_ctx))
|
||||
if (!egl_create_surface((EGLNativeWindowType)drm->g_gbm_surface))
|
||||
goto error;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
@ -259,12 +259,7 @@ static bool gfx_ctx_vc_init(void *data)
|
||||
}
|
||||
vc_dispmanx_update_submit_sync(dispman_update);
|
||||
|
||||
g_egl_surf = eglCreateWindowSurface(g_egl_dpy, g_egl_config, &nativewindow, NULL);
|
||||
if (!g_egl_surf)
|
||||
goto error;
|
||||
|
||||
/* Connect the context to the surface. */
|
||||
if (!eglMakeCurrent(g_egl_dpy, g_egl_surf, g_egl_surf, g_egl_ctx))
|
||||
if (!egl_create_surface(&nativewindow))
|
||||
goto error;
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user