1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-05 09:48:42 +00:00

fix error on video re-init, other cleanup

This commit is contained in:
ToadKing 2013-07-18 23:58:35 -04:00
parent c77af5739b
commit ff3de25636
4 changed files with 12 additions and 11 deletions

View File

@ -1,4 +1,4 @@
TARGET = retroarch.html
TARGET = retroarch.js
OBJ = frontend/frontend_emscripten.o \
retroarch.o \
@ -18,6 +18,7 @@ OBJ = frontend/frontend_emscripten.o \
core_options.o \
patch.o \
compat/compat.o \
compat/rxml/rxml.o \
screenshot.o \
cheats.o \
audio/utils.o \
@ -44,6 +45,7 @@ HAVE_SDL_IMAGE = 1
HAVE_FREETYPE = 1
HAVE_ZLIB = 1
HAVE_FBO = 1
WANT_MINIZ = 1
libretro ?= -lretro

View File

@ -106,10 +106,8 @@ int main(int argc, char *argv[])
rarch_main_clear_state();
rarch_init_msg_queue();
char *_argv[] = { "retroarch", "--menu", "-v" };
int init_ret;
if ((init_ret = rarch_main_init(3, _argv))) return init_ret;
if ((init_ret = rarch_main_init(argc, argv))) return init_ret;
#ifdef HAVE_MENU
menu_init();

View File

@ -75,7 +75,8 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height)
static void gfx_ctx_update_window_title(void)
{
char buf[128];
gfx_get_fps(buf, sizeof(buf), false);
if (gfx_get_fps(buf, sizeof(buf), false))
RARCH_LOG("%s\n", buf);
}
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
@ -91,10 +92,10 @@ static bool gfx_ctx_init(void)
EGLint width;
EGLint height;
RARCH_LOG("[VC/EMSCRIPTEN]: Initializing...\n");
RARCH_LOG("[EMSCRIPTEN/EGL]: Initializing...\n");
if (g_inited)
{
RARCH_ERR("[VC/EMSCRIPTEN]: Attempted to re-initialize driver.\n");
RARCH_LOG("[EMSCRIPTEN/EGL]: Attempted to re-initialize driver.\n");
return true;
}
@ -147,7 +148,7 @@ static bool gfx_ctx_init(void)
eglQuerySurface(g_egl_dpy, g_egl_surf, EGL_HEIGHT, &height);
g_fb_width = width;
g_fb_height = height;
RARCH_LOG("[VC/EMSCRIPTEN]: Dimensions: %ux%u\n", width, height);
RARCH_LOG("[EMSCRIPTEN/EGL]: Dimensions: %ux%u\n", width, height);
return true;
@ -182,9 +183,10 @@ static void gfx_ctx_destroy(void)
{
if (g_egl_dpy)
{
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (g_egl_ctx)
{
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(g_egl_dpy, g_egl_ctx);
}
@ -193,8 +195,6 @@ static void gfx_ctx_destroy(void)
eglDestroySurface(g_egl_dpy, g_egl_surf);
}
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglTerminate(g_egl_dpy);
}

View File

@ -1844,6 +1844,7 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
}
RARCH_LOG("Found GL context: %s\n", gl->ctx_driver->ident);
while (glGetError() != GL_NO_ERROR);
context_get_video_size_func(&gl->full_x, &gl->full_y);
RARCH_LOG("Detecting screen resolution %ux%u.\n", gl->full_x, gl->full_y);