(Drivers context) Cleanups

This commit is contained in:
twinaphex 2016-12-04 03:51:12 +01:00
parent cd8fad87fc
commit 49c78ea2ff
2 changed files with 15 additions and 14 deletions

View File

@ -40,13 +40,13 @@
#include "../../configuration.h"
#include "../../runloop.h"
static enum gfx_ctx_api android_api;
static enum gfx_ctx_api android_api = GFX_CTX_NONE;
/* forward declaration */
int system_property_get(const char *cmd, const char *args, char *value);
#ifdef HAVE_OPENGLES
static bool g_es3;
static bool g_es3 = false;
#ifndef EGL_OPENGL_ES3_BIT_KHR
#define EGL_OPENGL_ES3_BIT_KHR 0x0040
@ -251,8 +251,8 @@ static void android_gfx_ctx_check_window(void *data, bool *quit,
#ifdef HAVE_VULKAN
/* Swapchains are recreated in set_resize as a
* central place, so use that to trigger swapchain reinit. */
*resize = and->vk.need_new_swapchain;
new_width = and->width;
*resize = and->vk.need_new_swapchain;
new_width = and->width;
new_height = and->height;
#endif
break;
@ -280,7 +280,7 @@ static bool android_gfx_ctx_set_resize(void *data,
unsigned width, unsigned height)
{
#ifdef HAVE_VULKAN
android_ctx_data_t *and = (android_ctx_data_t*)data;
android_ctx_data_t *and = (android_ctx_data_t*)data;
struct android_app *android_app = (struct android_app*)g_android;
#endif
(void)data;
@ -371,7 +371,7 @@ static void android_gfx_ctx_input_driver(void *data,
(void)data;
*input = androidinput ? &input_android : NULL;
*input = androidinput ? &input_android : NULL;
*input_data = androidinput;
}
@ -407,6 +407,7 @@ static bool android_gfx_ctx_bind_api(void *data,
#else
break;
#endif
case GFX_CTX_NONE:
default:
break;
}
@ -416,7 +417,7 @@ static bool android_gfx_ctx_bind_api(void *data,
static bool android_gfx_ctx_has_focus(void *data)
{
bool focused;
bool focused = false;
struct android_app *android_app = (struct android_app*)g_android;
if (!android_app)
return true;

View File

@ -61,14 +61,14 @@
#endif
static enum gfx_ctx_api drm_api;
static enum gfx_ctx_api drm_api = GFX_CTX_NONE;
static struct gbm_bo *g_bo;
static struct gbm_bo *g_next_bo;
static struct gbm_surface *g_gbm_surface;
static struct gbm_device *g_gbm_dev;
static struct gbm_bo *g_bo = NULL;
static struct gbm_bo *g_next_bo = NULL;
static struct gbm_surface *g_gbm_surface = NULL;
static struct gbm_device *g_gbm_dev = NULL;
static bool waiting_for_flip;
static bool waiting_for_flip = false;
typedef struct gfx_ctx_drm_data
{
@ -365,7 +365,7 @@ static void *gfx_ctx_drm_init(void *video_driver)
unsigned gpu_index = 0;
const char *gpu = NULL;
struct string_list *gpu_descriptors = NULL;
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)
calloc(1, sizeof(gfx_ctx_drm_data_t));
if (!drm)