mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
Cleanups
This commit is contained in:
parent
2427ebe0e8
commit
9a34e9799a
@ -78,6 +78,11 @@ static void *gfx_ctx_qnx_init(void *video_driver)
|
|||||||
{
|
{
|
||||||
EGLint n;
|
EGLint n;
|
||||||
EGLint major, minor;
|
EGLint major, minor;
|
||||||
|
int usage, format;
|
||||||
|
#ifndef HAVE_BB10
|
||||||
|
int angle, size[2];
|
||||||
|
screen_display_mode_t screen_mode;
|
||||||
|
#endif
|
||||||
EGLint context_attributes[] = {
|
EGLint context_attributes[] = {
|
||||||
#ifdef HAVE_OPENGLES2
|
#ifdef HAVE_OPENGLES2
|
||||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||||
@ -150,7 +155,7 @@ static void *gfx_ctx_qnx_init(void *video_driver)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int format = SCREEN_FORMAT_RGBX8888;
|
format = SCREEN_FORMAT_RGBX8888;
|
||||||
if (screen_set_window_property_iv(screen_win,
|
if (screen_set_window_property_iv(screen_win,
|
||||||
SCREEN_PROPERTY_FORMAT, &format))
|
SCREEN_PROPERTY_FORMAT, &format))
|
||||||
{
|
{
|
||||||
@ -158,7 +163,6 @@ static void *gfx_ctx_qnx_init(void *video_driver)
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
int usage;
|
|
||||||
#ifdef HAVE_OPENGLES2
|
#ifdef HAVE_OPENGLES2
|
||||||
usage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_ROTATION;
|
usage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_ROTATION;
|
||||||
#elif HAVE_OPENGLES3
|
#elif HAVE_OPENGLES3
|
||||||
@ -188,11 +192,8 @@ static void *gfx_ctx_qnx_init(void *video_driver)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_BB10
|
#ifndef HAVE_BB10
|
||||||
int angle, size[2];
|
|
||||||
|
|
||||||
angle = atoi(getenv("ORIENTATION"));
|
angle = atoi(getenv("ORIENTATION"));
|
||||||
|
|
||||||
screen_display_mode_t screen_mode;
|
|
||||||
if (screen_get_display_property_pv(qnx->screen_disp,
|
if (screen_get_display_property_pv(qnx->screen_disp,
|
||||||
SCREEN_PROPERTY_MODE, (void**)&screen_mode))
|
SCREEN_PROPERTY_MODE, (void**)&screen_mode))
|
||||||
{
|
{
|
||||||
@ -299,14 +300,7 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
|||||||
|
|
||||||
static bool gfx_ctx_qnx_set_video_mode(void *data,
|
static bool gfx_ctx_qnx_set_video_mode(void *data,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen) { return true; }
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
(void)fullscreen;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_qnx_input_driver(void *data,
|
static void gfx_ctx_qnx_input_driver(void *data,
|
||||||
const char *joypad_name,
|
const char *joypad_name,
|
||||||
@ -318,16 +312,11 @@ static void gfx_ctx_qnx_input_driver(void *data,
|
|||||||
*input_data = qnxinput;
|
*input_data = qnxinput;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum gfx_ctx_api gfx_ctx_qnx_get_api(void *data)
|
static enum gfx_ctx_api gfx_ctx_qnx_get_api(void *data) { return qnx_api; }
|
||||||
{
|
|
||||||
return qnx_api;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_bind_api(void *data,
|
static bool gfx_ctx_qnx_bind_api(void *data,
|
||||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||||
{
|
{
|
||||||
(void)data;
|
|
||||||
|
|
||||||
qnx_api = api;
|
qnx_api = api;
|
||||||
|
|
||||||
if (api == GFX_CTX_OPENGL_ES_API)
|
if (api == GFX_CTX_OPENGL_ES_API)
|
||||||
@ -336,18 +325,9 @@ static bool gfx_ctx_qnx_bind_api(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_has_focus(void *data)
|
static bool gfx_ctx_qnx_has_focus(void *data) { return true; }
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_suppress_screensaver(void *data, bool enable)
|
static bool gfx_ctx_qnx_suppress_screensaver(void *data, bool enable) { return false; }
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)enable;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dpi_get_density(qnx_ctx_data_t *qnx)
|
static int dpi_get_density(qnx_ctx_data_t *qnx)
|
||||||
{
|
{
|
||||||
@ -446,10 +426,7 @@ static uint32_t gfx_ctx_qnx_get_flags(void *data)
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_qnx_set_flags(void *data, uint32_t flags)
|
static void gfx_ctx_qnx_set_flags(void *data, uint32_t flags) { }
|
||||||
{
|
|
||||||
(void)flags;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gfx_ctx_driver_t gfx_ctx_qnx = {
|
const gfx_ctx_driver_t gfx_ctx_qnx = {
|
||||||
gfx_ctx_qnx_init,
|
gfx_ctx_qnx_init,
|
||||||
|
@ -95,13 +95,13 @@ static void *sdl_ctx_init(void *video_driver)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
RARCH_LOG("[SDL_GL] SDL %i.%i.%i gfx context driver initialized.\n",
|
RARCH_LOG("[SDL_GL] SDL %i.%i.%i gfx context driver initialized.\n",
|
||||||
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL);
|
||||||
|
|
||||||
return sdl;
|
return sdl;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
RARCH_WARN("[SDL_GL]: Failed to initialize SDL gfx context driver: %s\n",
|
RARCH_WARN("[SDL_GL]: Failed to initialize SDL gfx context driver: %s\n",
|
||||||
SDL_GetError());
|
SDL_GetError());
|
||||||
|
|
||||||
sdl_ctx_destroy_resources(sdl);
|
sdl_ctx_destroy_resources(sdl);
|
||||||
|
|
||||||
@ -122,10 +122,7 @@ static void sdl_ctx_destroy(void *data)
|
|||||||
free(sdl);
|
free(sdl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum gfx_ctx_api sdl_ctx_get_api(void *data)
|
static enum gfx_ctx_api sdl_ctx_get_api(void *data) { return sdl_api; }
|
||||||
{
|
|
||||||
return sdl_api;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sdl_ctx_bind_api(void *data,
|
static bool sdl_ctx_bind_api(void *data,
|
||||||
enum gfx_ctx_api api, unsigned major,
|
enum gfx_ctx_api api, unsigned major,
|
||||||
@ -159,7 +156,6 @@ static bool sdl_ctx_bind_api(void *data,
|
|||||||
|
|
||||||
static void sdl_ctx_swap_interval(void *data, int interval)
|
static void sdl_ctx_swap_interval(void *data, int interval)
|
||||||
{
|
{
|
||||||
(void)data;
|
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
SDL_GL_SetSwapInterval(interval);
|
SDL_GL_SetSwapInterval(interval);
|
||||||
#else
|
#else
|
||||||
@ -293,7 +289,8 @@ static void sdl_ctx_update_title(void *data)
|
|||||||
if (title[0])
|
if (title[0])
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
SDL_SetWindowTitle((SDL_Window*)video_driver_display_userdata_get(), title);
|
SDL_SetWindowTitle((SDL_Window*)
|
||||||
|
video_driver_display_userdata_get(), title);
|
||||||
#else
|
#else
|
||||||
SDL_WM_SetCaption(title, NULL);
|
SDL_WM_SetCaption(title, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -310,9 +307,11 @@ static void sdl_ctx_check_window(void *data, bool *quit,
|
|||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
|
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_QUIT, SDL_WINDOWEVENT) > 0)
|
while (SDL_PeepEvents(&event, 1,
|
||||||
|
SDL_GETEVENT, SDL_QUIT, SDL_WINDOWEVENT) > 0)
|
||||||
#else
|
#else
|
||||||
while (SDL_PeepEvents(&event, 1, SDL_GETEVENT, SDL_QUITMASK|SDL_VIDEORESIZEMASK) > 0)
|
while (SDL_PeepEvents(&event, 1,
|
||||||
|
SDL_GETEVENT, SDL_QUITMASK|SDL_VIDEORESIZEMASK) > 0)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
@ -397,11 +396,7 @@ static gfx_ctx_proc_t sdl_ctx_get_proc_address(const char *name)
|
|||||||
return (gfx_ctx_proc_t)SDL_GL_GetProcAddress(name);
|
return (gfx_ctx_proc_t)SDL_GL_GetProcAddress(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_show_mouse(void *data, bool state)
|
static void sdl_ctx_show_mouse(void *data, bool state) { SDL_ShowCursor(state); }
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
SDL_ShowCursor(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t sdl_ctx_get_flags(void *data)
|
static uint32_t sdl_ctx_get_flags(void *data)
|
||||||
{
|
{
|
||||||
@ -412,10 +407,7 @@ static uint32_t sdl_ctx_get_flags(void *data)
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_set_flags(void *data, uint32_t flags)
|
static void sdl_ctx_set_flags(void *data, uint32_t flags) { }
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
}
|
|
||||||
|
|
||||||
const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user