Create g_egl_quit

This commit is contained in:
twinaphex 2015-11-19 15:47:30 +01:00
parent 34543c3f1c
commit 2fe6686ced
7 changed files with 22 additions and 22 deletions

View File

@ -21,6 +21,8 @@
#include "gl_common.h"
#endif
volatile sig_atomic_t g_egl_quit;
EGLContext g_egl_ctx;
EGLContext g_egl_hw_ctx;
EGLSurface g_egl_surf;

View File

@ -16,6 +16,8 @@
#ifndef __EGL_COMMON_H
#define __EGL_COMMON_H
#include <signal.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
@ -23,6 +25,8 @@
#include "../video_context_driver.h"
volatile sig_atomic_t g_egl_quit;
extern EGLContext g_egl_ctx;
extern EGLContext g_egl_hw_ctx;
extern EGLSurface g_egl_surf;

View File

@ -73,8 +73,6 @@ typedef struct gfx_ctx_drm_egl_data
struct gbm_surface *g_gbm_surface;
} gfx_ctx_drm_egl_data_t;
static volatile sig_atomic_t g_quit;
static enum gfx_ctx_api g_api;
static unsigned g_major;
@ -134,7 +132,7 @@ static struct drm_fb *drm_fb_get_from_bo(
static void sighandler(int sig)
{
(void)sig;
g_quit = 1;
g_egl_quit = 1;
}
static void gfx_ctx_drm_egl_swap_interval(void *data, unsigned interval)
@ -153,7 +151,7 @@ static void gfx_ctx_drm_egl_check_window(void *data, bool *quit,
(void)height;
*resize = false;
*quit = g_quit;
*quit = g_egl_quit;
}
static unsigned first_page_flip;
@ -377,8 +375,8 @@ static void gfx_ctx_drm_egl_destroy_resources(gfx_ctx_drm_egl_data_t *drm)
free_drm_resources(drm);
drm->g_drm_mode = NULL;
g_quit = 0;
drm->g_drm_mode = NULL;
g_egl_quit = 0;
drm->g_crtc_id = 0;
drm->g_connector_id = 0;

View File

@ -35,12 +35,10 @@ struct fbdev_window native_window;
static bool g_resize;
static unsigned g_width, g_height;
static volatile sig_atomic_t g_quit;
static void gfx_ctx_mali_fbdev_sighandler(int sig)
{
(void)sig;
g_quit = 1;
g_egl_quit = 1;
}
static void gfx_ctx_mali_fbdev_destroy(void *data)
@ -50,7 +48,7 @@ static void gfx_ctx_mali_fbdev_destroy(void *data)
egl_destroy(data);
g_quit = 0;
g_egl_quit = 0;
g_resize = false;
/* Clear framebuffer and set cursor on again */
@ -147,7 +145,7 @@ static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
*resize = true;
}
*quit = g_quit;
*quit = g_egl_quit;
}
static void gfx_ctx_mali_fbdev_set_resize(void *data,

View File

@ -67,7 +67,7 @@ static INLINE bool gfx_ctx_vc_egl_query_extension(const char *ext)
static void sighandler(int sig)
{
(void)sig;
g_quit = 1;
g_egl_quit = 1;
}
static void gfx_ctx_vc_check_window(void *data, bool *quit,
@ -79,7 +79,7 @@ static void gfx_ctx_vc_check_window(void *data, bool *quit,
(void)height;
*resize = false;
*quit = g_quit;
*quit = g_egl_quit;
}
static void gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height)

View File

@ -26,18 +26,17 @@
static bool g_resize;
static unsigned g_width, g_height;
static volatile sig_atomic_t g_quit;
static void sighandler(int sig)
{
(void)sig;
g_quit = 1;
g_egl_quit = 1;
}
static void gfx_ctx_vivante_destroy(void *data)
{
egl_destroy(data);
g_quit = 0;
g_egl_quit = 0;
g_resize = false;
}
@ -113,7 +112,7 @@ static void gfx_ctx_vivante_check_window(void *data, bool *quit,
*resize = true;
}
*quit = g_quit;
*quit = g_egl_quit;
}
static void gfx_ctx_vivante_set_resize(void *data,

View File

@ -50,7 +50,6 @@ static enum gfx_ctx_api g_api;
static unsigned g_major;
static unsigned g_minor;
static volatile sig_atomic_t g_quit;
#ifndef EGL_OPENGL_ES3_BIT_KHR
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
@ -59,7 +58,7 @@ static volatile sig_atomic_t g_quit;
static void sighandler(int sig)
{
(void)sig;
g_quit = 1;
g_egl_quit = 1;
}
/* Shell surface callbacks. */
@ -194,7 +193,7 @@ static void flush_wayland_fd(void)
if (fd.revents & (POLLERR | POLLHUP))
{
close(wl->g_fd);
g_quit = true;
g_egl_quit = true;
}
if (fd.revents & POLLIN)
@ -226,7 +225,7 @@ static void gfx_ctx_wl_check_window(void *data, bool *quit,
*height = new_height;
}
*quit = g_quit;
*quit = g_egl_quit;
}
static void gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
@ -344,7 +343,7 @@ static bool gfx_ctx_wl_init(void *data)
attrib_ptr = NULL;
}
g_quit = 0;
g_egl_quit = 0;
wl->g_dpy = wl_display_connect(NULL);
if (!wl->g_dpy)