mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Create egl_get_native_visual_id
This commit is contained in:
parent
959b781c06
commit
0f94353b28
@ -255,3 +255,16 @@ bool egl_create_surface(NativeWindowType native_window)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool egl_get_native_visual_id(EGLint *value)
|
||||
{
|
||||
if (!eglGetConfigAttrib(g_egl_dpy, g_egl_config,
|
||||
EGL_NATIVE_VISUAL_ID, value))
|
||||
{
|
||||
RARCH_ERR("[EGL]: egl_get_native_visual_id failed.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,8 @@ bool egl_create_context(EGLint *egl_attribs);
|
||||
|
||||
bool egl_create_surface(NativeWindowType native_window);
|
||||
|
||||
bool egl_get_native_visual_id(EGLint *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -34,7 +34,6 @@ static bool g_es3;
|
||||
|
||||
static bool android_gfx_ctx_init(void *data)
|
||||
{
|
||||
int var;
|
||||
EGLint n, major, minor;
|
||||
EGLint format;
|
||||
EGLint context_attributes[] = {
|
||||
@ -64,14 +63,8 @@ static bool android_gfx_ctx_init(void *data)
|
||||
goto error;
|
||||
}
|
||||
|
||||
var = eglGetConfigAttrib(g_egl_dpy, g_egl_config,
|
||||
EGL_NATIVE_VISUAL_ID, &format);
|
||||
|
||||
if (!var)
|
||||
{
|
||||
RARCH_ERR("eglGetConfigAttrib failed: %d.\n", var);
|
||||
if (!egl_get_native_visual_id(&format))
|
||||
goto error;
|
||||
}
|
||||
|
||||
ANativeWindow_setBuffersGeometry(android_app->window, 0, 0, format);
|
||||
|
||||
|
@ -253,7 +253,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
||||
attr = egl_attribs;
|
||||
attr = xegl_fill_attribs(attr);
|
||||
|
||||
if (!eglGetConfigAttrib(g_egl_dpy, g_egl_config, EGL_NATIVE_VISUAL_ID, &vid))
|
||||
if (!egl_get_native_visual_id(&vid))
|
||||
goto error;
|
||||
|
||||
temp.visualid = vid;
|
||||
|
Loading…
x
Reference in New Issue
Block a user