mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
commit
7961bf6d23
@ -31,7 +31,6 @@
|
|||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../input/common/input_x11_common.h"
|
#include "../../input/common/input_x11_common.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_DBUS
|
#ifdef HAVE_DBUS
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
@ -323,7 +322,7 @@ void x11_suspend_screensaver(Window wnd, bool enable)
|
|||||||
x11_suspend_screensaver_xdg_screensaver(wnd, enable);
|
x11_suspend_screensaver_xdg_screensaver(wnd, enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool get_video_mode(video_frame_info_t video_info,
|
static bool get_video_mode(video_frame_info_t *video_info,
|
||||||
Display *dpy, unsigned width, unsigned height,
|
Display *dpy, unsigned width, unsigned height,
|
||||||
XF86VidModeModeInfo *mode, XF86VidModeModeInfo *desktop_mode)
|
XF86VidModeModeInfo *mode, XF86VidModeModeInfo *desktop_mode)
|
||||||
{
|
{
|
||||||
@ -345,7 +344,7 @@ static bool get_video_mode(video_frame_info_t video_info,
|
|||||||
|
|
||||||
/* If we use black frame insertion, we fake a 60 Hz monitor
|
/* If we use black frame insertion, we fake a 60 Hz monitor
|
||||||
* for 120 Hz one, etc, so try to match that. */
|
* for 120 Hz one, etc, so try to match that. */
|
||||||
refresh_mod = video_info.black_frame_insertion ? 0.5f : 1.0f;
|
refresh_mod = video_info->black_frame_insertion ? 0.5f : 1.0f;
|
||||||
|
|
||||||
for (i = 0; i < num_modes; i++)
|
for (i = 0; i < num_modes; i++)
|
||||||
{
|
{
|
||||||
@ -361,7 +360,7 @@ static bool get_video_mode(video_frame_info_t video_info,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
refresh = refresh_mod * m->dotclock * 1000.0f / (m->htotal * m->vtotal);
|
refresh = refresh_mod * m->dotclock * 1000.0f / (m->htotal * m->vtotal);
|
||||||
diff = fabsf(refresh - video_info.refresh_rate);
|
diff = fabsf(refresh - video_info->refresh_rate);
|
||||||
|
|
||||||
if (!ret || diff < minimum_fps_diff)
|
if (!ret || diff < minimum_fps_diff)
|
||||||
{
|
{
|
||||||
@ -375,7 +374,7 @@ static bool get_video_mode(video_frame_info_t video_info,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool x11_enter_fullscreen(video_frame_info_t video_info,
|
bool x11_enter_fullscreen(video_frame_info_t *video_info,
|
||||||
Display *dpy, unsigned width,
|
Display *dpy, unsigned width,
|
||||||
unsigned height, XF86VidModeModeInfo *desktop_mode)
|
unsigned height, XF86VidModeModeInfo *desktop_mode)
|
||||||
{
|
{
|
||||||
@ -634,7 +633,7 @@ bool x11_alive(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void x11_check_window(void *data, bool *quit,
|
void x11_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width = *width;
|
unsigned new_width = *width;
|
||||||
unsigned new_height = *height;
|
unsigned new_height = *height;
|
||||||
@ -715,18 +714,16 @@ bool x11_connect(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void x11_update_window_title(void *data, video_frame_info_t video_info)
|
void x11_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char title[128];
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
title[0] = '\0';
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info,
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
buf, sizeof(buf), buf_fps, sizeof(buf_fps)))
|
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
if (title[0] && video_info->monitor_fps_enable)
|
||||||
if (video_info.fps_show)
|
XStoreName(g_x11_dpy, g_x11_win, title);
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool x11_input_ctx_new(bool true_full)
|
bool x11_input_ctx_new(bool true_full)
|
||||||
|
@ -45,7 +45,7 @@ void x11_save_last_used_monitor(Window win);
|
|||||||
void x11_show_mouse(Display *dpy, Window win, bool state);
|
void x11_show_mouse(Display *dpy, Window win, bool state);
|
||||||
void x11_windowed_fullscreen(Display *dpy, Window win);
|
void x11_windowed_fullscreen(Display *dpy, Window win);
|
||||||
void x11_suspend_screensaver(Window win, bool enable);
|
void x11_suspend_screensaver(Window win, bool enable);
|
||||||
bool x11_enter_fullscreen(video_frame_info_t video_info,
|
bool x11_enter_fullscreen(video_frame_info_t *video_info,
|
||||||
Display *dpy, unsigned width,
|
Display *dpy, unsigned width,
|
||||||
unsigned height, XF86VidModeModeInfo *desktop_mode);
|
unsigned height, XF86VidModeModeInfo *desktop_mode);
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ bool x11_get_metrics(void *data,
|
|||||||
enum display_metric_types type, float *value);
|
enum display_metric_types type, float *value);
|
||||||
|
|
||||||
void x11_check_window(void *data, bool *quit,
|
void x11_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count);
|
bool *resize, unsigned *width, unsigned *height);
|
||||||
|
|
||||||
void x11_get_video_size(void *data, unsigned *width, unsigned *height);
|
void x11_get_video_size(void *data, unsigned *width, unsigned *height);
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ bool x11_alive(void *data);
|
|||||||
|
|
||||||
bool x11_connect(void);
|
bool x11_connect(void);
|
||||||
|
|
||||||
void x11_update_window_title(void *data, video_frame_info_t video_info);
|
void x11_update_title(void *data, video_frame_info_t *video_info);
|
||||||
|
|
||||||
bool x11_input_ctx_new(bool true_full);
|
bool x11_input_ctx_new(bool true_full);
|
||||||
|
|
||||||
|
@ -15,13 +15,18 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <retro_miscellaneous.h>
|
|
||||||
#include <caca.h>
|
#include <caca.h>
|
||||||
|
|
||||||
|
#include <retro_miscellaneous.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "../common/caca_common.h"
|
||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../menu/menu_driver.h"
|
|
||||||
#include "../common/caca_common.h"
|
|
||||||
|
|
||||||
static caca_canvas_t *caca_cv = NULL;
|
static caca_canvas_t *caca_cv = NULL;
|
||||||
static caca_dither_t *caca_dither = NULL;
|
static caca_dither_t *caca_dither = NULL;
|
||||||
@ -94,7 +99,7 @@ static void *caca_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool caca_gfx_frame(void *data, const void *frame,
|
static bool caca_gfx_frame(void *data, const void *frame,
|
||||||
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
void *buffer = NULL;
|
void *buffer = NULL;
|
||||||
@ -145,7 +150,7 @@ static bool caca_gfx_frame(void *data, const void *frame,
|
|||||||
caca_clear_canvas(caca_cv);
|
caca_clear_canvas(caca_cv);
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
|
@ -26,11 +26,13 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../ctr/gpu_old.h"
|
#include "../../ctr/gpu_old.h"
|
||||||
#include "ctr_gu.h"
|
#include "ctr_gu.h"
|
||||||
|
|
||||||
#include "../../menu/menu_driver.h"
|
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../command.h"
|
#include "../../command.h"
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
@ -446,7 +448,7 @@ static void* ctr_init(const video_info_t* video,
|
|||||||
static bool ctr_frame(void* data, const void* frame,
|
static bool ctr_frame(void* data, const void* frame,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
uint64_t frame_count,
|
uint64_t frame_count,
|
||||||
unsigned pitch, const char* msg, video_frame_info_t info)
|
unsigned pitch, const char* msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
uint32_t diff;
|
uint32_t diff;
|
||||||
static uint64_t currentTick,lastTick;
|
static uint64_t currentTick,lastTick;
|
||||||
@ -750,7 +752,7 @@ static bool ctr_frame(void* data, const void* frame,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctr->msg_rendering_enabled = true;
|
ctr->msg_rendering_enabled = true;
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
ctr->msg_rendering_enabled = false;
|
ctr->msg_rendering_enabled = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -332,14 +332,16 @@ static void d3d_viewport_info(void *data, struct video_viewport *vp)
|
|||||||
d3d->renderchain_driver->viewport_info(d3d, vp);
|
d3d->renderchain_driver->viewport_info(d3d, vp);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
|
static void d3d_overlay_render(d3d_video_t *d3d, video_frame_info_t *video_info,
|
||||||
|
overlay_t *overlay)
|
||||||
{
|
{
|
||||||
struct video_viewport vp;
|
struct video_viewport vp;
|
||||||
unsigned width, height;
|
|
||||||
void *verts;
|
void *verts;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
float vert[4][9];
|
float vert[4][9];
|
||||||
float overlay_width, overlay_height;
|
float overlay_width, overlay_height;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
if (!d3d || !overlay || !overlay->tex)
|
if (!d3d || !overlay || !overlay->tex)
|
||||||
return;
|
return;
|
||||||
@ -429,8 +431,6 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay)
|
|||||||
{
|
{
|
||||||
D3DVIEWPORT vp_full;
|
D3DVIEWPORT vp_full;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
vp_full.X = 0;
|
vp_full.X = 0;
|
||||||
vp_full.Y = 0;
|
vp_full.Y = 0;
|
||||||
vp_full.Width = width;
|
vp_full.Width = width;
|
||||||
@ -881,7 +881,7 @@ static bool d3d_alive(void *data)
|
|||||||
mode.width = temp_width;
|
mode.width = temp_width;
|
||||||
mode.height = temp_height;
|
mode.height = temp_height;
|
||||||
|
|
||||||
video_context_driver_set_resize(&mode);
|
video_context_driver_set_resize(mode);
|
||||||
d3d_restore(d3d);
|
d3d_restore(d3d);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1368,21 +1368,21 @@ static void d3d_get_overlay_interface(void *data,
|
|||||||
static bool d3d_frame(void *data, const void *frame,
|
static bool d3d_frame(void *data, const void *frame,
|
||||||
unsigned frame_width, unsigned frame_height,
|
unsigned frame_width, unsigned frame_height,
|
||||||
uint64_t frame_count, unsigned pitch,
|
uint64_t frame_count, unsigned pitch,
|
||||||
const char *msg, video_frame_info_t video_info)
|
const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
static struct
|
||||||
static struct retro_perf_counter d3d_frame = {0};
|
retro_perf_counter d3d_frame = {0};
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
HWND window = win32_get_window();
|
HWND window = win32_get_window();
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
(void)i;
|
(void)i;
|
||||||
|
|
||||||
if (!frame)
|
if (!frame)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
performance_counter_init(&d3d_frame, "d3d_frame");
|
performance_counter_init(&d3d_frame, "d3d_frame");
|
||||||
performance_counter_start(&d3d_frame);
|
performance_counter_start(&d3d_frame);
|
||||||
|
|
||||||
@ -1412,18 +1412,18 @@ static bool d3d_frame(void *data, const void *frame,
|
|||||||
/* render_chain() only clears out viewport,
|
/* render_chain() only clears out viewport,
|
||||||
* clear out everything. */
|
* clear out everything. */
|
||||||
D3DVIEWPORT screen_vp;
|
D3DVIEWPORT screen_vp;
|
||||||
screen_vp.X = 0;
|
screen_vp.X = 0;
|
||||||
screen_vp.Y = 0;
|
screen_vp.Y = 0;
|
||||||
screen_vp.MinZ = 0;
|
screen_vp.MinZ = 0;
|
||||||
screen_vp.MaxZ = 1;
|
screen_vp.MaxZ = 1;
|
||||||
screen_vp.Width = width;
|
screen_vp.Width = width;
|
||||||
screen_vp.Height = height;
|
screen_vp.Height = height;
|
||||||
d3d_set_viewports(d3d->dev, &screen_vp);
|
d3d_set_viewports(d3d->dev, &screen_vp);
|
||||||
d3d_clear(d3d->dev, 0, 0, D3DCLEAR_TARGET, 0, 1, 0);
|
d3d_clear(d3d->dev, 0, 0, D3DCLEAR_TARGET, 0, 1, 0);
|
||||||
|
|
||||||
/* Insert black frame first, so we
|
/* Insert black frame first, so we
|
||||||
* can screenshot, etc. */
|
* can screenshot, etc. */
|
||||||
if (video_info.black_frame_insertion)
|
if (video_info->black_frame_insertion)
|
||||||
{
|
{
|
||||||
if (!d3d_swap(d3d, d3d->dev) || d3d->needs_restore)
|
if (!d3d_swap(d3d, d3d->dev) || d3d->needs_restore)
|
||||||
return true;
|
return true;
|
||||||
@ -1448,8 +1448,8 @@ static bool d3d_frame(void *data, const void *frame,
|
|||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
if (d3d->menu && d3d->menu->enabled)
|
if (d3d->menu && d3d->menu->enabled)
|
||||||
{
|
{
|
||||||
d3d_overlay_render(d3d, d3d->menu);
|
d3d_overlay_render(d3d, video_info, d3d->menu);
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1457,7 +1457,7 @@ static bool d3d_frame(void *data, const void *frame,
|
|||||||
if (d3d->overlays_enabled)
|
if (d3d->overlays_enabled)
|
||||||
{
|
{
|
||||||
for (i = 0; i < d3d->overlays.size(); i++)
|
for (i = 0; i < d3d->overlays.size(); i++)
|
||||||
d3d_overlay_render(d3d, &d3d->overlays[i]);
|
d3d_overlay_render(d3d, video_info, &d3d->overlays[i]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
@ -430,7 +434,7 @@ static void *dispmanx_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
struct dispmanx_video *_dispvars = data;
|
struct dispmanx_video *_dispvars = data;
|
||||||
float aspect = video_driver_get_aspect_ratio();
|
float aspect = video_driver_get_aspect_ratio();
|
||||||
@ -438,7 +442,9 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
if (!frame)
|
if (!frame)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (width != _dispvars->core_width || height != _dispvars->core_height || _dispvars->aspect_ratio != aspect)
|
if ( (width != _dispvars->core_width) ||
|
||||||
|
(height != _dispvars->core_height) ||
|
||||||
|
(_dispvars->aspect_ratio != aspect))
|
||||||
{
|
{
|
||||||
/* Sanity check. */
|
/* Sanity check. */
|
||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
@ -470,16 +476,13 @@ static bool dispmanx_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
/* We need to recreate the menu surface too, if it exists already, so we
|
/* We need to recreate the menu surface too, if it exists already, so we
|
||||||
* free it and let dispmanx_set_texture_frame() recreate it as it detects it's NULL.*/
|
* free it and let dispmanx_set_texture_frame() recreate it as it detects it's NULL.*/
|
||||||
if (_dispvars->menu_active && _dispvars->menu_surface) {
|
if (_dispvars->menu_active && _dispvars->menu_surface)
|
||||||
dispmanx_surface_free(_dispvars, &_dispvars->menu_surface);
|
dispmanx_surface_free(_dispvars, &_dispvars->menu_surface);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.fps_show)
|
#ifdef HAVE_MENU
|
||||||
{
|
menu_driver_frame(video_info);
|
||||||
char buf[128];
|
#endif
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update main surface: locate free page, blit and flip. */
|
/* Update main surface: locate free page, blit and flip. */
|
||||||
dispmanx_surface_update(_dispvars, frame, _dispvars->main_surface);
|
dispmanx_surface_update(_dispvars, frame, _dispvars->main_surface);
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
@ -744,11 +748,12 @@ static void *drm_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool drm_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool drm_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
struct drm_video *_drmvars = data;
|
struct drm_video *_drmvars = data;
|
||||||
|
|
||||||
if (width != _drmvars->core_width || height != _drmvars->core_height)
|
if ( ( width != _drmvars->core_width) ||
|
||||||
|
(height != _drmvars->core_height))
|
||||||
{
|
{
|
||||||
/* Sanity check. */
|
/* Sanity check. */
|
||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
@ -778,13 +783,9 @@ static bool drm_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
drm_plane_setup(_drmvars->main_surface);
|
drm_plane_setup(_drmvars->main_surface);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_drmvars->menu_active)
|
#ifdef HAVE_MENU
|
||||||
{
|
menu_driver_frame(video_info);
|
||||||
char buf[128];
|
#endif
|
||||||
buf[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update main surface: locate free page, blit and flip. */
|
/* Update main surface: locate free page, blit and flip. */
|
||||||
drm_surface_update(_drmvars, frame, _drmvars->main_surface);
|
drm_surface_update(_drmvars, frame, _drmvars->main_surface);
|
||||||
|
@ -35,6 +35,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../common/drm_common.h"
|
#include "../common/drm_common.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
@ -1159,7 +1163,6 @@ static int exynos_render_msg(struct exynos_video *vid,
|
|||||||
return exynos_blend_font(pdata);
|
return exynos_blend_font(pdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void *exynos_gfx_init(const video_info_t *video,
|
static void *exynos_gfx_init(const video_info_t *video,
|
||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t **input, void **input_data)
|
||||||
{
|
{
|
||||||
@ -1273,7 +1276,7 @@ static void exynos_gfx_free(void *data)
|
|||||||
|
|
||||||
static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
struct exynos_video *vid = data;
|
struct exynos_video *vid = data;
|
||||||
struct exynos_page *page = NULL;
|
struct exynos_page *page = NULL;
|
||||||
@ -1304,18 +1307,6 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
|
||||||
char buffer[128];
|
|
||||||
char buffer_fps[128];
|
|
||||||
|
|
||||||
buffer[0] = buffer_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buffer, sizeof(buffer),
|
|
||||||
video_info.fps_show ? buffer_fps : NULL, sizeof(buffer_fps));
|
|
||||||
runloop_msg_queue_push(buffer_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If at this point the dimension parameters are still zero, setup some *
|
/* If at this point the dimension parameters are still zero, setup some *
|
||||||
* fake blit parameters so that menu and font rendering work properly. */
|
* fake blit parameters so that menu and font rendering work properly. */
|
||||||
if (vid->width == 0 || vid->height == 0)
|
if (vid->width == 0 || vid->height == 0)
|
||||||
@ -1328,6 +1319,9 @@ static bool exynos_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
{
|
{
|
||||||
if (exynos_blend_menu(vid->data, vid->menu_rotation) != 0)
|
if (exynos_blend_menu(vid->data, vid->menu_rotation) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
|
@ -17,10 +17,17 @@
|
|||||||
|
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "../../config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../menu/menu_driver.h"
|
|
||||||
#include "../common/gdi_common.h"
|
#include "../common/gdi_common.h"
|
||||||
|
|
||||||
#if defined(_WIN32) && !defined(_XBOX)
|
#if defined(_WIN32) && !defined(_XBOX)
|
||||||
@ -146,7 +153,7 @@ error:
|
|||||||
|
|
||||||
static bool gdi_gfx_frame(void *data, const void *frame,
|
static bool gdi_gfx_frame(void *data, const void *frame,
|
||||||
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
unsigned frame_width, unsigned frame_height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_mode_t mode;
|
gfx_ctx_mode_t mode;
|
||||||
RECT rect;
|
RECT rect;
|
||||||
@ -162,7 +169,7 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gdi_video_width != frame_width || gdi_video_height != frame_height || gdi_video_pitch != pitch)
|
if (gdi_video_width != frame_width || gdi_video_height != frame_height || gdi_video_pitch != pitch)
|
||||||
|
@ -212,18 +212,18 @@ static void gl_overlay_tex_geom(void *data,
|
|||||||
tex[7] = y + h;
|
tex[7] = y + h;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gl_render_overlay(gl_t *gl)
|
static void gl_render_overlay(gl_t *gl, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
video_shader_ctx_mvp_t mvp;
|
video_shader_ctx_mvp_t mvp;
|
||||||
video_shader_ctx_coords_t coords;
|
video_shader_ctx_coords_t coords;
|
||||||
video_shader_ctx_info_t shader_info;
|
video_shader_ctx_info_t shader_info;
|
||||||
unsigned i, width, height;
|
unsigned i;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
if (!gl || !gl->overlay_enable)
|
if (!gl || !gl->overlay_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
if (gl->overlay_full_screen)
|
if (gl->overlay_full_screen)
|
||||||
@ -299,32 +299,30 @@ static void gl_set_viewport_wrapper(void *data, unsigned viewport_width,
|
|||||||
|
|
||||||
video_driver_build_info(&video_info);
|
video_driver_build_info(&video_info);
|
||||||
|
|
||||||
gl_set_viewport(data, video_info,
|
gl_set_viewport(data, &video_info,
|
||||||
viewport_width, viewport_height, force_full, allow_rotate);
|
viewport_width, viewport_height, force_full, allow_rotate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl_set_viewport(void *data, video_frame_info_t video_info,
|
void gl_set_viewport(void *data, video_frame_info_t *video_info,
|
||||||
unsigned viewport_width,
|
unsigned viewport_width,
|
||||||
unsigned viewport_height,
|
unsigned viewport_height,
|
||||||
bool force_full, bool allow_rotate)
|
bool force_full, bool allow_rotate)
|
||||||
{
|
{
|
||||||
gfx_ctx_aspect_t aspect_data;
|
gfx_ctx_aspect_t aspect_data;
|
||||||
unsigned width, height;
|
int x = 0;
|
||||||
int x = 0;
|
int y = 0;
|
||||||
int y = 0;
|
float device_aspect = (float)viewport_width / viewport_height;
|
||||||
float device_aspect = (float)viewport_width / viewport_height;
|
|
||||||
struct video_ortho ortho = {0, 1, 0, 1, -1, 1};
|
struct video_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
aspect_data.aspect = &device_aspect;
|
||||||
|
aspect_data.width = viewport_width;
|
||||||
aspect_data.aspect = &device_aspect;
|
aspect_data.height = viewport_height;
|
||||||
aspect_data.width = viewport_width;
|
|
||||||
aspect_data.height = viewport_height;
|
|
||||||
|
|
||||||
video_context_driver_translate_aspect(&aspect_data);
|
video_context_driver_translate_aspect(&aspect_data);
|
||||||
|
|
||||||
if (video_info.scale_integer && !force_full)
|
if (video_info->scale_integer && !force_full)
|
||||||
{
|
{
|
||||||
video_viewport_get_scaled_integer(&gl->vp,
|
video_viewport_get_scaled_integer(&gl->vp,
|
||||||
viewport_width, viewport_height,
|
viewport_width, viewport_height,
|
||||||
@ -337,7 +335,7 @@ void gl_set_viewport(void *data, video_frame_info_t video_info,
|
|||||||
float desired_aspect = video_driver_get_aspect_ratio();
|
float desired_aspect = video_driver_get_aspect_ratio();
|
||||||
|
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
if (video_info.aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
|
if (video_info->aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
|
||||||
{
|
{
|
||||||
const struct video_viewport *custom = video_viewport_get_custom();
|
const struct video_viewport *custom = video_viewport_get_custom();
|
||||||
|
|
||||||
@ -1013,13 +1011,14 @@ static void gl_pbo_async_readback(gl_t *gl)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static INLINE void gl_draw_texture(gl_t *gl)
|
static INLINE void gl_draw_texture(gl_t *gl, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
video_shader_ctx_mvp_t mvp;
|
video_shader_ctx_mvp_t mvp;
|
||||||
video_shader_ctx_coords_t coords;
|
video_shader_ctx_coords_t coords;
|
||||||
video_shader_ctx_info_t shader_info;
|
video_shader_ctx_info_t shader_info;
|
||||||
unsigned width, height;
|
|
||||||
GLfloat color[16];
|
GLfloat color[16];
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
color[ 0] = 1.0f;
|
color[ 0] = 1.0f;
|
||||||
color[ 1] = 1.0f;
|
color[ 1] = 1.0f;
|
||||||
@ -1041,8 +1040,6 @@ static INLINE void gl_draw_texture(gl_t *gl)
|
|||||||
if (!gl->menu_texture)
|
if (!gl->menu_texture)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
gl->coords.vertex = vertexes_flipped;
|
gl->coords.vertex = vertexes_flipped;
|
||||||
gl->coords.tex_coord = tex_coords;
|
gl->coords.tex_coord = tex_coords;
|
||||||
gl->coords.color = color;
|
gl->coords.color = color;
|
||||||
@ -1090,16 +1087,18 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
unsigned frame_width, unsigned frame_height,
|
unsigned frame_width, unsigned frame_height,
|
||||||
uint64_t frame_count,
|
uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg,
|
unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
video_shader_ctx_mvp_t mvp;
|
video_shader_ctx_mvp_t mvp;
|
||||||
video_shader_ctx_coords_t coords;
|
video_shader_ctx_coords_t coords;
|
||||||
video_shader_ctx_params_t params;
|
video_shader_ctx_params_t params;
|
||||||
unsigned width, height;
|
|
||||||
struct video_tex_info feedback_info;
|
struct video_tex_info feedback_info;
|
||||||
video_shader_ctx_info_t shader_info;
|
video_shader_ctx_info_t shader_info;
|
||||||
static struct retro_perf_counter frame_run = {0};
|
static struct
|
||||||
|
retro_perf_counter frame_run = {0};
|
||||||
gl_t *gl = (gl_t*)data;
|
gl_t *gl = (gl_t*)data;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
performance_counter_init(&frame_run, "frame_run");
|
performance_counter_init(&frame_run, "frame_run");
|
||||||
performance_counter_start(&frame_run);
|
performance_counter_start(&frame_run);
|
||||||
@ -1107,8 +1106,6 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
context_bind_hw_render(false);
|
context_bind_hw_render(false);
|
||||||
|
|
||||||
#ifndef HAVE_OPENGLES
|
#ifndef HAVE_OPENGLES
|
||||||
@ -1146,7 +1143,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
mode.width = width;
|
mode.width = width;
|
||||||
mode.height = height;
|
mode.height = height;
|
||||||
|
|
||||||
video_context_driver_set_resize(&mode);
|
video_context_driver_set_resize(mode);
|
||||||
|
|
||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
if (gl->fbo_inited)
|
if (gl->fbo_inited)
|
||||||
@ -1279,10 +1276,10 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
if (gl->menu_texture_enable)
|
if (gl->menu_texture_enable)
|
||||||
{
|
{
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
|
|
||||||
if (gl->menu_texture_enable)
|
if (gl->menu_texture_enable)
|
||||||
gl_draw_texture(gl);
|
gl_draw_texture(gl, video_info);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1290,7 +1287,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
font_driver_render_msg(NULL, msg, NULL);
|
font_driver_render_msg(NULL, msg, NULL);
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
gl_render_overlay(gl);
|
gl_render_overlay(gl, video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
video_context_driver_update_window_title(video_info);
|
video_context_driver_update_window_title(video_info);
|
||||||
@ -1339,7 +1336,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
/* Disable BFI during fast forward, slow-motion,
|
/* Disable BFI during fast forward, slow-motion,
|
||||||
* and pause to prevent flicker. */
|
* and pause to prevent flicker. */
|
||||||
if (
|
if (
|
||||||
video_info.black_frame_insertion
|
video_info->black_frame_insertion
|
||||||
&& !input_driver_is_nonblock_state()
|
&& !input_driver_is_nonblock_state()
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
||||||
@ -1351,7 +1348,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
video_context_driver_swap_buffers(video_info);
|
video_context_driver_swap_buffers(video_info);
|
||||||
|
|
||||||
#ifdef HAVE_GL_SYNC
|
#ifdef HAVE_GL_SYNC
|
||||||
if (video_info.hard_sync && gl->have_sync)
|
if (video_info->hard_sync && gl->have_sync)
|
||||||
{
|
{
|
||||||
static struct retro_perf_counter gl_fence = {0};
|
static struct retro_perf_counter gl_fence = {0};
|
||||||
|
|
||||||
@ -1361,7 +1358,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
gl->fences[gl->fence_count++] =
|
gl->fences[gl->fence_count++] =
|
||||||
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
|
|
||||||
while (gl->fence_count > video_info.hard_sync_frames)
|
while (gl->fence_count > video_info->hard_sync_frames)
|
||||||
{
|
{
|
||||||
glClientWaitSync(gl->fences[0],
|
glClientWaitSync(gl->fences[0],
|
||||||
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
GL_SYNC_FLUSH_COMMANDS_BIT, 1000000000);
|
||||||
|
@ -49,14 +49,14 @@ void gl_load_texture_data(
|
|||||||
const void *frame, unsigned base_size);
|
const void *frame, unsigned base_size);
|
||||||
|
|
||||||
void gl_renderchain_render(gl_t *gl,
|
void gl_renderchain_render(gl_t *gl,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
uint64_t frame_count,
|
uint64_t frame_count,
|
||||||
const struct video_tex_info *tex_info,
|
const struct video_tex_info *tex_info,
|
||||||
const struct video_tex_info *feedback_info);
|
const struct video_tex_info *feedback_info);
|
||||||
|
|
||||||
void gl_renderchain_init(gl_t *gl, unsigned fbo_width, unsigned fbo_height);
|
void gl_renderchain_init(gl_t *gl, unsigned fbo_width, unsigned fbo_height);
|
||||||
|
|
||||||
void gl_set_viewport(void *data, video_frame_info_t video_info,
|
void gl_set_viewport(void *data, video_frame_info_t *video_info,
|
||||||
unsigned viewport_width,
|
unsigned viewport_width,
|
||||||
unsigned viewport_height, bool force_full, bool allow_rotate);
|
unsigned viewport_height, bool force_full, bool allow_rotate);
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ void gl_renderchain_recompute_pass_sizes(gl_t *gl,
|
|||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
unsigned vp_width, unsigned vp_height);
|
unsigned vp_width, unsigned vp_height);
|
||||||
|
|
||||||
void gl_renderchain_start_render(gl_t *gl, video_frame_info_t video_info);
|
void gl_renderchain_start_render(gl_t *gl, video_frame_info_t *video_info);
|
||||||
|
|
||||||
void gl_check_fbo_dimensions(gl_t *gl);
|
void gl_check_fbo_dimensions(gl_t *gl);
|
||||||
|
|
||||||
|
@ -239,7 +239,7 @@ void gl_check_fbo_dimensions(gl_t *gl)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
void gl_renderchain_render(gl_t *gl,
|
void gl_renderchain_render(gl_t *gl,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
uint64_t frame_count,
|
uint64_t frame_count,
|
||||||
const struct video_tex_info *tex_info,
|
const struct video_tex_info *tex_info,
|
||||||
const struct video_tex_info *feedback_info)
|
const struct video_tex_info *feedback_info)
|
||||||
@ -249,7 +249,6 @@ void gl_renderchain_render(gl_t *gl,
|
|||||||
video_shader_ctx_coords_t coords;
|
video_shader_ctx_coords_t coords;
|
||||||
video_shader_ctx_params_t params;
|
video_shader_ctx_params_t params;
|
||||||
video_shader_ctx_info_t shader_info;
|
video_shader_ctx_info_t shader_info;
|
||||||
unsigned width, height;
|
|
||||||
const struct video_fbo_rect *prev_rect;
|
const struct video_fbo_rect *prev_rect;
|
||||||
struct video_tex_info *fbo_info;
|
struct video_tex_info *fbo_info;
|
||||||
struct video_tex_info fbo_tex_info[GFX_MAX_SHADERS];
|
struct video_tex_info fbo_tex_info[GFX_MAX_SHADERS];
|
||||||
@ -257,8 +256,8 @@ void gl_renderchain_render(gl_t *gl,
|
|||||||
GLfloat xamt, yamt;
|
GLfloat xamt, yamt;
|
||||||
unsigned fbo_tex_info_cnt = 0;
|
unsigned fbo_tex_info_cnt = 0;
|
||||||
GLfloat fbo_tex_coords[8] = {0.0f};
|
GLfloat fbo_tex_coords[8] = {0.0f};
|
||||||
|
unsigned width = video_info->width;
|
||||||
video_driver_get_size(&width, &height);
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
/* Render the rest of our passes. */
|
/* Render the rest of our passes. */
|
||||||
gl->coords.tex_coord = fbo_tex_coords;
|
gl->coords.tex_coord = fbo_tex_coords;
|
||||||
@ -667,7 +666,7 @@ void gl_renderchain_recompute_pass_sizes(gl_t *gl,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gl_renderchain_start_render(gl_t *gl, video_frame_info_t video_info)
|
void gl_renderchain_start_render(gl_t *gl, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
glBindTexture(GL_TEXTURE_2D, gl->texture[gl->tex_index]);
|
||||||
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[0]);
|
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, gl->fbo[0]);
|
||||||
|
@ -27,6 +27,11 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#include "../../menu/menu_display.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
#include "../../memory/wii/mem2_manager.h"
|
#include "../../memory/wii/mem2_manager.h"
|
||||||
#endif
|
#endif
|
||||||
@ -36,8 +41,6 @@
|
|||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
#include "../../menu/menu_driver.h"
|
|
||||||
#include "../../menu/menu_display.h"
|
|
||||||
|
|
||||||
extern syssram* __SYS_LockSram(void);
|
extern syssram* __SYS_LockSram(void);
|
||||||
extern u32 __SYS_UnlockSram(u32 write);
|
extern u32 __SYS_UnlockSram(u32 write);
|
||||||
@ -1438,7 +1441,7 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
uint64_t frame_count, unsigned pitch,
|
uint64_t frame_count, unsigned pitch,
|
||||||
const char *msg,
|
const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char fps_txt[128];
|
char fps_txt[128];
|
||||||
char fps_text_buf[128];
|
char fps_text_buf[128];
|
||||||
@ -1500,12 +1503,9 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
if (gx->menu_texture_enable && gx->menu_data)
|
if (gx->menu_texture_enable && gx->menu_data)
|
||||||
{
|
{
|
||||||
size_t fb_pitch;
|
unsigned fb_width = menu_display_get_width();
|
||||||
unsigned fb_width, fb_height;
|
unsigned fb_height = menu_display_get_height();
|
||||||
|
size_t fb_pitch = menu_display_get_framebuffer_pitch();
|
||||||
fb_width = menu_display_get_width();
|
|
||||||
fb_height = menu_display_get_height();
|
|
||||||
fb_pitch = menu_display_get_framebuffer_pitch();
|
|
||||||
|
|
||||||
convert_texture16(
|
convert_texture16(
|
||||||
gx->menu_data,
|
gx->menu_data,
|
||||||
@ -1518,6 +1518,10 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
fb_width * fb_pitch);
|
fb_width * fb_pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
GX_InvalidateTexAll();
|
GX_InvalidateTexAll();
|
||||||
|
|
||||||
GX_SetCurrentMtx(GX_PNMTX0);
|
GX_SetCurrentMtx(GX_PNMTX0);
|
||||||
@ -1538,10 +1542,7 @@ static bool gx_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
GX_DrawDone();
|
GX_DrawDone();
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, fps_txt, sizeof(fps_txt),
|
if (video_info->fps_show)
|
||||||
fps_text_buf, sizeof(fps_text_buf));
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
{
|
||||||
char mem1_txt[128];
|
char mem1_txt[128];
|
||||||
char mem2_txt[128];
|
char mem2_txt[128];
|
||||||
|
@ -32,7 +32,7 @@ static void *null_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool null_gfx_frame(void *data, const void *frame,
|
static bool null_gfx_frame(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)frame;
|
(void)frame;
|
||||||
|
@ -25,12 +25,16 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <linux/omapfb.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#ifdef HAVE_MENU
|
||||||
#include <linux/omapfb.h>
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
||||||
#include <retro_assert.h>
|
#include <retro_assert.h>
|
||||||
@ -985,7 +989,7 @@ fail:
|
|||||||
|
|
||||||
static bool omap_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool omap_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
omap_video_t *vid = (omap_video_t*)data;
|
omap_video_t *vid = (omap_video_t*)data;
|
||||||
|
|
||||||
@ -1008,10 +1012,16 @@ static bool omap_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
omapfb_prepare(vid->omap);
|
omapfb_prepare(vid->omap);
|
||||||
omapfb_blit_frame(vid->omap, frame, vid->height, pitch);
|
omapfb_blit_frame(vid->omap, frame, vid->height, pitch);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (vid->menu.active)
|
if (vid->menu.active)
|
||||||
omapfb_blit_frame(vid->omap, vid->menu.frame,
|
omapfb_blit_frame(vid->omap, vid->menu.frame,
|
||||||
vid->menu.scaler.out_height,
|
vid->menu.scaler.out_height,
|
||||||
vid->menu.scaler.out_stride);
|
vid->menu.scaler.out_stride);
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
omap_render_msg(vid, msg);
|
omap_render_msg(vid, msg);
|
||||||
|
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../defines/psp_defines.h"
|
#include "../../defines/psp_defines.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
|
|
||||||
@ -467,7 +471,7 @@ static void *psp_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool psp_frame(void *data, const void *frame,
|
static bool psp_frame(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
#ifdef DISPLAY_FPS
|
#ifdef DISPLAY_FPS
|
||||||
uint32_t diff;
|
uint32_t diff;
|
||||||
@ -476,8 +480,6 @@ static bool psp_frame(void *data, const void *frame,
|
|||||||
static float fps = 0.0;
|
static float fps = 0.0;
|
||||||
#endif
|
#endif
|
||||||
static struct retro_perf_counter psp_frame_run = {0};
|
static struct retro_perf_counter psp_frame_run = {0};
|
||||||
static char fps_txt[128] = {0};
|
|
||||||
static char fps_text_buf[128] = {0};
|
|
||||||
psp1_video_t *psp = (psp1_video_t*)data;
|
psp1_video_t *psp = (psp1_video_t*)data;
|
||||||
|
|
||||||
if (!width || !height)
|
if (!width || !height)
|
||||||
@ -495,14 +497,10 @@ static bool psp_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
pspDebugScreenSetXY(0,0);
|
pspDebugScreenSetXY(0,0);
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, fps_txt, sizeof(fps_txt),
|
if (video_info->fps_show)
|
||||||
video_info.fps_show ? fps_text_buf : NULL,
|
|
||||||
video_info.fps_show ? sizeof(fps_text_buf) : 0);
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
{
|
||||||
pspDebugScreenSetXY(68 - strlen(fps_text_buf) - 1,0);
|
pspDebugScreenSetXY(68 - strlen(video_info->fps_text) - 1,0);
|
||||||
pspDebugScreenPuts(fps_text_buf);
|
pspDebugScreenPuts(video_info->fps_text);
|
||||||
pspDebugScreenSetXY(0,1);
|
pspDebugScreenSetXY(0,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -567,6 +565,10 @@ static bool psp_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
performance_counter_stop(&psp_frame_run);
|
performance_counter_stop(&psp_frame_run);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(psp->menu.active)
|
if(psp->menu.active)
|
||||||
{
|
{
|
||||||
sceGuSendList(GU_TAIL, psp->menu.dList, &(psp->menu.context_storage));
|
sceGuSendList(GU_TAIL, psp->menu.dList, &(psp->menu.context_storage));
|
||||||
|
@ -498,13 +498,10 @@ static void check_window(sdl2_video_t *vid)
|
|||||||
|
|
||||||
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count,
|
unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
sdl2_video_t *vid = (sdl2_video_t*)data;
|
sdl2_video_t *vid = (sdl2_video_t*)data;
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
|
|
||||||
if (vid->should_resize)
|
if (vid->should_resize)
|
||||||
sdl_refresh_viewport(vid);
|
sdl_refresh_viewport(vid);
|
||||||
|
|
||||||
@ -525,7 +522,7 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);
|
SDL_RenderCopyEx(vid->renderer, vid->frame.tex, NULL, NULL, vid->rotation, NULL, SDL_FLIP_NONE);
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (vid->menu.active)
|
if (vid->menu.active)
|
||||||
@ -536,8 +533,17 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
|
|
||||||
SDL_RenderPresent(vid->renderer);
|
SDL_RenderPresent(vid->renderer);
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0))
|
if (video_info->monitor_fps_enable)
|
||||||
SDL_SetWindowTitle(vid->window, buf);
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
|
title[0] = '\0';
|
||||||
|
|
||||||
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
|
|
||||||
|
if (title[0])
|
||||||
|
SDL_SetWindowTitle(vid->window, title);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_X11
|
#ifdef HAVE_X11
|
||||||
#include "../common/x11_common.h"
|
#include "../common/x11_common.h"
|
||||||
#endif
|
#endif
|
||||||
@ -331,17 +335,14 @@ static void sdl_gfx_check_window(sdl_video_t *vid)
|
|||||||
|
|
||||||
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count,
|
unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
static struct retro_perf_counter sdl_scale = {0};
|
static struct retro_perf_counter sdl_scale = {0};
|
||||||
sdl_video_t *vid = (sdl_video_t*)data;
|
sdl_video_t *vid = (sdl_video_t*)data;
|
||||||
|
|
||||||
if (!frame)
|
if (!frame)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
|
|
||||||
if (SDL_MUSTLOCK(vid->screen))
|
if (SDL_MUSTLOCK(vid->screen))
|
||||||
SDL_LockSurface(vid->screen);
|
SDL_LockSurface(vid->screen);
|
||||||
|
|
||||||
@ -361,6 +362,10 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
pitch);
|
pitch);
|
||||||
performance_counter_stop(&sdl_scale);
|
performance_counter_stop(&sdl_scale);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (vid->menu.active)
|
if (vid->menu.active)
|
||||||
SDL_BlitSurface(vid->menu.frame, NULL, vid->screen, NULL);
|
SDL_BlitSurface(vid->menu.frame, NULL, vid->screen, NULL);
|
||||||
|
|
||||||
@ -370,8 +375,8 @@ static bool sdl_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
if (SDL_MUSTLOCK(vid->screen))
|
if (SDL_MUSTLOCK(vid->screen))
|
||||||
SDL_UnlockSurface(vid->screen);
|
SDL_UnlockSurface(vid->screen);
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0))
|
if (video_info->monitor_fps_enable)
|
||||||
SDL_WM_SetCaption(buf, NULL);
|
SDL_WM_SetCaption(video_info->window_text, NULL);
|
||||||
|
|
||||||
SDL_Flip(vid->screen);
|
SDL_Flip(vid->screen);
|
||||||
|
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
#include "../font_driver.h"
|
#include "../font_driver.h"
|
||||||
@ -763,7 +767,7 @@ static void sunxi_setup_scale (void *data,
|
|||||||
|
|
||||||
static bool sunxi_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool sunxi_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
unsigned height, uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
struct sunxi_video *_dispvars = (struct sunxi_video*)data;
|
struct sunxi_video *_dispvars = (struct sunxi_video*)data;
|
||||||
|
|
||||||
@ -779,13 +783,12 @@ static bool sunxi_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
sunxi_setup_scale(_dispvars, width, height, pitch);
|
sunxi_setup_scale(_dispvars, width, height, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (_dispvars->menu_active)
|
if (_dispvars->menu_active)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
|
|
||||||
buf[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0);
|
|
||||||
ioctl(_dispvars->sunxi_disp->fd_fb, FBIO_WAITFORVSYNC, 0);
|
ioctl(_dispvars->sunxi_disp->fd_fb, FBIO_WAITFORVSYNC, 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,10 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
@ -281,10 +285,10 @@ static void vg_free(void *data)
|
|||||||
free(vg);
|
free(vg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vg_calculate_quad(vg_t *vg)
|
static void vg_calculate_quad(vg_t *vg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
unsigned width = video_info->width;
|
||||||
video_driver_get_size(&width, &height);
|
unsigned heigh = video_info->height;
|
||||||
|
|
||||||
/* set viewport for aspect ratio, taken from the OpenGL driver. */
|
/* set viewport for aspect ratio, taken from the OpenGL driver. */
|
||||||
if (vg->keep_aspect)
|
if (vg->keep_aspect)
|
||||||
@ -378,25 +382,24 @@ static void vg_copy_frame(void *data, const void *frame,
|
|||||||
static bool vg_frame(void *data, const void *frame,
|
static bool vg_frame(void *data, const void *frame,
|
||||||
unsigned frame_width, unsigned frame_height,
|
unsigned frame_width, unsigned frame_height,
|
||||||
uint64_t frame_count, unsigned pitch, const char *msg,
|
uint64_t frame_count, unsigned pitch, const char *msg,
|
||||||
video_frame_info_t video_info)
|
video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
vg_t *vg = (vg_t*)data;
|
vg_t *vg = (vg_t*)data;
|
||||||
static struct retro_perf_counter vg_fr = {0};
|
static struct retro_perf_counter vg_fr = {0};
|
||||||
static struct retro_perf_counter vg_image = {0};
|
static struct retro_perf_counter vg_image = {0};
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
performance_counter_init(&vg_fr, "vg_fr");
|
performance_counter_init(&vg_fr, "vg_fr");
|
||||||
performance_counter_start(&vg_fr);
|
performance_counter_start(&vg_fr);
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
if ( frame_width != vg->mRenderWidth
|
if ( frame_width != vg->mRenderWidth
|
||||||
|| frame_height != vg->mRenderHeight
|
|| frame_height != vg->mRenderHeight
|
||||||
|| vg->should_resize)
|
|| vg->should_resize)
|
||||||
{
|
{
|
||||||
vg->mRenderWidth = frame_width;
|
vg->mRenderWidth = frame_width;
|
||||||
vg->mRenderHeight = frame_height;
|
vg->mRenderHeight = frame_height;
|
||||||
vg_calculate_quad(vg);
|
vg_calculate_quad(vg, video_info);
|
||||||
matrix_3x3_quad_to_quad(
|
matrix_3x3_quad_to_quad(
|
||||||
vg->x1, vg->y1, vg->x2, vg->y1, vg->x2, vg->y2, vg->x1, vg->y2,
|
vg->x1, vg->y1, vg->x2, vg->y1, vg->x2, vg->y2, vg->x1, vg->y2,
|
||||||
/* needs to be flipped, Khronos loves their bottom-left origin */
|
/* needs to be flipped, Khronos loves their bottom-left origin */
|
||||||
@ -417,6 +420,10 @@ static bool vg_frame(void *data, const void *frame,
|
|||||||
vg_copy_frame(vg, frame, frame_width, frame_height, pitch);
|
vg_copy_frame(vg, frame, frame_width, frame_height, pitch);
|
||||||
performance_counter_stop(&vg_image);
|
performance_counter_stop(&vg_image);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
vgDrawImage(vg->mImage);
|
vgDrawImage(vg->mImage);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -133,54 +133,55 @@ static void vita2d_gfx_update_viewport(vita_video_t* vita);
|
|||||||
|
|
||||||
static bool vita2d_gfx_frame(void *data, const void *frame,
|
static bool vita2d_gfx_frame(void *data, const void *frame,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
void *tex_p;
|
void *tex_p;
|
||||||
vita_video_t *vita = (vita_video_t *)data;
|
vita_video_t *vita = (vita_video_t *)data;
|
||||||
|
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
if(!(vita->texture&&vita2d_texture_get_datap(vita->texture)==frame)){
|
if(!(vita->texture&&vita2d_texture_get_datap(vita->texture)==frame))
|
||||||
unsigned i;
|
{
|
||||||
unsigned int stride;
|
unsigned i;
|
||||||
|
unsigned int stride;
|
||||||
|
|
||||||
if ((width != vita->width || height != vita->height) && vita->texture)
|
if ((width != vita->width || height != vita->height) && vita->texture)
|
||||||
{
|
{
|
||||||
vita2d_free_texture(vita->texture);
|
vita2d_free_texture(vita->texture);
|
||||||
vita->texture = NULL;
|
vita->texture = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vita->texture)
|
if (!vita->texture)
|
||||||
{
|
{
|
||||||
RARCH_LOG("Creating texture: %ix%i\n", width, height);
|
RARCH_LOG("Creating texture: %ix%i\n", width, height);
|
||||||
vita->width = width;
|
vita->width = width;
|
||||||
vita->height = height;
|
vita->height = height;
|
||||||
vita->texture = vita2d_create_empty_texture_format(width, height, vita->format);
|
vita->texture = vita2d_create_empty_texture_format(width, height, vita->format);
|
||||||
vita2d_texture_set_filters(vita->texture,vita->tex_filter,vita->tex_filter);
|
vita2d_texture_set_filters(vita->texture,vita->tex_filter,vita->tex_filter);
|
||||||
}
|
}
|
||||||
tex_p = vita2d_texture_get_datap(vita->texture);
|
tex_p = vita2d_texture_get_datap(vita->texture);
|
||||||
stride = vita2d_texture_get_stride(vita->texture);
|
stride = vita2d_texture_get_stride(vita->texture);
|
||||||
|
|
||||||
if (vita->format == SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1RGB)
|
if (vita->format == SCE_GXM_TEXTURE_FORMAT_X8U8U8U8_1RGB)
|
||||||
{
|
{
|
||||||
stride /= 4;
|
stride /= 4;
|
||||||
pitch /= 4;
|
pitch /= 4;
|
||||||
uint32_t *tex32 = tex_p;
|
uint32_t *tex32 = tex_p;
|
||||||
const uint32_t *frame32 = frame;
|
const uint32_t *frame32 = frame;
|
||||||
|
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
memcpy_neon(&tex32[i*stride],&frame32[i*pitch],pitch*sizeof(uint32_t));
|
memcpy_neon(&tex32[i*stride],&frame32[i*pitch],pitch*sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
stride /= 2;
|
stride /= 2;
|
||||||
pitch /= 2;
|
pitch /= 2;
|
||||||
uint16_t *tex16 = tex_p;
|
uint16_t *tex16 = tex_p;
|
||||||
const uint16_t *frame16 = frame;
|
const uint16_t *frame16 = frame;
|
||||||
|
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
memcpy_neon(&tex16[i*stride],&frame16[i*pitch],width*sizeof(uint16_t));
|
memcpy_neon(&tex16[i*stride],&frame16[i*pitch],width*sizeof(uint16_t));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,22 +206,10 @@ static bool vita2d_gfx_frame(void *data, const void *frame,
|
|||||||
float scalex = vita->vp.width / (float)vita->width;
|
float scalex = vita->vp.width / (float)vita->width;
|
||||||
float scaley = vita->vp.height / (float)vita->height;
|
float scaley = vita->vp.height / (float)vita->height;
|
||||||
vita2d_draw_texture_scale_rotate(vita->texture,vita->vp.x,
|
vita2d_draw_texture_scale_rotate(vita->texture,vita->vp.x,
|
||||||
vita->vp.y, scalex, scaley, rad);
|
vita->vp.y, scalex, scaley, rad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
|
||||||
char buffer[128];
|
|
||||||
char buffer_fps[128];
|
|
||||||
|
|
||||||
buffer[0] = buffer_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buffer, sizeof(buffer),
|
|
||||||
video_info.fps_show ? buffer_fps : NULL, sizeof(buffer_fps));
|
|
||||||
runloop_msg_queue_push(buffer_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
if (vita->overlay_enable)
|
if (vita->overlay_enable)
|
||||||
vita2d_render_overlay(vita);
|
vita2d_render_overlay(vita);
|
||||||
@ -228,42 +217,40 @@ static bool vita2d_gfx_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
if (vita->menu.active)
|
if (vita->menu.active)
|
||||||
{
|
{
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
if(vita->menu.texture){
|
#endif
|
||||||
if (vita->fullscreen)
|
|
||||||
vita2d_draw_texture_scale(vita->menu.texture,
|
|
||||||
0, 0,
|
|
||||||
PSP_FB_WIDTH / (float)vita->menu.width,
|
|
||||||
PSP_FB_HEIGHT / (float)vita->menu.height);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (vita->menu.width > vita->menu.height)
|
|
||||||
{
|
|
||||||
float scale = PSP_FB_HEIGHT / (float)vita->menu.height;
|
|
||||||
float w = vita->menu.width * scale;
|
|
||||||
vita2d_draw_texture_scale(vita->menu.texture,
|
|
||||||
PSP_FB_WIDTH / 2.0f - w/2.0f, 0.0f,
|
|
||||||
scale, scale);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float scale = PSP_FB_WIDTH / (float)vita->menu.width;
|
|
||||||
float h = vita->menu.height * scale;
|
|
||||||
vita2d_draw_texture_scale(vita->menu.texture,
|
|
||||||
0.0f, PSP_FB_HEIGHT / 2.0f - h/2.0f,
|
|
||||||
scale, scale);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if(vita->menu.texture){
|
||||||
|
if (vita->fullscreen)
|
||||||
|
vita2d_draw_texture_scale(vita->menu.texture,
|
||||||
|
0, 0,
|
||||||
|
PSP_FB_WIDTH / (float)vita->menu.width,
|
||||||
|
PSP_FB_HEIGHT / (float)vita->menu.height);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (vita->menu.width > vita->menu.height)
|
||||||
|
{
|
||||||
|
float scale = PSP_FB_HEIGHT / (float)vita->menu.height;
|
||||||
|
float w = vita->menu.width * scale;
|
||||||
|
vita2d_draw_texture_scale(vita->menu.texture,
|
||||||
|
PSP_FB_WIDTH / 2.0f - w/2.0f, 0.0f,
|
||||||
|
scale, scale);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
float scale = PSP_FB_WIDTH / (float)vita->menu.width;
|
||||||
|
float h = vita->menu.height * scale;
|
||||||
|
vita2d_draw_texture_scale(vita->menu.texture,
|
||||||
|
0.0f, PSP_FB_HEIGHT / 2.0f - h/2.0f,
|
||||||
|
scale, scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!string_is_empty(msg))
|
if(!string_is_empty(msg))
|
||||||
font_driver_render_msg(NULL, msg, NULL);
|
font_driver_render_msg(NULL, msg, NULL);
|
||||||
|
|
||||||
vita2d_end_drawing();
|
vita2d_end_drawing();
|
||||||
vita2d_swap_buffers();
|
vita2d_swap_buffers();
|
||||||
|
@ -54,7 +54,7 @@ static void vulkan_set_viewport(void *data, unsigned viewport_width,
|
|||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
static void vulkan_overlay_free(vk_t *vk);
|
static void vulkan_overlay_free(vk_t *vk);
|
||||||
static void vulkan_render_overlay(vk_t *vk);
|
static void vulkan_render_overlay(vk_t *vk, video_frame_info_t *video_info);
|
||||||
#endif
|
#endif
|
||||||
static void vulkan_viewport_info(void *data, struct video_viewport *vp);
|
static void vulkan_viewport_info(void *data, struct video_viewport *vp);
|
||||||
|
|
||||||
@ -1463,7 +1463,7 @@ static void vulkan_readback(vk_t *vk)
|
|||||||
VK_PIPELINE_STAGE_HOST_BIT);
|
VK_PIPELINE_STAGE_HOST_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vulkan_inject_black_frame(vk_t *vk, video_frame_info_t video_info)
|
static void vulkan_inject_black_frame(vk_t *vk, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
VkCommandBufferBeginInfo begin_info = {
|
VkCommandBufferBeginInfo begin_info = {
|
||||||
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
||||||
@ -1520,10 +1520,10 @@ static void vulkan_inject_black_frame(vk_t *vk, video_frame_info_t video_info)
|
|||||||
static bool vulkan_frame(void *data, const void *frame,
|
static bool vulkan_frame(void *data, const void *frame,
|
||||||
unsigned frame_width, unsigned frame_height,
|
unsigned frame_width, unsigned frame_height,
|
||||||
uint64_t frame_count,
|
uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
struct vk_per_frame *chain;
|
struct vk_per_frame *chain;
|
||||||
unsigned width, height;
|
VkSemaphore signal_semaphores[2];
|
||||||
VkClearValue clear_value;
|
VkClearValue clear_value;
|
||||||
vk_t *vk = (vk_t*)data;
|
vk_t *vk = (vk_t*)data;
|
||||||
static struct retro_perf_counter frame_run = {0};
|
static struct retro_perf_counter frame_run = {0};
|
||||||
@ -1534,7 +1534,8 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
static struct retro_perf_counter swapbuffers = {0};
|
static struct retro_perf_counter swapbuffers = {0};
|
||||||
static struct retro_perf_counter queue_submit = {0};
|
static struct retro_perf_counter queue_submit = {0};
|
||||||
bool waits_for_semaphores = false;
|
bool waits_for_semaphores = false;
|
||||||
VkSemaphore signal_semaphores[2];
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
VkCommandBufferBeginInfo begin_info = {
|
VkCommandBufferBeginInfo begin_info = {
|
||||||
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
|
||||||
@ -1554,8 +1555,6 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
performance_counter_init(&end_cmd, "end_command");
|
performance_counter_init(&end_cmd, "end_command");
|
||||||
performance_counter_start(&frame_run);
|
performance_counter_start(&frame_run);
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
/* Bookkeeping on start of frame. */
|
/* Bookkeeping on start of frame. */
|
||||||
chain = &vk->swapchain[frame_index];
|
chain = &vk->swapchain[frame_index];
|
||||||
vk->chain = chain;
|
vk->chain = chain;
|
||||||
@ -1738,7 +1737,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
if (vk->menu.enable)
|
if (vk->menu.enable)
|
||||||
{
|
{
|
||||||
menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL);
|
menu_driver_frame(video_info);
|
||||||
|
|
||||||
if (vk->menu.textures[vk->menu.last_index].image != VK_NULL_HANDLE)
|
if (vk->menu.textures[vk->menu.last_index].image != VK_NULL_HANDLE)
|
||||||
{
|
{
|
||||||
@ -1779,7 +1778,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
if (vk->overlay.enable)
|
if (vk->overlay.enable)
|
||||||
vulkan_render_overlay(vk);
|
vulkan_render_overlay(vk, video_info);
|
||||||
#endif
|
#endif
|
||||||
performance_counter_stop(&build_cmd);
|
performance_counter_stop(&build_cmd);
|
||||||
|
|
||||||
@ -1922,7 +1921,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
gfx_ctx_mode_t mode;
|
gfx_ctx_mode_t mode;
|
||||||
mode.width = width;
|
mode.width = width;
|
||||||
mode.height = height;
|
mode.height = height;
|
||||||
video_context_driver_set_resize(&mode);
|
video_context_driver_set_resize(mode);
|
||||||
|
|
||||||
vk->should_resize = false;
|
vk->should_resize = false;
|
||||||
}
|
}
|
||||||
@ -1931,7 +1930,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
/* Disable BFI during fast forward, slow-motion,
|
/* Disable BFI during fast forward, slow-motion,
|
||||||
* and pause to prevent flicker. */
|
* and pause to prevent flicker. */
|
||||||
if (
|
if (
|
||||||
video_info.black_frame_insertion
|
video_info->black_frame_insertion
|
||||||
&& !input_driver_is_nonblock_state()
|
&& !input_driver_is_nonblock_state()
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
&& !runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL)
|
||||||
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
&& !runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL))
|
||||||
@ -2394,17 +2393,17 @@ static void vulkan_overlay_set_alpha(void *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vulkan_render_overlay(vk_t *vk)
|
static void vulkan_render_overlay(vk_t *vk, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
struct video_viewport vp;
|
struct video_viewport vp;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
|
||||||
if (!vk)
|
if (!vk)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
vp = vk->vp;
|
||||||
vp = vk->vp;
|
|
||||||
vulkan_set_viewport(vk, width, height, vk->overlay.full_screen, false);
|
vulkan_set_viewport(vk, width, height, vk->overlay.full_screen, false);
|
||||||
|
|
||||||
for (i = 0; i < vk->overlay.count; i++)
|
for (i = 0; i < vk->overlay.count; i++)
|
||||||
|
@ -13,14 +13,23 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <coreinit/screen.h>
|
||||||
|
#include <coreinit/cache.h>
|
||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "performance_counters.h"
|
#include "performance_counters.h"
|
||||||
|
|
||||||
#include <string.h>
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <coreinit/screen.h>
|
#include "../../config.h"
|
||||||
#include <coreinit/cache.h>
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gx2.h"
|
#include "gx2.h"
|
||||||
#include "system/memory.h"
|
#include "system/memory.h"
|
||||||
#include "system/wiiu.h"
|
#include "system/wiiu.h"
|
||||||
@ -550,7 +559,7 @@ static void wiiu_gfx_free(void* data)
|
|||||||
|
|
||||||
static bool wiiu_gfx_frame(void* data, const void* frame,
|
static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char* msg, video_frame_info_t video_info)
|
unsigned pitch, const char* msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)msg;
|
(void)msg;
|
||||||
int i;
|
int i;
|
||||||
@ -668,6 +677,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
|
|||||||
|
|
||||||
GX2DrawEx(GX2_PRIMITIVE_MODE_QUADS, 4, 0, 1);
|
GX2DrawEx(GX2_PRIMITIVE_MODE_QUADS, 4, 0, 1);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (wiiu->menu.enable)
|
if (wiiu->menu.enable)
|
||||||
{
|
{
|
||||||
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->menu.position), sizeof(*wiiu->menu.position), wiiu->menu.position);
|
GX2SetAttribBuffer(0, 4 * sizeof(*wiiu->menu.position), sizeof(*wiiu->menu.position), wiiu->menu.position);
|
||||||
|
@ -192,7 +192,7 @@ static void *xenon360_gfx_init(const video_info_t *video, const input_driver_t *
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool xenon360_gfx_frame(void *data, const void *frame, unsigned width, unsigned height,
|
static bool xenon360_gfx_frame(void *data, const void *frame, unsigned width, unsigned height,
|
||||||
uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t video_info)
|
uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gl_t *vid = data;
|
gl_t *vid = data;
|
||||||
|
|
||||||
@ -230,6 +230,10 @@ static bool xenon360_gfx_frame(void *data, const void *frame, unsigned width, un
|
|||||||
Xe_SetShader(vid->gl_device, SHADER_TYPE_PIXEL, vid->g_pPixelTexturedShader, 0);
|
Xe_SetShader(vid->gl_device, SHADER_TYPE_PIXEL, vid->g_pPixelTexturedShader, 0);
|
||||||
Xe_SetShader(vid->gl_device, SHADER_TYPE_VERTEX, vid->g_pVertexShader, 0);
|
Xe_SetShader(vid->gl_device, SHADER_TYPE_VERTEX, vid->g_pVertexShader, 0);
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
Xe_DrawPrimitive(vid->gl_device, XE_PRIMTYPE_TRIANGLELIST, 0, 1);
|
Xe_DrawPrimitive(vid->gl_device, XE_PRIMTYPE_TRIANGLELIST, 0, 1);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ static void *xshm_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
static bool xshm_gfx_frame(void *data, const void *frame, unsigned width,
|
static bool xshm_gfx_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count,
|
unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
xshm_t* xshm = (xshm_t*)data;
|
xshm_t* xshm = (xshm_t*)data;
|
||||||
int y;
|
int y;
|
||||||
@ -105,6 +105,10 @@ static bool xshm_gfx_frame(void *data, const void *frame, unsigned width,
|
|||||||
(uint8_t*)frame + pitch*y, pitch);
|
(uint8_t*)frame + pitch*y, pitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
XShmPutImage(xshm->display, xshm->wndw, xshm->gc, xshm->image,
|
XShmPutImage(xshm->display, xshm->wndw, xshm->gc, xshm->image,
|
||||||
0, 0, 0, 0, xshm->width, xshm->height, False);
|
0, 0, 0, 0, xshm->width, xshm->height, False);
|
||||||
XFlush(xshm->display);
|
XFlush(xshm->display);
|
||||||
|
@ -30,6 +30,14 @@
|
|||||||
|
|
||||||
#include <retro_inline.h>
|
#include <retro_inline.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "../../config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
#include "../../menu/menu_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
@ -530,8 +538,17 @@ static void *xv_init(const video_info_t *video,
|
|||||||
|
|
||||||
video_driver_build_info(&video_info);
|
video_driver_build_info(&video_info);
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0))
|
if (video_info.monitor_fps_enable)
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
|
title[0] = '\0';
|
||||||
|
|
||||||
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
|
|
||||||
|
if (title[0])
|
||||||
|
XStoreName(g_x11_dpy, g_x11_win, title);
|
||||||
|
}
|
||||||
|
|
||||||
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
||||||
|
|
||||||
@ -784,7 +801,7 @@ static void xv_render_msg(xv_t *xv, const char *msg,
|
|||||||
|
|
||||||
static bool xv_frame(void *data, const void *frame, unsigned width,
|
static bool xv_frame(void *data, const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count,
|
unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
XWindowAttributes target;
|
XWindowAttributes target;
|
||||||
xv_t *xv = (xv_t*)data;
|
xv_t *xv = (xv_t*)data;
|
||||||
@ -802,6 +819,10 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
|
|||||||
xv->vp.full_width = target.width;
|
xv->vp.full_width = target.width;
|
||||||
xv->vp.full_height = target.height;
|
xv->vp.full_height = target.height;
|
||||||
|
|
||||||
|
#ifdef HAVE_MENU
|
||||||
|
menu_driver_frame(video_info);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (msg)
|
if (msg)
|
||||||
xv_render_msg(xv, msg, width << 1, height << 1);
|
xv_render_msg(xv, msg, width << 1, height << 1);
|
||||||
|
|
||||||
@ -811,7 +832,7 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
|
|||||||
true);
|
true);
|
||||||
XSync(g_x11_dpy, False);
|
XSync(g_x11_dpy, False);
|
||||||
|
|
||||||
x11_update_window_title(NULL, video_info);
|
x11_update_title(NULL, video_info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -230,14 +230,12 @@ static void android_gfx_ctx_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void android_gfx_ctx_check_window(void *data, bool *quit,
|
static void android_gfx_ctx_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width = 0;
|
unsigned new_width = 0;
|
||||||
unsigned new_height = 0;
|
unsigned new_height = 0;
|
||||||
android_ctx_data_t *and = (android_ctx_data_t*)data;
|
android_ctx_data_t *and = (android_ctx_data_t*)data;
|
||||||
|
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
*quit = false;
|
*quit = false;
|
||||||
|
|
||||||
switch (android_api)
|
switch (android_api)
|
||||||
@ -314,21 +312,8 @@ static bool android_gfx_ctx_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_gfx_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool android_gfx_ctx_set_video_mode(void *data,
|
static bool android_gfx_ctx_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -436,12 +421,6 @@ static bool android_gfx_ctx_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool android_gfx_ctx_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dpi_get_density(char *s, size_t len)
|
static void dpi_get_density(char *s, size_t len)
|
||||||
{
|
{
|
||||||
system_property_get("getprop", "ro.sf.lcd_density", s);
|
system_property_get("getprop", "ro.sf.lcd_density", s);
|
||||||
@ -493,7 +472,7 @@ dpi_fallback:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_gfx_ctx_swap_buffers(void *data, video_frame_info_t video_info)
|
static void android_gfx_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
android_ctx_data_t *and = (android_ctx_data_t*)data;
|
android_ctx_data_t *and = (android_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -618,12 +597,12 @@ const gfx_ctx_driver_t gfx_ctx_android = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
android_gfx_ctx_get_metrics,
|
android_gfx_ctx_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
android_gfx_ctx_update_window_title,
|
NULL, /* update_title */
|
||||||
android_gfx_ctx_check_window,
|
android_gfx_ctx_check_window,
|
||||||
android_gfx_ctx_set_resize,
|
android_gfx_ctx_set_resize,
|
||||||
android_gfx_ctx_has_focus,
|
android_gfx_ctx_has_focus,
|
||||||
android_gfx_ctx_suppress_screensaver,
|
android_gfx_ctx_suppress_screensaver,
|
||||||
android_gfx_ctx_has_windowed,
|
NULL, /* has_windowed */
|
||||||
android_gfx_ctx_swap_buffers,
|
android_gfx_ctx_swap_buffers,
|
||||||
android_gfx_ctx_input_driver,
|
android_gfx_ctx_input_driver,
|
||||||
android_gfx_ctx_get_proc_address,
|
android_gfx_ctx_get_proc_address,
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include <OpenGL/OpenGL.h>
|
#include <OpenGL/OpenGL.h>
|
||||||
#include <OpenGL/gl.h>
|
#include <OpenGL/gl.h>
|
||||||
|
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
|
|
||||||
typedef int CGSConnectionID;
|
typedef int CGSConnectionID;
|
||||||
@ -78,11 +77,10 @@ static void gfx_ctx_cgl_get_video_size(void *data, unsigned *width, unsigned *he
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_cgl_check_window(void *data, bool *quit,
|
static void gfx_ctx_cgl_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width = 0;
|
||||||
|
unsigned new_height = 0;
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
*quit = false;
|
*quit = false;
|
||||||
|
|
||||||
@ -95,37 +93,15 @@ static void gfx_ctx_cgl_check_window(void *data, bool *quit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_cgl_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_cgl_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)data;
|
gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)data;
|
||||||
|
|
||||||
CGLFlushDrawable(cgl->glCtx);
|
CGLFlushDrawable(cgl->glCtx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_cgl_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_cgl_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static bool gfx_ctx_cgl_set_video_mode(void *data,
|
static bool gfx_ctx_cgl_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -195,12 +171,6 @@ static bool gfx_ctx_cgl_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_cgl_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_cgl_bind_api(void *data, enum gfx_ctx_api api,
|
static bool gfx_ctx_cgl_bind_api(void *data, enum gfx_ctx_api api,
|
||||||
unsigned major, unsigned minor)
|
unsigned major, unsigned minor)
|
||||||
{
|
{
|
||||||
@ -364,12 +334,12 @@ const gfx_ctx_driver_t gfx_ctx_cgl = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_cgl_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_cgl_check_window,
|
gfx_ctx_cgl_check_window,
|
||||||
gfx_ctx_cgl_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_cgl_has_focus,
|
gfx_ctx_cgl_has_focus,
|
||||||
gfx_ctx_cgl_suppress_screensaver,
|
gfx_ctx_cgl_suppress_screensaver,
|
||||||
gfx_ctx_cgl_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_cgl_swap_buffers,
|
gfx_ctx_cgl_swap_buffers,
|
||||||
gfx_ctx_cgl_input_driver,
|
gfx_ctx_cgl_input_driver,
|
||||||
gfx_ctx_cgl_get_proc_address,
|
gfx_ctx_cgl_get_proc_address,
|
||||||
|
@ -330,7 +330,7 @@ static void cocoagl_gfx_ctx_show_mouse(void *data, bool state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height, bool fullscreen)
|
unsigned width, unsigned height, bool fullscreen)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_COCOA)
|
#if defined(HAVE_COCOA)
|
||||||
@ -416,28 +416,27 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
|
|||||||
*height = CGRectGetHeight(size) * screenscale;
|
*height = CGRectGetHeight(size) * screenscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cocoagl_gfx_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
#if defined(HAVE_COCOA)
|
||||||
|
static void cocoagl_gfx_ctx_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_COCOA)
|
|
||||||
ui_window_cocoa_t view;
|
ui_window_cocoa_t view;
|
||||||
const ui_window_t *window = NULL;
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
#endif
|
|
||||||
static char buf_fps[128] = {0};
|
|
||||||
static char buf[128] = {0};
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
|
|
||||||
#if defined(HAVE_COCOA)
|
|
||||||
window = ui_companion_driver_get_window_ptr();
|
|
||||||
view.data = (CocoaView*)nsview_get_ptr();
|
view.data = (CocoaView*)nsview_get_ptr();
|
||||||
|
|
||||||
if (window && *buf)
|
if (window && video_info->monitor_fps_enable)
|
||||||
window->set_title(&view, buf);
|
{
|
||||||
#endif
|
char title[128];
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
title[0] = '\0';
|
||||||
|
|
||||||
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
|
|
||||||
|
if (title[0])
|
||||||
|
window->set_title(&view, title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types type,
|
static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types type,
|
||||||
float *value)
|
float *value)
|
||||||
@ -526,18 +525,14 @@ static bool cocoagl_gfx_ctx_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(HAVE_COCOATOUCH)
|
||||||
static bool cocoagl_gfx_ctx_has_windowed(void *data)
|
static bool cocoagl_gfx_ctx_has_windowed(void *data)
|
||||||
{
|
{
|
||||||
(void)data;
|
|
||||||
|
|
||||||
#if defined(HAVE_COCOATOUCH)
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void cocoagl_gfx_ctx_swap_buffers(void *data, video_frame_info_t video_info)
|
static void cocoagl_gfx_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
if (!(--g_fast_forward_skips < 0))
|
if (!(--g_fast_forward_skips < 0))
|
||||||
return;
|
return;
|
||||||
@ -564,10 +559,9 @@ CFStringRef)BOXSTRING(symbol_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void cocoagl_gfx_ctx_check_window(void *data, bool *quit,
|
static void cocoagl_gfx_ctx_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
*quit = false;
|
*quit = false;
|
||||||
|
|
||||||
@ -580,14 +574,6 @@ static void cocoagl_gfx_ctx_check_window(void *data, bool *quit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool cocoagl_gfx_ctx_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void cocoagl_gfx_ctx_input_driver(void *data,
|
static void cocoagl_gfx_ctx_input_driver(void *data,
|
||||||
const char *name,
|
const char *name,
|
||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t **input, void **input_data)
|
||||||
@ -631,12 +617,20 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
cocoagl_gfx_ctx_get_metrics,
|
cocoagl_gfx_ctx_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
cocoagl_gfx_ctx_update_window_title,
|
#if defined(HAVE_COCOA)
|
||||||
|
cocoagl_gfx_ctx_update_title,
|
||||||
|
#else
|
||||||
|
NULL, /* update_title */
|
||||||
|
#endif
|
||||||
cocoagl_gfx_ctx_check_window,
|
cocoagl_gfx_ctx_check_window,
|
||||||
cocoagl_gfx_ctx_set_resize,
|
NULL, /* set_resize */
|
||||||
cocoagl_gfx_ctx_has_focus,
|
cocoagl_gfx_ctx_has_focus,
|
||||||
cocoagl_gfx_ctx_suppress_screensaver,
|
cocoagl_gfx_ctx_suppress_screensaver,
|
||||||
|
#if defined(HAVE_COCOATOUCH)
|
||||||
|
NULL,
|
||||||
|
#else
|
||||||
cocoagl_gfx_ctx_has_windowed,
|
cocoagl_gfx_ctx_has_windowed,
|
||||||
|
#endif
|
||||||
cocoagl_gfx_ctx_swap_buffers,
|
cocoagl_gfx_ctx_swap_buffers,
|
||||||
cocoagl_gfx_ctx_input_driver,
|
cocoagl_gfx_ctx_input_driver,
|
||||||
cocoagl_gfx_ctx_get_proc_address,
|
cocoagl_gfx_ctx_get_proc_address,
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#include "../drivers/d3d.h"
|
#include "../drivers/d3d.h"
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
|
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../ui/ui_companion_driver.h"
|
#include "../../ui/ui_companion_driver.h"
|
||||||
|
|
||||||
@ -76,7 +75,7 @@ static bool gfx_ctx_d3d_set_resize(void *data, unsigned new_width, unsigned new_
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_d3d_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_d3d_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
d3d_video_t *d3d = (d3d_video_t*)data;
|
d3d_video_t *d3d = (d3d_video_t*)data;
|
||||||
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||||
@ -84,25 +83,11 @@ static void gfx_ctx_d3d_swap_buffers(void *data, video_frame_info_t video_info)
|
|||||||
d3d_swap(d3d, d3dr);
|
d3d_swap(d3d, d3dr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
char buffer_fps[128];
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
|
||||||
|
|
||||||
buf[0] = buffer_fps[0] = '\0';
|
|
||||||
|
|
||||||
if (window && video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buffer_fps, sizeof(buffer_fps)))
|
|
||||||
{
|
|
||||||
#ifndef _XBOX
|
|
||||||
window->set_title(&main_window, buf);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
|
if (video_info->fps_show)
|
||||||
|
{
|
||||||
MEMORYSTATUS stat;
|
MEMORYSTATUS stat;
|
||||||
char mem[128];
|
char mem[128];
|
||||||
|
|
||||||
@ -111,10 +96,24 @@ static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t video_info)
|
|||||||
GlobalMemoryStatus(&stat);
|
GlobalMemoryStatus(&stat);
|
||||||
snprintf(mem, sizeof(mem), "|| MEM: %.2f/%.2fMB",
|
snprintf(mem, sizeof(mem), "|| MEM: %.2f/%.2fMB",
|
||||||
stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
|
stat.dwAvailPhys/(1024.0f*1024.0f), stat.dwTotalPhys/(1024.0f*1024.0f));
|
||||||
strlcat(buffer_fps, mem, sizeof(buffer_fps));
|
strlcat(video_info->fps_text, mem, sizeof(video_info->fps_text));
|
||||||
#endif
|
|
||||||
runloop_msg_queue_push(buffer_fps, 1, 1, false);
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
|
if (window && video_info->monitor_fps_enable)
|
||||||
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
|
title[0] = '\0';
|
||||||
|
|
||||||
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
|
|
||||||
|
if (title[0])
|
||||||
|
window->set_title(&main_window, title);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_d3d_show_mouse(void *data, bool state)
|
static void gfx_ctx_d3d_show_mouse(void *data, bool state)
|
||||||
@ -126,7 +125,7 @@ static void gfx_ctx_d3d_show_mouse(void *data, bool state)
|
|||||||
|
|
||||||
static void gfx_ctx_d3d_check_window(void *data, bool *quit,
|
static void gfx_ctx_d3d_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width,
|
bool *resize, unsigned *width,
|
||||||
unsigned *height, unsigned frame_count)
|
unsigned *height)
|
||||||
{
|
{
|
||||||
win32_check_window(quit, resize, width, height);
|
win32_check_window(quit, resize, width, height);
|
||||||
}
|
}
|
||||||
@ -141,16 +140,14 @@ static bool gfx_ctx_d3d_suppress_screensaver(void *data, bool enable)
|
|||||||
return win32_suppress_screensaver(data, enable);
|
return win32_suppress_screensaver(data, enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _XBOX
|
||||||
static bool gfx_ctx_d3d_has_windowed(void *data)
|
static bool gfx_ctx_d3d_has_windowed(void *data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
#ifdef _XBOX
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool gfx_ctx_d3d_bind_api(void *data,
|
static bool gfx_ctx_d3d_bind_api(void *data,
|
||||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||||
@ -197,7 +194,7 @@ static void gfx_ctx_d3d_input_driver(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_d3d_set_video_mode(void *data,
|
static bool gfx_ctx_d3d_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -347,7 +344,11 @@ const gfx_ctx_driver_t gfx_ctx_d3d = {
|
|||||||
gfx_ctx_d3d_set_resize,
|
gfx_ctx_d3d_set_resize,
|
||||||
gfx_ctx_d3d_has_focus,
|
gfx_ctx_d3d_has_focus,
|
||||||
gfx_ctx_d3d_suppress_screensaver,
|
gfx_ctx_d3d_suppress_screensaver,
|
||||||
|
#ifdef _XBOX
|
||||||
|
NULL,
|
||||||
|
#else
|
||||||
gfx_ctx_d3d_has_windowed,
|
gfx_ctx_d3d_has_windowed,
|
||||||
|
#endif
|
||||||
gfx_ctx_d3d_swap_buffers,
|
gfx_ctx_d3d_swap_buffers,
|
||||||
gfx_ctx_d3d_input_driver,
|
gfx_ctx_d3d_input_driver,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -36,7 +36,6 @@
|
|||||||
#include <streams/file_stream.h>
|
#include <streams/file_stream.h>
|
||||||
|
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../common/drm_common.h"
|
#include "../common/drm_common.h"
|
||||||
|
|
||||||
@ -138,10 +137,9 @@ static void gfx_ctx_drm_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_drm_check_window(void *data, bool *quit,
|
static void gfx_ctx_drm_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)frame_count;
|
|
||||||
(void)width;
|
(void)width;
|
||||||
(void)height;
|
(void)height;
|
||||||
|
|
||||||
@ -225,7 +223,7 @@ static bool gfx_ctx_drm_queue_flip(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_drm_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_drm_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
gfx_ctx_drm_data_t *drm = (gfx_ctx_drm_data_t*)data;
|
||||||
|
|
||||||
@ -253,37 +251,13 @@ static void gfx_ctx_drm_swap_buffers(void *data, video_frame_info_t video_info)
|
|||||||
waiting_for_flip = gfx_ctx_drm_queue_flip();
|
waiting_for_flip = gfx_ctx_drm_queue_flip();
|
||||||
|
|
||||||
/* Triple-buffered page flips */
|
/* Triple-buffered page flips */
|
||||||
if (video_info.max_swapchain_images >= 3 &&
|
if (video_info->max_swapchain_images >= 3 &&
|
||||||
gbm_surface_has_free_buffers(g_gbm_surface))
|
gbm_surface_has_free_buffers(g_gbm_surface))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gfx_ctx_drm_wait_flip(true);
|
gfx_ctx_drm_wait_flip(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_drm_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_drm_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push( buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_drm_get_video_size(void *data,
|
static void gfx_ctx_drm_get_video_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
@ -617,7 +591,7 @@ error:
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool gfx_ctx_drm_set_video_mode(void *data,
|
static bool gfx_ctx_drm_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -634,7 +608,7 @@ static bool gfx_ctx_drm_set_video_mode(void *data,
|
|||||||
/* If we use black frame insertion,
|
/* If we use black frame insertion,
|
||||||
* we fake a 60 Hz monitor for 120 Hz one,
|
* we fake a 60 Hz monitor for 120 Hz one,
|
||||||
* etc, so try to match that. */
|
* etc, so try to match that. */
|
||||||
refresh_mod = video_info.black_frame_insertion
|
refresh_mod = video_info->black_frame_insertion
|
||||||
? 0.5f : 1.0f;
|
? 0.5f : 1.0f;
|
||||||
|
|
||||||
/* Find desired video mode, and use that.
|
/* Find desired video mode, and use that.
|
||||||
@ -660,7 +634,7 @@ static bool gfx_ctx_drm_set_video_mode(void *data,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
diff = fabsf(refresh_mod * g_drm_connector->modes[i].vrefresh
|
diff = fabsf(refresh_mod * g_drm_connector->modes[i].vrefresh
|
||||||
- video_info.refresh_rate);
|
- video_info->refresh_rate);
|
||||||
|
|
||||||
if (!g_drm_mode || diff < minimum_fps_diff)
|
if (!g_drm_mode || diff < minimum_fps_diff)
|
||||||
{
|
{
|
||||||
@ -765,12 +739,6 @@ static bool gfx_ctx_drm_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_drm_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_drm_bind_api(void *video_driver,
|
static bool gfx_ctx_drm_bind_api(void *video_driver,
|
||||||
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||||
{
|
{
|
||||||
@ -889,12 +857,12 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_drm_update_window_title,
|
NULL, /* update_window_title */
|
||||||
gfx_ctx_drm_check_window,
|
gfx_ctx_drm_check_window,
|
||||||
gfx_ctx_drm_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_drm_has_focus,
|
gfx_ctx_drm_has_focus,
|
||||||
gfx_ctx_drm_suppress_screensaver,
|
gfx_ctx_drm_suppress_screensaver,
|
||||||
gfx_ctx_drm_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_drm_swap_buffers,
|
gfx_ctx_drm_swap_buffers,
|
||||||
gfx_ctx_drm_input_driver,
|
gfx_ctx_drm_input_driver,
|
||||||
gfx_ctx_drm_get_proc_address,
|
gfx_ctx_drm_get_proc_address,
|
||||||
|
@ -52,7 +52,7 @@ static void gfx_ctx_emscripten_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
int input_width;
|
int input_width;
|
||||||
int input_height;
|
int input_height;
|
||||||
@ -60,7 +60,6 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
|||||||
emscripten_ctx_data_t *emscripten = (emscripten_ctx_data_t*)data;
|
emscripten_ctx_data_t *emscripten = (emscripten_ctx_data_t*)data;
|
||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
emscripten_get_canvas_size(&input_width, &input_height, &is_fullscreen);
|
emscripten_get_canvas_size(&input_width, &input_height, &is_fullscreen);
|
||||||
*width = (unsigned)input_width;
|
*width = (unsigned)input_width;
|
||||||
@ -75,34 +74,12 @@ static void gfx_ctx_emscripten_check_window(void *data, bool *quit,
|
|||||||
*quit = false;
|
*quit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_emscripten_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_emscripten_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
/* no-op in emscripten, no way to force swap/wait for VSync in browsers */
|
/* no-op in emscripten, no way to force swap/wait for VSync in browsers */
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_emscripten_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_emscripten_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_emscripten_get_video_size(void *data,
|
static void gfx_ctx_emscripten_get_video_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
@ -189,7 +166,7 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_emscripten_set_video_mode(void *data,
|
static bool gfx_ctx_emscripten_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -330,9 +307,9 @@ const gfx_ctx_driver_t gfx_ctx_emscripten = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
gfx_ctx_emscripten_translate_aspect,
|
gfx_ctx_emscripten_translate_aspect,
|
||||||
gfx_ctx_emscripten_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_emscripten_check_window,
|
gfx_ctx_emscripten_check_window,
|
||||||
gfx_ctx_emscripten_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_emscripten_has_focus,
|
gfx_ctx_emscripten_has_focus,
|
||||||
gfx_ctx_emscripten_suppress_screensaver,
|
gfx_ctx_emscripten_suppress_screensaver,
|
||||||
gfx_ctx_emscripten_has_windowed,
|
gfx_ctx_emscripten_has_windowed,
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../dynamic.h"
|
#include "../../dynamic.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../../verbosity.h"
|
#include "../../verbosity.h"
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ static void setup_gdi_pixel_format(HDC hdc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_gdi_check_window(void *data, bool *quit,
|
static void gfx_ctx_gdi_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
win32_check_window(quit, resize, width, height);
|
win32_check_window(quit, resize, width, height);
|
||||||
}
|
}
|
||||||
@ -87,19 +86,21 @@ static bool gfx_ctx_gdi_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_gdi_update_window_title(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_gdi_update_window_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
if (window && video_info->monitor_fps_enable)
|
||||||
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
if (window && video_monitor_get_fps(video_info, buf, sizeof(buf),
|
title[0] = '\0';
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
window->set_title(&main_window, buf);
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
if (title[0])
|
||||||
|
window->set_title(&main_window, title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_gdi_get_video_size(void *data,
|
static void gfx_ctx_gdi_get_video_size(void *data,
|
||||||
@ -190,7 +191,7 @@ static void gfx_ctx_gdi_destroy(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_gdi_set_video_mode(void *data,
|
static bool gfx_ctx_gdi_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -287,7 +288,7 @@ static uint32_t gfx_ctx_gdi_get_flags(void *data)
|
|||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_gdi_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_gdi_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
|
@ -25,9 +25,8 @@ static void gfx_ctx_null_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_null_check_window(void *data, bool *quit,
|
static void gfx_ctx_null_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
(void)frame_count;
|
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)quit;
|
(void)quit;
|
||||||
(void)width;
|
(void)width;
|
||||||
@ -35,25 +34,11 @@ static void gfx_ctx_null_check_window(void *data, bool *quit,
|
|||||||
(void)resize;
|
(void)resize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_null_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_null_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_null_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_null_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)video_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height)
|
static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
@ -62,7 +47,7 @@ static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *h
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_null_set_video_mode(void *data,
|
static bool gfx_ctx_null_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -101,12 +86,6 @@ static bool gfx_ctx_null_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_null_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_null_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor)
|
static bool gfx_ctx_null_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
@ -161,12 +140,12 @@ const gfx_ctx_driver_t gfx_ctx_null = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_null_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_null_check_window,
|
gfx_ctx_null_check_window,
|
||||||
gfx_ctx_null_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_null_has_focus,
|
gfx_ctx_null_has_focus,
|
||||||
gfx_ctx_null_suppress_screensaver,
|
gfx_ctx_null_suppress_screensaver,
|
||||||
gfx_ctx_null_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_null_swap_buffers,
|
gfx_ctx_null_swap_buffers,
|
||||||
gfx_ctx_null_input_driver,
|
gfx_ctx_null_input_driver,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -74,10 +74,9 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_khr_display_check_window(void *data, bool *quit,
|
static void gfx_ctx_khr_display_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
*resize = khr->vk.need_new_swapchain;
|
*resize = khr->vk.need_new_swapchain;
|
||||||
|
|
||||||
@ -110,21 +109,8 @@ static bool gfx_ctx_khr_display_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_khr_display_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_khr_display_set_video_mode(void *data,
|
static bool gfx_ctx_khr_display_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -184,12 +170,6 @@ static bool gfx_ctx_khr_display_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_khr_display_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_khr_display_set_swap_interval(void *data, unsigned swap_interval)
|
static void gfx_ctx_khr_display_set_swap_interval(void *data, unsigned swap_interval)
|
||||||
{
|
{
|
||||||
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
||||||
@ -201,7 +181,7 @@ static void gfx_ctx_khr_display_set_swap_interval(void *data, unsigned swap_inte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_khr_display_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_khr_display_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
|
||||||
vulkan_present(&khr->vk, khr->vk.context.current_swapchain_index);
|
vulkan_present(&khr->vk, khr->vk.context.current_swapchain_index);
|
||||||
@ -243,12 +223,12 @@ const gfx_ctx_driver_t gfx_ctx_khr_display = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_khr_display_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_khr_display_check_window,
|
gfx_ctx_khr_display_check_window,
|
||||||
gfx_ctx_khr_display_set_resize,
|
gfx_ctx_khr_display_set_resize,
|
||||||
gfx_ctx_khr_display_has_focus,
|
gfx_ctx_khr_display_has_focus,
|
||||||
gfx_ctx_khr_display_suppress_screensaver,
|
gfx_ctx_khr_display_suppress_screensaver,
|
||||||
gfx_ctx_khr_display_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_khr_display_swap_buffers,
|
gfx_ctx_khr_display_swap_buffers,
|
||||||
gfx_ctx_khr_display_input_driver,
|
gfx_ctx_khr_display_input_driver,
|
||||||
gfx_ctx_khr_display_get_proc_address,
|
gfx_ctx_khr_display_get_proc_address,
|
||||||
|
@ -131,12 +131,10 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
|
static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
|
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
gfx_ctx_mali_fbdev_get_video_size(data, &new_width, &new_height);
|
gfx_ctx_mali_fbdev_get_video_size(data, &new_width, &new_height);
|
||||||
|
|
||||||
if (new_width != *width || new_height != *height)
|
if (new_width != *width || new_height != *height)
|
||||||
@ -149,30 +147,8 @@ static void gfx_ctx_mali_fbdev_check_window(void *data, bool *quit,
|
|||||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_mali_fbdev_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,
|
static bool gfx_ctx_mali_fbdev_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -254,12 +230,6 @@ static bool gfx_ctx_mali_fbdev_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_mali_fbdev_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_set_swap_interval(void *data, unsigned swap_interval)
|
static void gfx_ctx_mali_fbdev_set_swap_interval(void *data, unsigned swap_interval)
|
||||||
{
|
{
|
||||||
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
||||||
@ -269,7 +239,7 @@ static void gfx_ctx_mali_fbdev_set_swap_interval(void *data, unsigned swap_inter
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_mali_fbdev_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -319,12 +289,12 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_mali_fbdev_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_mali_fbdev_check_window,
|
gfx_ctx_mali_fbdev_check_window,
|
||||||
gfx_ctx_mali_fbdev_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_mali_fbdev_has_focus,
|
gfx_ctx_mali_fbdev_has_focus,
|
||||||
gfx_ctx_mali_fbdev_suppress_screensaver,
|
gfx_ctx_mali_fbdev_suppress_screensaver,
|
||||||
gfx_ctx_mali_fbdev_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_mali_fbdev_swap_buffers,
|
gfx_ctx_mali_fbdev_swap_buffers,
|
||||||
gfx_ctx_mali_fbdev_input_driver,
|
gfx_ctx_mali_fbdev_input_driver,
|
||||||
gfx_ctx_mali_fbdev_get_proc_address,
|
gfx_ctx_mali_fbdev_get_proc_address,
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -113,7 +112,7 @@ static void gfx_ctx_opendingux_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_opendingux_check_window(void *data, bool *quit,
|
static void gfx_ctx_opendingux_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
|
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
|
||||||
@ -132,30 +131,8 @@ static void gfx_ctx_opendingux_check_window(void *data, bool *quit,
|
|||||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_opendingux_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_opendingux_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_opendingux_set_video_mode(void *data,
|
static bool gfx_ctx_opendingux_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -226,13 +203,7 @@ static bool gfx_ctx_opendingux_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_opendingux_has_windowed(void *data)
|
static void gfx_ctx_opendingux_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_opendingux_swap_buffers(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
{
|
||||||
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
|
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -292,12 +263,12 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_opendingux_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_opendingux_check_window,
|
gfx_ctx_opendingux_check_window,
|
||||||
gfx_ctx_opendingux_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_opendingux_has_focus,
|
gfx_ctx_opendingux_has_focus,
|
||||||
gfx_ctx_opendingux_suppress_screensaver,
|
gfx_ctx_opendingux_suppress_screensaver,
|
||||||
gfx_ctx_opendingux_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_opendingux_swap_buffers,
|
gfx_ctx_opendingux_swap_buffers,
|
||||||
gfx_ctx_opendingux_input_driver,
|
gfx_ctx_opendingux_input_driver,
|
||||||
gfx_ctx_opendingux_get_proc_address,
|
gfx_ctx_opendingux_get_proc_address,
|
||||||
|
@ -56,7 +56,6 @@ typedef struct gfx_osmesa_ctx_data
|
|||||||
int height;
|
int height;
|
||||||
int pixsize;
|
int pixsize;
|
||||||
|
|
||||||
int frame_count;
|
|
||||||
OSMesaContext ctx;
|
OSMesaContext ctx;
|
||||||
int socket;
|
int socket;
|
||||||
int client;
|
int client;
|
||||||
@ -240,7 +239,7 @@ static void osmesa_ctx_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool osmesa_ctx_set_video_mode(void *data,
|
static bool osmesa_ctx_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -308,24 +307,9 @@ static void osmesa_ctx_get_video_size(void *data,
|
|||||||
*height = osmesa->height;
|
*height = osmesa->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void osmesa_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
static void osmesa_ctx_check_window(void *data, bool *quit,
|
||||||
{
|
bool *resize,unsigned *width,
|
||||||
static char buf[128] = {0};
|
unsigned *height)
|
||||||
static char buf_fps[128] = {0};
|
|
||||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
|
||||||
|
|
||||||
if (!osmesa)
|
|
||||||
return;
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf,
|
|
||||||
sizeof(buf), buf_fps, sizeof(buf_fps));
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void osmesa_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width,
|
|
||||||
unsigned *height, unsigned frame_count)
|
|
||||||
{
|
{
|
||||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
||||||
|
|
||||||
@ -333,15 +317,6 @@ static void osmesa_ctx_check_window(void *data, bool *quit, bool *resize,unsigne
|
|||||||
*height = osmesa->height;
|
*height = osmesa->height;
|
||||||
*resize = false;
|
*resize = false;
|
||||||
*quit = false;
|
*quit = false;
|
||||||
osmesa->frame_count = frame_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool osmesa_ctx_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool osmesa_ctx_has_focus(void *data)
|
static bool osmesa_ctx_has_focus(void *data)
|
||||||
@ -363,7 +338,7 @@ static bool osmesa_ctx_has_windowed(void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void osmesa_ctx_swap_buffers(void *data, video_frame_info_t video_info)
|
static void osmesa_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
||||||
osmesa_fifo_accept(osmesa);
|
osmesa_fifo_accept(osmesa);
|
||||||
@ -419,9 +394,9 @@ const gfx_ctx_driver_t gfx_ctx_osmesa =
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL, /* translate_aspect */
|
NULL, /* translate_aspect */
|
||||||
osmesa_ctx_update_window_title,
|
NULL, /* update_title */
|
||||||
osmesa_ctx_check_window,
|
osmesa_ctx_check_window,
|
||||||
osmesa_ctx_set_resize,
|
NULL, /* set_resize */
|
||||||
osmesa_ctx_has_focus,
|
osmesa_ctx_has_focus,
|
||||||
osmesa_ctx_suppress_screensaver,
|
osmesa_ctx_suppress_screensaver,
|
||||||
osmesa_ctx_has_windowed,
|
osmesa_ctx_has_windowed,
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../../defines/ps3_defines.h"
|
#include "../../defines/ps3_defines.h"
|
||||||
#include "../common/gl_common.h"
|
#include "../common/gl_common.h"
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
@ -149,7 +148,7 @@ static void gfx_ctx_ps3_set_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_ps3_check_window(void *data, bool *quit,
|
static void gfx_ctx_ps3_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
gl_t *gl = data;
|
gl_t *gl = data;
|
||||||
|
|
||||||
@ -173,13 +172,7 @@ static bool gfx_ctx_ps3_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_ps3_has_windowed(void *data)
|
static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
#ifdef HAVE_LIBDBGFONT
|
#ifdef HAVE_LIBDBGFONT
|
||||||
@ -193,27 +186,6 @@ static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t video_info)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_ps3_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_ps3_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
(void)data;
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_ps3_get_video_size(void *data,
|
static void gfx_ctx_ps3_get_video_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
@ -302,15 +274,10 @@ static void *gfx_ctx_ps3_init(video_frame_info_t video_info, void *video_driver)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_ps3_set_video_mode(void *data,
|
static bool gfx_ctx_ps3_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
|
||||||
|
|
||||||
if (!global)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,12 +405,12 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
|
|||||||
gfx_ctx_ps3_get_video_output_next,
|
gfx_ctx_ps3_get_video_output_next,
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_ps3_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_ps3_check_window,
|
gfx_ctx_ps3_check_window,
|
||||||
gfx_ctx_ps3_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_ps3_has_focus,
|
gfx_ctx_ps3_has_focus,
|
||||||
gfx_ctx_ps3_suppress_screensaver,
|
gfx_ctx_ps3_suppress_screensaver,
|
||||||
gfx_ctx_ps3_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_ps3_swap_buffers,
|
gfx_ctx_ps3_swap_buffers,
|
||||||
gfx_ctx_ps3_input_driver,
|
gfx_ctx_ps3_input_driver,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -284,14 +284,11 @@ static void gfx_ctx_qnx_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;
|
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;
|
||||||
|
|
||||||
(void)data;
|
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
*quit = false;
|
*quit = false;
|
||||||
|
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
@ -310,30 +307,8 @@ static void gfx_ctx_qnx_check_window(void *data, bool *quit,
|
|||||||
*quit = true;
|
*quit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_qnx_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_set_video_mode(void *data,
|
static bool gfx_ctx_qnx_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -375,12 +350,6 @@ static bool gfx_ctx_qnx_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_qnx_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dpi_get_density(qnx_ctx_data_t *qnx)
|
static int dpi_get_density(qnx_ctx_data_t *qnx)
|
||||||
{
|
{
|
||||||
int screen_dpi[2];
|
int screen_dpi[2];
|
||||||
@ -444,7 +413,7 @@ static void gfx_ctx_qnx_set_swap_interval(void *data, unsigned swap_interval)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_qnx_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_qnx_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;
|
qnx_ctx_data_t *qnx = (qnx_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -493,12 +462,12 @@ const gfx_ctx_driver_t gfx_ctx_qnx = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
gfx_ctx_qnx__get_metrics,
|
gfx_ctx_qnx__get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_qnx_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_qnx_check_window,
|
gfx_ctx_qnx_check_window,
|
||||||
gfx_ctx_qnx_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_qnx_has_focus,
|
gfx_ctx_qnx_has_focus,
|
||||||
gfx_ctx_qnx_suppress_screensaver,
|
gfx_ctx_qnx_suppress_screensaver,
|
||||||
gfx_ctx_qnx_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_qnx_swap_buffers,
|
gfx_ctx_qnx_swap_buffers,
|
||||||
gfx_ctx_qnx_input_driver,
|
gfx_ctx_qnx_input_driver,
|
||||||
gfx_ctx_qnx_get_proc_address,
|
gfx_ctx_qnx_get_proc_address,
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../common/gl_common.h"
|
#include "../common/gl_common.h"
|
||||||
|
|
||||||
static enum gfx_ctx_api sdl_api = GFX_CTX_OPENGL_API;
|
static enum gfx_ctx_api sdl_api = GFX_CTX_OPENGL_API;
|
||||||
@ -42,7 +41,6 @@ typedef struct gfx_ctx_sdl_data
|
|||||||
bool g_full;
|
bool g_full;
|
||||||
bool g_resized;
|
bool g_resized;
|
||||||
|
|
||||||
int g_frame_count;
|
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
SDL_Window *g_win;
|
SDL_Window *g_win;
|
||||||
SDL_GLContext g_ctx;
|
SDL_GLContext g_ctx;
|
||||||
@ -163,7 +161,7 @@ static void sdl_ctx_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool sdl_ctx_set_video_mode(void *data,
|
static bool sdl_ctx_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -177,7 +175,7 @@ static bool sdl_ctx_set_video_mode(void *data,
|
|||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
{
|
{
|
||||||
if (video_info.windowed_fullscreen)
|
if (video_info->windowed_fullscreen)
|
||||||
fsflag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
fsflag = SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
else
|
else
|
||||||
fsflag = SDL_WINDOW_FULLSCREEN;
|
fsflag = SDL_WINDOW_FULLSCREEN;
|
||||||
@ -192,7 +190,7 @@ static bool sdl_ctx_set_video_mode(void *data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned display = video_info.monitor_index;
|
unsigned display = video_info->monitor_index;
|
||||||
|
|
||||||
sdl->g_win = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED_DISPLAY(display),
|
sdl->g_win = SDL_CreateWindow("", SDL_WINDOWPOS_UNDEFINED_DISPLAY(display),
|
||||||
SDL_WINDOWPOS_UNDEFINED_DISPLAY(display),
|
SDL_WINDOWPOS_UNDEFINED_DISPLAY(display),
|
||||||
@ -268,31 +266,30 @@ static void sdl_ctx_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
static void sdl_ctx_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char title[128];
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
title[0] = '\0';
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf),
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
|
if (video_info->monitor_fps_enable)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||||
if (sdl)
|
|
||||||
SDL_SetWindowTitle(sdl->g_win, buf);
|
if (sdl && title[0])
|
||||||
|
SDL_SetWindowTitle(sdl->g_win, title);
|
||||||
#else
|
#else
|
||||||
SDL_WM_SetCaption(buf, NULL);
|
if (title[0])
|
||||||
|
SDL_WM_SetCaption(title, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width,
|
static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width,
|
||||||
unsigned *height, unsigned frame_count)
|
unsigned *height)
|
||||||
{
|
{
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||||
@ -340,16 +337,6 @@ static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *
|
|||||||
*resize = true;
|
*resize = true;
|
||||||
sdl->g_resized = false;
|
sdl->g_resized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sdl->g_frame_count = frame_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool sdl_ctx_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool sdl_ctx_has_focus(void *data)
|
static bool sdl_ctx_has_focus(void *data)
|
||||||
@ -379,7 +366,7 @@ static bool sdl_ctx_has_windowed(void *data)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_swap_buffers(void *data, video_frame_info_t video_info)
|
static void sdl_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||||
@ -435,9 +422,9 @@ const gfx_ctx_driver_t gfx_ctx_sdl_gl =
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL, /* translate_aspect */
|
NULL, /* translate_aspect */
|
||||||
sdl_ctx_update_window_title,
|
sdl_ctx_update_title,
|
||||||
sdl_ctx_check_window,
|
sdl_ctx_check_window,
|
||||||
sdl_ctx_set_resize,
|
NULL, /* set_resize */
|
||||||
sdl_ctx_has_focus,
|
sdl_ctx_has_focus,
|
||||||
sdl_ctx_suppress_screensaver,
|
sdl_ctx_suppress_screensaver,
|
||||||
sdl_ctx_has_windowed,
|
sdl_ctx_has_windowed,
|
||||||
|
@ -86,10 +86,9 @@ static INLINE bool gfx_ctx_vc_egl_query_extension(vc_ctx_data_t *vc, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)frame_count;
|
|
||||||
(void)width;
|
(void)width;
|
||||||
(void)height;
|
(void)height;
|
||||||
|
|
||||||
@ -97,27 +96,6 @@ static void gfx_ctx_vc_check_window(void *data, bool *quit,
|
|||||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vc_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vc_get_video_size(void *data,
|
static void gfx_ctx_vc_get_video_size(void *data,
|
||||||
unsigned *width, unsigned *height)
|
unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
@ -319,7 +297,7 @@ static void gfx_ctx_vc_set_swap_interval(void *data, unsigned swap_interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_vc_set_video_mode(void *data,
|
static bool gfx_ctx_vc_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -471,12 +449,6 @@ static bool gfx_ctx_vc_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_vc_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static float gfx_ctx_vc_translate_aspect(void *data,
|
static float gfx_ctx_vc_translate_aspect(void *data,
|
||||||
unsigned width, unsigned height)
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
@ -608,7 +580,7 @@ error:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vc_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_vc_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
vc_ctx_data_t *vc = (vc_ctx_data_t*)data;
|
vc_ctx_data_t *vc = (vc_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -659,12 +631,12 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
gfx_ctx_vc_translate_aspect,
|
gfx_ctx_vc_translate_aspect,
|
||||||
gfx_ctx_vc_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_vc_check_window,
|
gfx_ctx_vc_check_window,
|
||||||
gfx_ctx_vc_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_vc_has_focus,
|
gfx_ctx_vc_has_focus,
|
||||||
gfx_ctx_vc_suppress_screensaver,
|
gfx_ctx_vc_suppress_screensaver,
|
||||||
gfx_ctx_vc_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_vc_swap_buffers,
|
gfx_ctx_vc_swap_buffers,
|
||||||
gfx_ctx_vc_input_driver,
|
gfx_ctx_vc_input_driver,
|
||||||
gfx_ctx_vc_get_proc_address,
|
gfx_ctx_vc_get_proc_address,
|
||||||
|
@ -29,7 +29,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -117,7 +116,7 @@ static void gfx_ctx_vivante_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vivante_check_window(void *data, bool *quit,
|
static void gfx_ctx_vivante_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
@ -136,30 +135,8 @@ static void gfx_ctx_vivante_check_window(void *data, bool *quit,
|
|||||||
*quit = (bool)frontend_driver_get_signal_handler_state();
|
*quit = (bool)frontend_driver_get_signal_handler_state();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_vivante_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vivante_update_window_title(void *data, video_frame_info_t video_info)
|
|
||||||
{
|
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
|
||||||
|
|
||||||
video_monitor_get_fps(video_info, buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps));
|
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_vivante_set_video_mode(void *data,
|
static bool gfx_ctx_vivante_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -231,12 +208,6 @@ static bool gfx_ctx_vivante_suppress_screensaver(void *data, bool enable)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_vivante_has_windowed(void *data)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval)
|
static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval)
|
||||||
{
|
{
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
@ -246,7 +217,7 @@ static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vivante_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_vivante_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -297,12 +268,12 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
NULL, /* get_metrics */
|
NULL, /* get_metrics */
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_vivante_update_window_title,
|
NULL, /* update_title */
|
||||||
gfx_ctx_vivante_check_window,
|
gfx_ctx_vivante_check_window,
|
||||||
gfx_ctx_vivante_set_resize,
|
NULL, /* set_resize */
|
||||||
gfx_ctx_vivante_has_focus,
|
gfx_ctx_vivante_has_focus,
|
||||||
gfx_ctx_vivante_suppress_screensaver,
|
gfx_ctx_vivante_suppress_screensaver,
|
||||||
gfx_ctx_vivante_has_windowed,
|
NULL, /* has_windowed */
|
||||||
gfx_ctx_vivante_swap_buffers,
|
gfx_ctx_vivante_swap_buffers,
|
||||||
gfx_ctx_vivante_input_driver,
|
gfx_ctx_vivante_input_driver,
|
||||||
gfx_ctx_vivante_get_proc_address,
|
gfx_ctx_vivante_get_proc_address,
|
||||||
|
@ -643,14 +643,11 @@ static void flush_wayland_fd(gfx_ctx_wayland_data_t *wl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
static void gfx_ctx_wl_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height,
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
unsigned frame_count)
|
|
||||||
{
|
{
|
||||||
unsigned new_width, new_height;
|
unsigned new_width, new_height;
|
||||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||||
|
|
||||||
(void)frame_count;
|
|
||||||
|
|
||||||
flush_wayland_fd(wl);
|
flush_wayland_fd(wl);
|
||||||
|
|
||||||
new_width = *width;
|
new_width = *width;
|
||||||
@ -719,20 +716,17 @@ static bool gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wl_update_window_title(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_wl_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||||
|
char title[128];
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
title[0] = '\0';
|
||||||
|
|
||||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf),
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
wl_shell_surface_set_title(wl->shell_surf, buf);
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
if (wl && title[0] && video_info->monitor_fps_enable)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
wl_shell_surface_set_title(wl->shell_surf, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1075,7 +1069,7 @@ static void gfx_ctx_wl_set_swap_interval(void *data, unsigned swap_interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_wl_set_video_mode(void *data,
|
static bool gfx_ctx_wl_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -1557,7 +1551,7 @@ static void *gfx_ctx_wl_get_context_data(void *data)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void gfx_ctx_wl_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_wl_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||||
|
|
||||||
@ -1676,7 +1670,7 @@ const gfx_ctx_driver_t gfx_ctx_wayland = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
gfx_ctx_wl_get_metrics,
|
gfx_ctx_wl_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_wl_update_window_title,
|
gfx_ctx_wl_update_title,
|
||||||
gfx_ctx_wl_check_window,
|
gfx_ctx_wl_check_window,
|
||||||
gfx_ctx_wl_set_resize,
|
gfx_ctx_wl_set_resize,
|
||||||
gfx_ctx_wl_has_focus,
|
gfx_ctx_wl_has_focus,
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../dynamic.h"
|
#include "../../dynamic.h"
|
||||||
#include "../../runloop.h"
|
|
||||||
#include "../video_context_driver.h"
|
#include "../video_context_driver.h"
|
||||||
|
|
||||||
#include "../common/win32_common.h"
|
#include "../common/win32_common.h"
|
||||||
@ -312,7 +311,7 @@ static void gfx_ctx_wgl_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wgl_check_window(void *data, bool *quit,
|
static void gfx_ctx_wgl_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
win32_check_window(quit, resize, width, height);
|
win32_check_window(quit, resize, width, height);
|
||||||
|
|
||||||
@ -331,7 +330,7 @@ static void gfx_ctx_wgl_check_window(void *data, bool *quit,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wgl_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_wgl_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
@ -386,19 +385,21 @@ static bool gfx_ctx_wgl_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wgl_update_window_title(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_wgl_update_title(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
|
||||||
char buf_fps[128];
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
if (window && video_info->monitor_fps_enable)
|
||||||
|
{
|
||||||
|
char title[128];
|
||||||
|
|
||||||
if (window && video_monitor_get_fps(video_info, buf, sizeof(buf),
|
title[0] = '\0';
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
window->set_title(&main_window, buf);
|
video_driver_get_window_title(title, sizeof(title));
|
||||||
if (video_info.fps_show)
|
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
if (title[0])
|
||||||
|
window->set_title(&main_window, title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wgl_get_video_size(void *data,
|
static void gfx_ctx_wgl_get_video_size(void *data,
|
||||||
@ -525,7 +526,7 @@ static void gfx_ctx_wgl_destroy(void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_wgl_set_video_mode(void *data,
|
static bool gfx_ctx_wgl_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -687,7 +688,7 @@ const gfx_ctx_driver_t gfx_ctx_wgl = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
gfx_ctx_wgl_get_metrics,
|
gfx_ctx_wgl_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_wgl_update_window_title,
|
gfx_ctx_wgl_update_title,
|
||||||
gfx_ctx_wgl_check_window,
|
gfx_ctx_wgl_check_window,
|
||||||
gfx_ctx_wgl_set_resize,
|
gfx_ctx_wgl_set_resize,
|
||||||
gfx_ctx_wgl_has_focus,
|
gfx_ctx_wgl_has_focus,
|
||||||
|
@ -302,7 +302,7 @@ static void gfx_ctx_x_swap_interval(void *data, unsigned interval)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_x_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_x_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
gfx_ctx_x_data_t *x = (gfx_ctx_x_data_t*)data;
|
gfx_ctx_x_data_t *x = (gfx_ctx_x_data_t*)data;
|
||||||
|
|
||||||
@ -347,9 +347,9 @@ static void gfx_ctx_x_swap_buffers(void *data, video_frame_info_t video_info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_x_check_window(void *data, bool *quit,
|
static void gfx_ctx_x_check_window(void *data, bool *quit,
|
||||||
bool *resize, unsigned *width, unsigned *height, unsigned frame_count)
|
bool *resize, unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
x11_check_window(data, quit, resize, width, height, frame_count);
|
x11_check_window(data, quit, resize, width, height);
|
||||||
|
|
||||||
switch (x_api)
|
switch (x_api)
|
||||||
{
|
{
|
||||||
@ -545,7 +545,7 @@ error:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool gfx_ctx_x_set_video_mode(void *data,
|
static bool gfx_ctx_x_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -565,7 +565,7 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
if (!x)
|
if (!x)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
windowed_full = video_info.windowed_fullscreen;
|
windowed_full = video_info->windowed_fullscreen;
|
||||||
true_full = false;
|
true_full = false;
|
||||||
|
|
||||||
switch (x_api)
|
switch (x_api)
|
||||||
@ -613,8 +613,8 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
RARCH_ERR("[GLX]: Entering true fullscreen failed. Will attempt windowed mode.\n");
|
RARCH_ERR("[GLX]: Entering true fullscreen failed. Will attempt windowed mode.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.monitor_index)
|
if (video_info->monitor_index)
|
||||||
g_x11_screen = video_info.monitor_index - 1;
|
g_x11_screen = video_info->monitor_index - 1;
|
||||||
|
|
||||||
#ifdef HAVE_XINERAMA
|
#ifdef HAVE_XINERAMA
|
||||||
if (fullscreen || g_x11_screen != 0)
|
if (fullscreen || g_x11_screen != 0)
|
||||||
@ -660,9 +660,8 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
||||||
x11_update_window_title(NULL, video_info);
|
x11_update_title(NULL, video_info);
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
||||||
@ -789,7 +788,7 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
{
|
{
|
||||||
bool quit, resize;
|
bool quit, resize;
|
||||||
unsigned width = 0, height = 0;
|
unsigned width = 0, height = 0;
|
||||||
x11_check_window(x, &quit, &resize, &width, &height, 0);
|
x11_check_window(x, &quit, &resize, &width, &height);
|
||||||
|
|
||||||
/* Use XCB surface since it's the most supported WSI.
|
/* Use XCB surface since it's the most supported WSI.
|
||||||
* We can obtain the XCB connection directly from X11. */
|
* We can obtain the XCB connection directly from X11. */
|
||||||
@ -1081,7 +1080,7 @@ const gfx_ctx_driver_t gfx_ctx_x = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
x11_get_metrics,
|
x11_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
x11_update_window_title,
|
x11_update_title,
|
||||||
gfx_ctx_x_check_window,
|
gfx_ctx_x_check_window,
|
||||||
gfx_ctx_x_set_resize,
|
gfx_ctx_x_set_resize,
|
||||||
x11_has_focus,
|
x11_has_focus,
|
||||||
|
@ -91,15 +91,6 @@ EGL_BLUE_SIZE, 1, \
|
|||||||
EGL_ALPHA_SIZE, 0, \
|
EGL_ALPHA_SIZE, 0, \
|
||||||
EGL_DEPTH_SIZE, 0
|
EGL_DEPTH_SIZE, 0
|
||||||
|
|
||||||
static bool gfx_ctx_xegl_set_resize(void *data,
|
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
|
||||||
(void)data;
|
|
||||||
(void)width;
|
|
||||||
(void)height;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void *gfx_ctx_xegl_init(video_frame_info_t video_info, void *video_driver)
|
static void *gfx_ctx_xegl_init(video_frame_info_t video_info, void *video_driver)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EGL
|
#ifdef HAVE_EGL
|
||||||
@ -257,7 +248,7 @@ static EGLint *xegl_fill_attribs(xegl_ctx_data_t *xegl, EGLint *attr)
|
|||||||
static void gfx_ctx_xegl_set_swap_interval(void *data, unsigned swap_interval);
|
static void gfx_ctx_xegl_set_swap_interval(void *data, unsigned swap_interval);
|
||||||
|
|
||||||
static bool gfx_ctx_xegl_set_video_mode(void *data,
|
static bool gfx_ctx_xegl_set_video_mode(void *data,
|
||||||
video_frame_info_t video_info,
|
video_frame_info_t *video_info,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
@ -298,7 +289,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
|||||||
ButtonPressMask | ButtonReleaseMask | KeyReleaseMask;
|
ButtonPressMask | ButtonReleaseMask | KeyReleaseMask;
|
||||||
swa.override_redirect = fullscreen ? True : False;
|
swa.override_redirect = fullscreen ? True : False;
|
||||||
|
|
||||||
if (fullscreen && !video_info.windowed_fullscreen)
|
if (fullscreen && !video_info->windowed_fullscreen)
|
||||||
{
|
{
|
||||||
if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height, &xegl->desktop_mode))
|
if (x11_enter_fullscreen(video_info, g_x11_dpy, width, height, &xegl->desktop_mode))
|
||||||
{
|
{
|
||||||
@ -309,8 +300,8 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
|||||||
RARCH_ERR("[X/EGL]: Entering true fullscreen failed. Will attempt windowed mode.\n");
|
RARCH_ERR("[X/EGL]: Entering true fullscreen failed. Will attempt windowed mode.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video_info.monitor_index)
|
if (video_info->monitor_index)
|
||||||
g_x11_screen = video_info.monitor_index - 1;
|
g_x11_screen = video_info->monitor_index - 1;
|
||||||
|
|
||||||
#ifdef HAVE_XINERAMA
|
#ifdef HAVE_XINERAMA
|
||||||
if (fullscreen || g_x11_screen != 0)
|
if (fullscreen || g_x11_screen != 0)
|
||||||
@ -352,7 +343,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
||||||
x11_update_window_title(NULL, video_info);
|
x11_update_title(NULL, video_info);
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
||||||
@ -490,7 +481,7 @@ static void gfx_ctx_xegl_show_mouse(void *data, bool state)
|
|||||||
x11_show_mouse(g_x11_dpy, g_x11_win, state);
|
x11_show_mouse(g_x11_dpy, g_x11_win, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_xegl_swap_buffers(void *data, video_frame_info_t video_info)
|
static void gfx_ctx_xegl_swap_buffers(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
xegl_ctx_data_t *xegl = (xegl_ctx_data_t*)data;
|
xegl_ctx_data_t *xegl = (xegl_ctx_data_t*)data;
|
||||||
|
|
||||||
@ -591,9 +582,9 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
x11_get_metrics,
|
x11_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
x11_update_window_title,
|
x11_update_title,
|
||||||
x11_check_window,
|
x11_check_window,
|
||||||
gfx_ctx_xegl_set_resize,
|
NULL, /* set_resize */
|
||||||
x11_has_focus,
|
x11_has_focus,
|
||||||
gfx_ctx_xegl_suppress_screensaver,
|
gfx_ctx_xegl_suppress_screensaver,
|
||||||
gfx_ctx_xegl_has_windowed,
|
gfx_ctx_xegl_has_windowed,
|
||||||
|
@ -33,7 +33,10 @@
|
|||||||
/* FIXME: this is just a workaround to avoid
|
/* FIXME: this is just a workaround to avoid
|
||||||
* using ctrGuCopyImage, since it seems to cause
|
* using ctrGuCopyImage, since it seems to cause
|
||||||
* a freeze/blackscreen when used here. */
|
* a freeze/blackscreen when used here. */
|
||||||
//#define FONT_TEXTURE_IN_VRAM
|
|
||||||
|
#if 0
|
||||||
|
#define FONT_TEXTURE_IN_VRAM
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@ -227,7 +230,8 @@ static void ctr_font_render_line(
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ctrGuSetVertexShaderFloatUniform(0, (float*)&font->scale_vector, 1);
|
ctrGuSetVertexShaderFloatUniform(0, (float*)&font->scale_vector, 1);
|
||||||
GSPGPU_FlushDataCache(ctr->vertex_cache.current, (v - ctr->vertex_cache.current) * sizeof(ctr_vertex_t));
|
GSPGPU_FlushDataCache(ctr->vertex_cache.current,
|
||||||
|
(v - ctr->vertex_cache.current) * sizeof(ctr_vertex_t));
|
||||||
ctrGuSetAttributeBuffers(2,
|
ctrGuSetAttributeBuffers(2,
|
||||||
VIRT_TO_PHYS(ctr->vertex_cache.current),
|
VIRT_TO_PHYS(ctr->vertex_cache.current),
|
||||||
CTRGU_ATTRIBFMT(GPU_SHORT, 4) << 0 |
|
CTRGU_ATTRIBFMT(GPU_SHORT, 4) << 0 |
|
||||||
@ -241,18 +245,25 @@ static void ctr_font_render_line(
|
|||||||
GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_R, GPU_TEVOP_RGB_SRC_ALPHA, 0),
|
GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_R, GPU_TEVOP_RGB_SRC_ALPHA, 0),
|
||||||
GPU_MODULATE, GPU_MODULATE,
|
GPU_MODULATE, GPU_MODULATE,
|
||||||
color);
|
color);
|
||||||
// printf("%s\n", msg);
|
|
||||||
// DEBUG_VAR(color);
|
#if 0
|
||||||
// GPU_SetTexEnv(0, GPU_TEXTURE0, GPU_TEXTURE0, 0, GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_R, 0, 0), GPU_REPLACE, GPU_REPLACE, 0);
|
printf("%s\n", msg);
|
||||||
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(font->texture.data), font->texture.width, font->texture.height,
|
DEBUG_VAR(color);
|
||||||
GPU_TEXTURE_MAG_FILTER(GPU_NEAREST) | GPU_TEXTURE_MIN_FILTER(GPU_NEAREST) |
|
GPU_SetTexEnv(0, GPU_TEXTURE0, GPU_TEXTURE0, 0,
|
||||||
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
|
GPU_TEVOPERANDS(GPU_TEVOP_RGB_SRC_R, 0, 0), GPU_REPLACE, GPU_REPLACE, 0);
|
||||||
GPU_L8);
|
#endif
|
||||||
|
|
||||||
|
ctrGuSetTexture(GPU_TEXUNIT0, VIRT_TO_PHYS(font->texture.data),
|
||||||
|
font->texture.width, font->texture.height,
|
||||||
|
GPU_TEXTURE_MAG_FILTER(GPU_NEAREST) | GPU_TEXTURE_MIN_FILTER(GPU_NEAREST) |
|
||||||
|
GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE),
|
||||||
|
GPU_L8);
|
||||||
|
|
||||||
GPU_SetViewport(NULL,
|
GPU_SetViewport(NULL,
|
||||||
VIRT_TO_PHYS(ctr->drawbuffers.top.left),
|
VIRT_TO_PHYS(ctr->drawbuffers.top.left),
|
||||||
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT,
|
0, 0, CTR_TOP_FRAMEBUFFER_HEIGHT,
|
||||||
ctr->video_mode == CTR_VIDEO_MODE_800x240 ? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
ctr->video_mode == CTR_VIDEO_MODE_800x240
|
||||||
|
? CTR_TOP_FRAMEBUFFER_WIDTH * 2 : CTR_TOP_FRAMEBUFFER_WIDTH);
|
||||||
|
|
||||||
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, v - ctr->vertex_cache.current);
|
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, v - ctr->vertex_cache.current);
|
||||||
|
|
||||||
@ -265,29 +276,32 @@ static void ctr_font_render_line(
|
|||||||
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, v - ctr->vertex_cache.current);
|
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, v - ctr->vertex_cache.current);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
v = font->vertices;
|
||||||
|
v->x0 = 0;
|
||||||
// v = font->vertices;
|
v->y0 = 0;
|
||||||
// v->x0 = 0;
|
v->u0 = 0;
|
||||||
// v->y0 = 0;
|
v->v0 = 0;
|
||||||
// v->u0 = 0;
|
v->x1 = font->texture.width;
|
||||||
// v->v0 = 0;
|
v->y1 = font->texture.height;
|
||||||
// v->x1 = font->texture.width;
|
v->u1 = font->texture.width;
|
||||||
// v->y1 = font->texture.height;
|
v->v1 = font->texture.height;
|
||||||
// v->u1 = font->texture.width;
|
GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, 1);
|
||||||
// v->v1 = font->texture.height;
|
#endif
|
||||||
// GPU_DrawArray(GPU_GEOMETRY_PRIM, 0, 1);
|
|
||||||
|
|
||||||
GPU_SetTexEnv(0, GPU_TEXTURE0, GPU_TEXTURE0, 0, 0, GPU_REPLACE, GPU_REPLACE, 0);
|
GPU_SetTexEnv(0, GPU_TEXTURE0, GPU_TEXTURE0, 0, 0, GPU_REPLACE, GPU_REPLACE, 0);
|
||||||
// DEBUG_VAR(v - font->vertices);
|
|
||||||
// v = font->vertices;
|
|
||||||
// printf("OSDMSG: %s\n", msg);
|
|
||||||
// printf("vertex : (%i,%i,%i,%i) - (%i,%i,%i,%i)\n",
|
|
||||||
// v->x0, v->y0, v->x1, v->y1,
|
|
||||||
// v->u0, v->v0, v->u1, v->v1);
|
|
||||||
|
|
||||||
// printf("%s\n", msg);
|
#if 0
|
||||||
|
DEBUG_VAR(v - font->vertices);
|
||||||
|
v = font->vertices;
|
||||||
|
printf("OSDMSG: %s\n", msg);
|
||||||
|
printf("vertex : (%i,%i,%i,%i) - (%i,%i,%i,%i)\n",
|
||||||
|
v->x0, v->y0, v->x1, v->y1,
|
||||||
|
v->u0, v->v0, v->u1, v->v1);
|
||||||
|
|
||||||
|
printf("%s\n", msg);
|
||||||
|
#endif
|
||||||
|
|
||||||
ctr->vertex_cache.current = v;
|
ctr->vertex_cache.current = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ bool video_context_driver_check_window(gfx_ctx_size_t *size_data)
|
|||||||
size_data->quit,
|
size_data->quit,
|
||||||
size_data->resize,
|
size_data->resize,
|
||||||
size_data->width,
|
size_data->width,
|
||||||
size_data->height, (unsigned int)video_driver_get_frame_count());
|
size_data->height);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,22 +456,12 @@ bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info)
|
|||||||
video_driver_build_info(&video_info);
|
video_driver_build_info(&video_info);
|
||||||
|
|
||||||
if (!current_video_context->set_video_mode(
|
if (!current_video_context->set_video_mode(
|
||||||
video_context_data, video_info, mode_info->width,
|
video_context_data, &video_info, mode_info->width,
|
||||||
mode_info->height, mode_info->fullscreen))
|
mode_info->height, mode_info->fullscreen))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool video_context_driver_set_resize(gfx_ctx_mode_t *mode_info)
|
|
||||||
{
|
|
||||||
if (!current_video_context)
|
|
||||||
return false;
|
|
||||||
if (!current_video_context->set_resize(
|
|
||||||
video_context_data, mode_info->width, mode_info->height))
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info)
|
bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info)
|
||||||
{
|
{
|
||||||
if (!current_video_context || !current_video_context->get_video_size)
|
if (!current_video_context || !current_video_context->get_video_size)
|
||||||
|
@ -78,7 +78,7 @@ typedef struct gfx_ctx_driver
|
|||||||
void (*swap_interval)(void *data, unsigned);
|
void (*swap_interval)(void *data, unsigned);
|
||||||
|
|
||||||
/* Sets video mode. Creates a window, etc. */
|
/* Sets video mode. Creates a window, etc. */
|
||||||
bool (*set_video_mode)(void*, video_frame_info_t video_info, unsigned, unsigned, bool);
|
bool (*set_video_mode)(void*, video_frame_info_t *video_info, unsigned, unsigned, bool);
|
||||||
|
|
||||||
/* Gets current window size.
|
/* Gets current window size.
|
||||||
* If not initialized yet, it returns current screen size. */
|
* If not initialized yet, it returns current screen size. */
|
||||||
@ -101,12 +101,12 @@ typedef struct gfx_ctx_driver
|
|||||||
float (*translate_aspect)(void*, unsigned, unsigned);
|
float (*translate_aspect)(void*, unsigned, unsigned);
|
||||||
|
|
||||||
/* Asks driver to update window title (FPS, etc). */
|
/* Asks driver to update window title (FPS, etc). */
|
||||||
void (*update_window_title)(void*, video_frame_info_t video_info);
|
void (*update_window_title)(void*, video_frame_info_t *video_info);
|
||||||
|
|
||||||
/* Queries for resize and quit events.
|
/* Queries for resize and quit events.
|
||||||
* Also processes events. */
|
* Also processes events. */
|
||||||
void (*check_window)(void*, bool*, bool*,
|
void (*check_window)(void*, bool*, bool*,
|
||||||
unsigned*, unsigned*, unsigned);
|
unsigned*, unsigned*);
|
||||||
|
|
||||||
/* Acknowledge a resize event. This is needed for some APIs.
|
/* Acknowledge a resize event. This is needed for some APIs.
|
||||||
* Most backends will ignore this. */
|
* Most backends will ignore this. */
|
||||||
@ -123,7 +123,7 @@ typedef struct gfx_ctx_driver
|
|||||||
|
|
||||||
/* Swaps buffers. VBlank sync depends on
|
/* Swaps buffers. VBlank sync depends on
|
||||||
* earlier calls to swap_interval. */
|
* earlier calls to swap_interval. */
|
||||||
void (*swap_buffers)(void*, video_frame_info_t video_info);
|
void (*swap_buffers)(void*, video_frame_info_t *video_info);
|
||||||
|
|
||||||
/* Most video backends will want to use a certain input driver.
|
/* Most video backends will want to use a certain input driver.
|
||||||
* Checks for it here. */
|
* Checks for it here. */
|
||||||
@ -302,6 +302,10 @@ void video_context_driver_destroy(void);
|
|||||||
|
|
||||||
#define video_context_driver_focus() ((video_context_data && current_video_context->has_focus && current_video_context->has_focus(video_context_data)) ? true : false)
|
#define video_context_driver_focus() ((video_context_data && current_video_context->has_focus && current_video_context->has_focus(video_context_data)) ? true : false)
|
||||||
|
|
||||||
|
#define video_context_driver_set_resize(mode_info) \
|
||||||
|
if (current_video_context && current_video_context->set_resize) \
|
||||||
|
current_video_context->set_resize(video_context_data, mode_info.width, mode_info.height)
|
||||||
|
|
||||||
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data);
|
bool video_context_driver_get_video_output_size(gfx_ctx_size_t *size_data);
|
||||||
|
|
||||||
bool video_context_driver_swap_interval(unsigned *interval);
|
bool video_context_driver_swap_interval(unsigned *interval);
|
||||||
@ -314,8 +318,6 @@ bool video_context_driver_get_ident(gfx_ctx_ident_t *ident);
|
|||||||
|
|
||||||
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info);
|
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info);
|
||||||
|
|
||||||
bool video_context_driver_set_resize(gfx_ctx_mode_t *mode_info);
|
|
||||||
|
|
||||||
bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info);
|
bool video_context_driver_get_video_size(gfx_ctx_mode_t *mode_info);
|
||||||
|
|
||||||
bool video_context_driver_get_context_data(void *data);
|
bool video_context_driver_get_context_data(void *data);
|
||||||
@ -334,7 +336,7 @@ bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect);
|
|||||||
|
|
||||||
bool video_context_driver_input_driver(gfx_ctx_input_t *inp);
|
bool video_context_driver_input_driver(gfx_ctx_input_t *inp);
|
||||||
|
|
||||||
#define video_context_driver_has_windowed() ((video_context_data && current_video_context->has_windowed(video_context_data)) ? true : false)
|
#define video_context_driver_has_windowed() ((video_context_data && current_video_context->has_windowed && current_video_context->has_windowed(video_context_data)) ? true : false)
|
||||||
|
|
||||||
void video_context_driver_free(void);
|
void video_context_driver_free(void);
|
||||||
|
|
||||||
|
@ -137,6 +137,8 @@ static unsigned video_driver_height = 0;
|
|||||||
|
|
||||||
static enum rarch_display_type video_driver_display_type = RARCH_DISPLAY_NONE;
|
static enum rarch_display_type video_driver_display_type = RARCH_DISPLAY_NONE;
|
||||||
static char video_driver_title_buf[64] = {0};
|
static char video_driver_title_buf[64] = {0};
|
||||||
|
static char video_driver_window_title[128] = {0};
|
||||||
|
static bool video_driver_window_title_update = true;
|
||||||
|
|
||||||
static retro_time_t video_driver_frame_time_samples[MEASURE_FRAME_TIME_SAMPLES_COUNT];
|
static retro_time_t video_driver_frame_time_samples[MEASURE_FRAME_TIME_SAMPLES_COUNT];
|
||||||
static uint64_t video_driver_frame_time_count = 0;
|
static uint64_t video_driver_frame_time_count = 0;
|
||||||
@ -971,18 +973,22 @@ void video_driver_cached_frame_get(const void **data, unsigned *width,
|
|||||||
|
|
||||||
void video_driver_get_size(unsigned *width, unsigned *height)
|
void video_driver_get_size(unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
|
video_driver_threaded_lock();
|
||||||
if (width)
|
if (width)
|
||||||
*width = video_driver_width;
|
*width = video_driver_width;
|
||||||
if (height)
|
if (height)
|
||||||
*height = video_driver_height;
|
*height = video_driver_height;
|
||||||
|
video_driver_threaded_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_set_size(unsigned *width, unsigned *height)
|
void video_driver_set_size(unsigned *width, unsigned *height)
|
||||||
{
|
{
|
||||||
|
video_driver_threaded_lock();
|
||||||
if (width)
|
if (width)
|
||||||
video_driver_width = *width;
|
video_driver_width = *width;
|
||||||
if (height)
|
if (height)
|
||||||
video_driver_height = *height;
|
video_driver_height = *height;
|
||||||
|
video_driver_threaded_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1057,89 +1063,6 @@ bool video_monitor_fps_statistics(double *refresh_rate,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* video_monitor_get_fps:
|
|
||||||
* @buf : string suitable for Window title
|
|
||||||
* @size : size of buffer.
|
|
||||||
* @buf_fps : string of raw FPS only (optional).
|
|
||||||
* @size_fps : size of raw FPS buffer.
|
|
||||||
*
|
|
||||||
* Get the amount of frames per seconds.
|
|
||||||
*
|
|
||||||
* Returns: true if framerate per seconds could be obtained,
|
|
||||||
* otherwise false.
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
bool video_monitor_get_fps(
|
|
||||||
video_frame_info_t video_info,
|
|
||||||
char *buf, size_t size,
|
|
||||||
char *buf_fps, size_t size_fps)
|
|
||||||
{
|
|
||||||
static retro_time_t curr_time;
|
|
||||||
static retro_time_t fps_time;
|
|
||||||
retro_time_t new_time = cpu_features_get_time_usec();
|
|
||||||
uint64_t frame_count = 0;
|
|
||||||
|
|
||||||
video_driver_threaded_lock();
|
|
||||||
frame_count = video_driver_frame_count;
|
|
||||||
video_driver_threaded_unlock();
|
|
||||||
|
|
||||||
*buf = '\0';
|
|
||||||
|
|
||||||
if (frame_count)
|
|
||||||
{
|
|
||||||
static float last_fps;
|
|
||||||
bool ret = false;
|
|
||||||
unsigned write_index = video_driver_frame_time_count++ &
|
|
||||||
(MEASURE_FRAME_TIME_SAMPLES_COUNT - 1);
|
|
||||||
|
|
||||||
video_driver_frame_time_samples[write_index] = new_time - fps_time;
|
|
||||||
fps_time = new_time;
|
|
||||||
|
|
||||||
if ((frame_count % FPS_UPDATE_INTERVAL) == 0)
|
|
||||||
{
|
|
||||||
char frames_text[64];
|
|
||||||
|
|
||||||
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
|
||||||
curr_time = new_time;
|
|
||||||
|
|
||||||
fill_pathname_noext(buf,
|
|
||||||
video_driver_title_buf,
|
|
||||||
" || ",
|
|
||||||
size);
|
|
||||||
|
|
||||||
if (video_info.fps_show)
|
|
||||||
{
|
|
||||||
char fps_text[64];
|
|
||||||
snprintf(fps_text, sizeof(fps_text), " FPS: %6.1f || ", last_fps);
|
|
||||||
strlcat(buf, fps_text, size);
|
|
||||||
}
|
|
||||||
|
|
||||||
strlcat(buf, "Frames: ", size);
|
|
||||||
|
|
||||||
snprintf(frames_text, sizeof(frames_text), STRING_REP_UINT64,
|
|
||||||
(unsigned long long)frame_count);
|
|
||||||
|
|
||||||
strlcat(buf, frames_text, size);
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (buf_fps && video_info.fps_show)
|
|
||||||
snprintf(buf_fps, size_fps, "FPS: %6.1f || %s: " STRING_REP_UINT64,
|
|
||||||
last_fps,
|
|
||||||
msg_hash_to_str(MSG_FRAMES),
|
|
||||||
(unsigned long long)frame_count);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
curr_time = fps_time = new_time;
|
|
||||||
strlcpy(buf, video_driver_title_buf, size);
|
|
||||||
if (buf_fps)
|
|
||||||
strlcpy(buf_fps, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE), size_fps);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
float video_driver_get_aspect_ratio(void)
|
float video_driver_get_aspect_ratio(void)
|
||||||
{
|
{
|
||||||
@ -2086,6 +2009,96 @@ unsigned video_pixel_get_alignment(unsigned pitch)
|
|||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* video_monitor_get_fps:
|
||||||
|
*
|
||||||
|
* Get the amount of frames per seconds.
|
||||||
|
*
|
||||||
|
* Returns: true if framerate per seconds could be obtained,
|
||||||
|
* otherwise false.
|
||||||
|
*
|
||||||
|
**/
|
||||||
|
static bool video_monitor_get_fps(video_frame_info_t *video_info)
|
||||||
|
{
|
||||||
|
static retro_time_t curr_time;
|
||||||
|
static retro_time_t fps_time;
|
||||||
|
retro_time_t new_time = cpu_features_get_time_usec();
|
||||||
|
|
||||||
|
if (video_info->frame_count)
|
||||||
|
{
|
||||||
|
static float last_fps;
|
||||||
|
bool ret = false;
|
||||||
|
unsigned write_index = video_driver_frame_time_count++ &
|
||||||
|
(MEASURE_FRAME_TIME_SAMPLES_COUNT - 1);
|
||||||
|
|
||||||
|
video_driver_frame_time_samples[write_index] = new_time - fps_time;
|
||||||
|
fps_time = new_time;
|
||||||
|
|
||||||
|
if ((video_info->frame_count % FPS_UPDATE_INTERVAL) == 0)
|
||||||
|
{
|
||||||
|
char frames_text[64];
|
||||||
|
|
||||||
|
last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL);
|
||||||
|
curr_time = new_time;
|
||||||
|
|
||||||
|
fill_pathname_noext(video_driver_window_title,
|
||||||
|
video_driver_title_buf,
|
||||||
|
" || ",
|
||||||
|
sizeof(video_driver_window_title));
|
||||||
|
|
||||||
|
if (video_info->fps_show)
|
||||||
|
{
|
||||||
|
snprintf(video_info->fps_text,
|
||||||
|
sizeof(video_info->fps_text),
|
||||||
|
" FPS: %6.1f || ", last_fps);
|
||||||
|
strlcat(video_driver_window_title,
|
||||||
|
video_info->fps_text,
|
||||||
|
sizeof(video_driver_window_title));
|
||||||
|
}
|
||||||
|
|
||||||
|
strlcat(video_driver_window_title,
|
||||||
|
"Frames: ",
|
||||||
|
sizeof(video_driver_window_title));
|
||||||
|
|
||||||
|
snprintf(frames_text,
|
||||||
|
sizeof(frames_text),
|
||||||
|
STRING_REP_UINT64,
|
||||||
|
(unsigned long long)video_info->frame_count);
|
||||||
|
|
||||||
|
strlcat(video_driver_window_title,
|
||||||
|
frames_text,
|
||||||
|
sizeof(video_driver_window_title));
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
video_driver_window_title_update = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video_info->fps_show)
|
||||||
|
snprintf(
|
||||||
|
video_info->fps_text,
|
||||||
|
sizeof(video_info->fps_text),
|
||||||
|
"FPS: %6.1f || %s: " STRING_REP_UINT64,
|
||||||
|
last_fps,
|
||||||
|
msg_hash_to_str(MSG_FRAMES),
|
||||||
|
(unsigned long long)video_info->frame_count);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
curr_time = fps_time = new_time;
|
||||||
|
strlcpy(video_driver_window_title,
|
||||||
|
video_driver_title_buf,
|
||||||
|
sizeof(video_driver_window_title));
|
||||||
|
|
||||||
|
strlcpy(video_info->fps_text,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE),
|
||||||
|
sizeof(video_info->fps_text));
|
||||||
|
|
||||||
|
video_driver_window_title_update = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* video_driver_frame:
|
* video_driver_frame:
|
||||||
* @data : pointer to data of the video frame.
|
* @data : pointer to data of the video frame.
|
||||||
@ -2127,10 +2140,21 @@ void video_driver_frame(const void *data, unsigned width,
|
|||||||
|
|
||||||
performance_counter_stop(&video_frame_conv);
|
performance_counter_stop(&video_frame_conv);
|
||||||
|
|
||||||
video_driver_cached_frame_set(data, width, height, pitch);
|
if (data)
|
||||||
|
frame_cache_data = data;
|
||||||
|
frame_cache_width = width;
|
||||||
|
frame_cache_height = height;
|
||||||
|
frame_cache_pitch = pitch;
|
||||||
|
|
||||||
video_driver_build_info(&video_info);
|
video_driver_build_info(&video_info);
|
||||||
|
|
||||||
|
video_driver_threaded_lock();
|
||||||
|
video_info.frame_count = video_driver_frame_count;
|
||||||
|
video_driver_frame_count++;
|
||||||
|
video_driver_threaded_unlock();
|
||||||
|
|
||||||
|
video_info.monitor_fps_enable = video_monitor_get_fps(&video_info);
|
||||||
|
|
||||||
/* Slightly messy code,
|
/* Slightly messy code,
|
||||||
* but we really need to do processing before blocking on VSync
|
* but we really need to do processing before blocking on VSync
|
||||||
* for best possible scheduling.
|
* for best possible scheduling.
|
||||||
@ -2161,16 +2185,14 @@ void video_driver_frame(const void *data, unsigned width,
|
|||||||
&& video_info.font_enable && msg)
|
&& video_info.font_enable && msg)
|
||||||
strlcpy(video_driver_msg, msg, sizeof(video_driver_msg));
|
strlcpy(video_driver_msg, msg, sizeof(video_driver_msg));
|
||||||
|
|
||||||
video_driver_threaded_lock();
|
|
||||||
frame_count = video_driver_frame_count;
|
|
||||||
video_driver_frame_count++;
|
|
||||||
video_driver_threaded_unlock();
|
|
||||||
|
|
||||||
if (!current_video || !current_video->frame(
|
if (!current_video || !current_video->frame(
|
||||||
video_driver_data, data, width, height,
|
video_driver_data, data, width, height,
|
||||||
frame_count,
|
frame_count,
|
||||||
pitch, video_driver_msg, video_info))
|
pitch, video_driver_msg, &video_info))
|
||||||
video_driver_active = false;
|
video_driver_active = false;
|
||||||
|
|
||||||
|
if (video_info.fps_show)
|
||||||
|
runloop_msg_queue_push(video_info.fps_text, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void video_driver_display_type_set(enum rarch_display_type type)
|
void video_driver_display_type_set(enum rarch_display_type type)
|
||||||
@ -2229,6 +2251,7 @@ bool video_driver_texture_unload(uintptr_t *id)
|
|||||||
|
|
||||||
void video_driver_build_info(video_frame_info_t *video_info)
|
void video_driver_build_info(video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
|
video_driver_threaded_lock();
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
video_info->refresh_rate = settings->video.refresh_rate;
|
video_info->refresh_rate = settings->video.refresh_rate;
|
||||||
video_info->black_frame_insertion =
|
video_info->black_frame_insertion =
|
||||||
@ -2245,6 +2268,14 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
|||||||
video_info->monitor_index = settings->video.monitor_index;
|
video_info->monitor_index = settings->video.monitor_index;
|
||||||
video_info->shared_context = settings->video.shared_context;
|
video_info->shared_context = settings->video.shared_context;
|
||||||
video_info->font_enable = settings->video.font_enable;
|
video_info->font_enable = settings->video.font_enable;
|
||||||
|
|
||||||
|
video_info->frame_count = 0;
|
||||||
|
video_info->fps_text[0] = '\0';
|
||||||
|
|
||||||
|
video_info->width = video_driver_width;
|
||||||
|
video_info->height = video_driver_height;
|
||||||
|
|
||||||
|
video_driver_threaded_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2300,3 +2331,12 @@ bool video_driver_translate_coord_viewport(
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void video_driver_get_window_title(char *buf, unsigned len)
|
||||||
|
{
|
||||||
|
if (buf && video_driver_window_title_update)
|
||||||
|
{
|
||||||
|
strlcpy(buf, video_driver_window_title, len);
|
||||||
|
video_driver_window_title_update = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -101,6 +101,12 @@ typedef struct video_frame_info
|
|||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
unsigned monitor_index;
|
unsigned monitor_index;
|
||||||
bool font_enable;
|
bool font_enable;
|
||||||
|
bool monitor_fps_enable;
|
||||||
|
char fps_text[128];
|
||||||
|
uint64_t frame_count;
|
||||||
|
|
||||||
|
unsigned width;
|
||||||
|
unsigned height;
|
||||||
} video_frame_info_t;
|
} video_frame_info_t;
|
||||||
|
|
||||||
/* Optionally implemented interface to poke more
|
/* Optionally implemented interface to poke more
|
||||||
@ -163,7 +169,7 @@ typedef struct video_viewport
|
|||||||
typedef bool (*video_driver_frame_t)(void *data,
|
typedef bool (*video_driver_frame_t)(void *data,
|
||||||
const void *frame, unsigned width,
|
const void *frame, unsigned width,
|
||||||
unsigned height, uint64_t frame_count,
|
unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info);
|
unsigned pitch, const char *msg, video_frame_info_t *video_info);
|
||||||
|
|
||||||
typedef struct video_driver
|
typedef struct video_driver
|
||||||
{
|
{
|
||||||
@ -242,7 +248,7 @@ extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
|
|||||||
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)
|
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)
|
||||||
#define video_driver_has_windowed() (false)
|
#define video_driver_has_windowed() (false)
|
||||||
#else
|
#else
|
||||||
#define video_driver_has_windowed() (current_video->has_windowed(video_driver_data))
|
#define video_driver_has_windowed() (current_video->has_windowed && current_video->has_windowed(video_driver_data))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define video_driver_cached_frame_has_valid_framebuffer() (frame_cache_data ? (frame_cache_data == RETRO_HW_FRAME_BUFFER_VALID) : false)
|
#define video_driver_cached_frame_has_valid_framebuffer() (frame_cache_data ? (frame_cache_data == RETRO_HW_FRAME_BUFFER_VALID) : false)
|
||||||
@ -462,25 +468,6 @@ void video_monitor_set_refresh_rate(float hz);
|
|||||||
bool video_monitor_fps_statistics(double *refresh_rate,
|
bool video_monitor_fps_statistics(double *refresh_rate,
|
||||||
double *deviation, unsigned *sample_points);
|
double *deviation, unsigned *sample_points);
|
||||||
|
|
||||||
/**
|
|
||||||
* video_monitor_get_fps:
|
|
||||||
* @video_info : information about the video frame
|
|
||||||
* @buf : string suitable for Window title
|
|
||||||
* @size : size of buffer.
|
|
||||||
* @buf_fps : string of raw FPS only (optional).
|
|
||||||
* @size_fps : size of raw FPS buffer.
|
|
||||||
*
|
|
||||||
* Get the amount of frames per seconds.
|
|
||||||
*
|
|
||||||
* Returns: true if framerate per seconds could be obtained,
|
|
||||||
* otherwise false.
|
|
||||||
*
|
|
||||||
**/
|
|
||||||
bool video_monitor_get_fps(
|
|
||||||
video_frame_info_t video_info,
|
|
||||||
char *buf, size_t size,
|
|
||||||
char *buf_fps, size_t size_fps);
|
|
||||||
|
|
||||||
unsigned video_pixel_get_alignment(unsigned pitch);
|
unsigned video_pixel_get_alignment(unsigned pitch);
|
||||||
|
|
||||||
const video_poke_interface_t *video_driver_get_poke(void);
|
const video_poke_interface_t *video_driver_get_poke(void);
|
||||||
@ -543,6 +530,8 @@ void video_driver_build_info(video_frame_info_t *video_info);
|
|||||||
|
|
||||||
void video_driver_reinit(void);
|
void video_driver_reinit(void);
|
||||||
|
|
||||||
|
void video_driver_get_window_title(char *buf, unsigned len);
|
||||||
|
|
||||||
extern video_driver_t video_gl;
|
extern video_driver_t video_gl;
|
||||||
extern video_driver_t video_vulkan;
|
extern video_driver_t video_vulkan;
|
||||||
extern video_driver_t video_psp1;
|
extern video_driver_t video_psp1;
|
||||||
|
@ -619,7 +619,7 @@ static void video_thread_loop(void *data)
|
|||||||
thr->frame.buffer, thr->frame.width, thr->frame.height,
|
thr->frame.buffer, thr->frame.width, thr->frame.height,
|
||||||
thr->frame.count,
|
thr->frame.count,
|
||||||
thr->frame.pitch, *thr->frame.msg ? thr->frame.msg : NULL,
|
thr->frame.pitch, *thr->frame.msg ? thr->frame.msg : NULL,
|
||||||
video_info);
|
&video_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
slock_unlock(thr->frame.lock);
|
slock_unlock(thr->frame.lock);
|
||||||
@ -706,7 +706,7 @@ static bool video_thread_has_windowed(void *data)
|
|||||||
|
|
||||||
static bool video_thread_frame(void *data, const void *frame_,
|
static bool video_thread_frame(void *data, const void *frame_,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg, video_frame_info_t video_info)
|
unsigned pitch, const char *msg, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned copy_stride;
|
unsigned copy_stride;
|
||||||
static struct retro_perf_counter thr_frame = {0};
|
static struct retro_perf_counter thr_frame = {0};
|
||||||
@ -741,7 +741,7 @@ static bool video_thread_frame(void *data, const void *frame_,
|
|||||||
{
|
{
|
||||||
|
|
||||||
retro_time_t target_frame_time = (retro_time_t)
|
retro_time_t target_frame_time = (retro_time_t)
|
||||||
roundf(1000000 / video_info.refresh_rate);
|
roundf(1000000 / video_info->refresh_rate);
|
||||||
retro_time_t target = thr->last_time + target_frame_time;
|
retro_time_t target = thr->last_time + target_frame_time;
|
||||||
|
|
||||||
/* Ideally, use absolute time, but that is only a good idea on POSIX. */
|
/* Ideally, use absolute time, but that is only a good idea on POSIX. */
|
||||||
|
@ -270,26 +270,28 @@ static void mui_draw_tab(mui_handle_t *mui,
|
|||||||
&tab_color[0]);
|
&tab_color[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned id)
|
static void mui_render_keyboard(mui_handle_t *mui,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
|
const char *grid[], unsigned id)
|
||||||
{
|
{
|
||||||
int ptr_width, ptr_height;
|
int ptr_width, ptr_height;
|
||||||
unsigned i, width, height;
|
unsigned i;
|
||||||
float dark[16]= {
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
float dark[16] = {
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
};
|
};
|
||||||
|
|
||||||
float white[16]= {
|
float white[16] = {
|
||||||
1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
};
|
};
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
||||||
width, height,
|
width, height,
|
||||||
&dark[0]);
|
&dark[0]);
|
||||||
@ -327,17 +329,16 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the OSK key at a given position */
|
/* Returns the OSK key at a given position */
|
||||||
static int mui_osk_ptr_at_pos(void *data, int x, int y)
|
static int mui_osk_ptr_at_pos(void *data, int x, int y,
|
||||||
|
unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
int ptr_width, ptr_height;
|
int ptr_width, ptr_height;
|
||||||
unsigned i, width, height;
|
|
||||||
|
|
||||||
mui_handle_t *mui = (mui_handle_t*)data;
|
mui_handle_t *mui = (mui_handle_t*)data;
|
||||||
|
|
||||||
if (!mui)
|
if (!mui)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
ptr_width = width / 11;
|
ptr_width = width / 11;
|
||||||
ptr_height = height / 10;
|
ptr_height = height / 10;
|
||||||
|
|
||||||
@ -364,7 +365,7 @@ static void mui_draw_tab_begin(mui_handle_t *mui,
|
|||||||
{
|
{
|
||||||
float scale_factor = menu_display_get_dpi();
|
float scale_factor = menu_display_get_dpi();
|
||||||
|
|
||||||
mui->tabs_height = scale_factor / 3;
|
mui->tabs_height = scale_factor / 3;
|
||||||
|
|
||||||
/* tabs background */
|
/* tabs background */
|
||||||
menu_display_draw_quad(0, height - mui->tabs_height, width,
|
menu_display_draw_quad(0, height - mui->tabs_height, width,
|
||||||
@ -395,16 +396,17 @@ static void mui_draw_tab_end(mui_handle_t *mui,
|
|||||||
&active_tab_marker_color[0]);
|
&active_tab_marker_color[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static float mui_content_height()
|
static float mui_content_height(void)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
unsigned i = 0;
|
|
||||||
for (; i < menu_entries_get_end(); i++)
|
for (i = 0; i < menu_entries_get_end(); i++)
|
||||||
{
|
{
|
||||||
mui_node_t *node = (mui_node_t*)
|
mui_node_t *node = (mui_node_t*)
|
||||||
menu_entries_get_userdata_at_offset(list, i);
|
menu_entries_get_userdata_at_offset(list, i);
|
||||||
sum += node->line_height;
|
sum += node->line_height;
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
@ -412,38 +414,31 @@ static float mui_content_height()
|
|||||||
static void mui_draw_scrollbar(mui_handle_t *mui,
|
static void mui_draw_scrollbar(mui_handle_t *mui,
|
||||||
unsigned width, unsigned height, float *coord_color)
|
unsigned width, unsigned height, float *coord_color)
|
||||||
{
|
{
|
||||||
unsigned header_height;
|
unsigned header_height = menu_display_get_header_height();
|
||||||
float content_height, total_height,
|
float content_height = mui_content_height();
|
||||||
scrollbar_height, scrollbar_margin, y;
|
float total_height = height - header_height - mui->tabs_height;
|
||||||
|
float scrollbar_margin = mui->scrollbar_width;
|
||||||
if (!mui)
|
float scrollbar_height = total_height / (content_height / total_height);
|
||||||
return;
|
float y = total_height * mui->scroll_y / content_height;
|
||||||
|
|
||||||
header_height = menu_display_get_header_height();
|
|
||||||
|
|
||||||
content_height = mui_content_height();
|
|
||||||
total_height = height - header_height - mui->tabs_height;
|
|
||||||
scrollbar_margin = mui->scrollbar_width;
|
|
||||||
scrollbar_height = total_height / (content_height / total_height);
|
|
||||||
y = total_height * mui->scroll_y / content_height;
|
|
||||||
|
|
||||||
/* apply a margin on the top and bottom of the scrollbar for aestetic */
|
/* apply a margin on the top and bottom of the scrollbar for aestetic */
|
||||||
scrollbar_height -= scrollbar_margin * 2;
|
scrollbar_height -= scrollbar_margin * 2;
|
||||||
y += scrollbar_margin;
|
y += scrollbar_margin;
|
||||||
|
|
||||||
if (content_height >= total_height)
|
if (content_height < total_height)
|
||||||
{
|
return;
|
||||||
/* if the scrollbar is extremely short, display it as a square */
|
|
||||||
if (scrollbar_height <= mui->scrollbar_width)
|
|
||||||
scrollbar_height = mui->scrollbar_width;
|
|
||||||
|
|
||||||
menu_display_draw_quad( width - mui->scrollbar_width - scrollbar_margin,
|
/* if the scrollbar is extremely short, display it as a square */
|
||||||
header_height + y,
|
if (scrollbar_height <= mui->scrollbar_width)
|
||||||
mui->scrollbar_width,
|
scrollbar_height = mui->scrollbar_width;
|
||||||
scrollbar_height,
|
|
||||||
width, height,
|
menu_display_draw_quad(
|
||||||
coord_color);
|
width - mui->scrollbar_width - scrollbar_margin,
|
||||||
}
|
header_height + y,
|
||||||
|
mui->scrollbar_width,
|
||||||
|
scrollbar_height,
|
||||||
|
width, height,
|
||||||
|
coord_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_get_message(void *data, const char *message)
|
static void mui_get_message(void *data, const char *message)
|
||||||
@ -457,10 +452,13 @@ static void mui_get_message(void *data, const char *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void mui_render_messagebox(mui_handle_t *mui,
|
static void mui_render_messagebox(mui_handle_t *mui,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
const char *message, float *body_bg_color, uint32_t font_color)
|
const char *message, float *body_bg_color, uint32_t font_color)
|
||||||
{
|
{
|
||||||
unsigned i, width, height, y_position;
|
unsigned i, y_position;
|
||||||
int x, y, line_height, longest = 0, longest_width = 0;
|
int x, y, line_height, longest = 0, longest_width = 0;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
struct string_list *list = (struct string_list*)
|
struct string_list *list = (struct string_list*)
|
||||||
string_split(message, "\n");
|
string_split(message, "\n");
|
||||||
|
|
||||||
@ -469,8 +467,6 @@ static void mui_render_messagebox(mui_handle_t *mui,
|
|||||||
if (list->elems == 0)
|
if (list->elems == 0)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
line_height = mui->font->size * 1.2;
|
line_height = mui->font->size * 1.2;
|
||||||
|
|
||||||
y_position = height / 2;
|
y_position = height / 2;
|
||||||
@ -515,27 +511,30 @@ static void mui_render_messagebox(mui_handle_t *mui,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (menu_input_dialog_get_display_kb())
|
if (menu_input_dialog_get_display_kb())
|
||||||
mui_render_keyboard(mui, menu_event_get_osk_grid(), menu_event_get_osk_ptr());
|
mui_render_keyboard(mui,
|
||||||
|
video_info,
|
||||||
|
menu_event_get_osk_grid(), menu_event_get_osk_ptr());
|
||||||
|
|
||||||
end:
|
end:
|
||||||
string_list_free(list);
|
string_list_free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned count_lines(const char *str)
|
static unsigned mui_count_lines(const char *str)
|
||||||
{
|
{
|
||||||
unsigned c = 0;
|
unsigned c = 0;
|
||||||
unsigned lines = 1;
|
unsigned lines = 1;
|
||||||
|
|
||||||
for (c = 0; str[c]; c++)
|
for (c = 0; str[c]; c++)
|
||||||
lines += (str[c] == '\n');
|
lines += (str[c] == '\n');
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compute_entries_box(mui_handle_t* mui, int width)
|
static void mui_compute_entries_box(mui_handle_t* mui, int width)
|
||||||
{
|
{
|
||||||
size_t usable_width = width - (mui->margin * 2);
|
size_t usable_width = width - (mui->margin * 2);
|
||||||
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
||||||
float sum = 0;
|
float sum = 0;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
|
|
||||||
for (; i < menu_entries_get_end(); i++)
|
for (; i < menu_entries_get_end(); i++)
|
||||||
{
|
{
|
||||||
@ -550,7 +549,7 @@ static void compute_entries_box(mui_handle_t* mui, int width)
|
|||||||
if (menu_entry_get_sublabel(i, sublabel_str, sizeof(sublabel_str)))
|
if (menu_entry_get_sublabel(i, sublabel_str, sizeof(sublabel_str)))
|
||||||
{
|
{
|
||||||
word_wrap(sublabel_str, sublabel_str, (int)(usable_width / mui->glyph_width2));
|
word_wrap(sublabel_str, sublabel_str, (int)(usable_width / mui->glyph_width2));
|
||||||
lines = count_lines(sublabel_str);
|
lines = mui_count_lines(sublabel_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
scale_factor = menu_display_get_dpi();
|
scale_factor = menu_display_get_dpi();
|
||||||
@ -562,20 +561,20 @@ static void compute_entries_box(mui_handle_t* mui, int width)
|
|||||||
|
|
||||||
static void mui_render(void *data)
|
static void mui_render(void *data)
|
||||||
{
|
{
|
||||||
size_t i = 0;
|
|
||||||
menu_animation_ctx_delta_t delta;
|
menu_animation_ctx_delta_t delta;
|
||||||
float delta_time;
|
float delta_time;
|
||||||
unsigned bottom, width, height, header_height;
|
unsigned bottom, width, height, header_height;
|
||||||
|
size_t i = 0;
|
||||||
mui_handle_t *mui = (mui_handle_t*)data;
|
mui_handle_t *mui = (mui_handle_t*)data;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *list = menu_entries_get_selection_buf_ptr(0);
|
||||||
|
|
||||||
if (!mui)
|
if (!mui)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
video_driver_get_size(&width, &height);
|
||||||
|
|
||||||
compute_entries_box(mui, width);
|
mui_compute_entries_box(mui, width);
|
||||||
|
|
||||||
menu_animation_ctl(MENU_ANIMATION_CTL_DELTA_TIME, &delta_time);
|
menu_animation_ctl(MENU_ANIMATION_CTL_DELTA_TIME, &delta_time);
|
||||||
|
|
||||||
@ -800,7 +799,9 @@ static void mui_render_label_value(mui_handle_t *mui, mui_node_t *node,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_render_menu_list(mui_handle_t *mui,
|
static void mui_render_menu_list(
|
||||||
|
video_frame_info_t *video_info,
|
||||||
|
mui_handle_t *mui,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
uint32_t font_normal_color,
|
uint32_t font_normal_color,
|
||||||
uint32_t font_hover_color,
|
uint32_t font_hover_color,
|
||||||
@ -809,9 +810,8 @@ static void mui_render_menu_list(mui_handle_t *mui,
|
|||||||
float sum = 0;
|
float sum = 0;
|
||||||
unsigned header_height = 0;
|
unsigned header_height = 0;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
uint64_t frame_count = 0;
|
|
||||||
file_list_t *list = NULL;
|
file_list_t *list = NULL;
|
||||||
frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_info->frame_count;
|
||||||
|
|
||||||
if (!menu_display_get_update_pending())
|
if (!menu_display_get_update_pending())
|
||||||
return;
|
return;
|
||||||
@ -938,7 +938,7 @@ static void mui_draw_bg(menu_display_ctx_draw_t *draw)
|
|||||||
menu_display_blend_end();
|
menu_display_blend_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_frame(void *data)
|
static void mui_frame(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
float black_bg[16] = {
|
float black_bg[16] = {
|
||||||
0, 0, 0, 0.75,
|
0, 0, 0, 0.75,
|
||||||
@ -1028,15 +1028,15 @@ static void mui_frame(void *data)
|
|||||||
float header_bg_color_real[16] = {0};
|
float header_bg_color_real[16] = {0};
|
||||||
file_list_t *list = NULL;
|
file_list_t *list = NULL;
|
||||||
mui_node_t *node = NULL;
|
mui_node_t *node = NULL;
|
||||||
unsigned width = 0;
|
unsigned width = video_info->width;
|
||||||
unsigned height = 0;
|
unsigned height = video_info->height;
|
||||||
unsigned ticker_limit = 0;
|
unsigned ticker_limit = 0;
|
||||||
unsigned i = 0;
|
unsigned i = 0;
|
||||||
unsigned header_height = 0;
|
unsigned header_height = 0;
|
||||||
size_t selection = 0;
|
size_t selection = 0;
|
||||||
size_t title_margin = 0;
|
size_t title_margin = 0;
|
||||||
mui_handle_t *mui = (mui_handle_t*)data;
|
mui_handle_t *mui = (mui_handle_t*)data;
|
||||||
uint64_t frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_info->frame_count;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool background_rendered = false;
|
bool background_rendered = false;
|
||||||
bool libretro_running = menu_display_libretro_running();
|
bool libretro_running = menu_display_libretro_running();
|
||||||
@ -1210,9 +1210,7 @@ static void mui_frame(void *data)
|
|||||||
menu_display_set_alpha(header_bg_color_real, settings->menu.header.opacity);
|
menu_display_set_alpha(header_bg_color_real, settings->menu.header.opacity);
|
||||||
menu_display_set_alpha(footer_bg_color_real, settings->menu.footer.opacity);
|
menu_display_set_alpha(footer_bg_color_real, settings->menu.footer.opacity);
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
menu_display_set_viewport();
|
|
||||||
header_height = menu_display_get_header_height();
|
header_height = menu_display_get_header_height();
|
||||||
|
|
||||||
if (libretro_running)
|
if (libretro_running)
|
||||||
@ -1293,6 +1291,7 @@ static void mui_frame(void *data)
|
|||||||
menu_display_font_bind_block(mui->font2, &mui->raster_block2);
|
menu_display_font_bind_block(mui->font2, &mui->raster_block2);
|
||||||
|
|
||||||
mui_render_menu_list(
|
mui_render_menu_list(
|
||||||
|
video_info,
|
||||||
mui,
|
mui,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
@ -1405,13 +1404,13 @@ static void mui_frame(void *data)
|
|||||||
|
|
||||||
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
||||||
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
|
snprintf(msg, sizeof(msg), "%s\n%s", label, str);
|
||||||
mui_render_messagebox(mui, msg, &body_bg_color[0], font_hover_color);
|
mui_render_messagebox(mui, video_info, msg, &body_bg_color[0], font_hover_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string_is_empty(mui->box_message))
|
if (!string_is_empty(mui->box_message))
|
||||||
{
|
{
|
||||||
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
menu_display_draw_quad(0, 0, width, height, width, height, &black_bg[0]);
|
||||||
mui_render_messagebox(mui, mui->box_message, &body_bg_color[0], font_hover_color);
|
mui_render_messagebox(mui, video_info, mui->box_message, &body_bg_color[0], font_hover_color);
|
||||||
mui->box_message[0] = '\0';
|
mui->box_message[0] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1426,7 +1425,7 @@ static void mui_frame(void *data)
|
|||||||
height);
|
height);
|
||||||
|
|
||||||
menu_display_restore_clear_color();
|
menu_display_restore_clear_color();
|
||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mui_layout(mui_handle_t *mui)
|
static void mui_layout(mui_handle_t *mui)
|
||||||
@ -1661,7 +1660,6 @@ static void mui_context_reset(void *data)
|
|||||||
if (!mui || !settings)
|
if (!mui || !settings)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
mui_layout(mui);
|
mui_layout(mui);
|
||||||
mui_context_bg_destroy(mui);
|
mui_context_bg_destroy(mui);
|
||||||
menu_display_allocate_white_texture();
|
menu_display_allocate_white_texture();
|
||||||
|
@ -145,6 +145,9 @@ static void xmb_init_ribbon(nk_menu_handle_t * xmb)
|
|||||||
|
|
||||||
static void *nk_menu_init(void **userdata)
|
static void *nk_menu_init(void **userdata)
|
||||||
{
|
{
|
||||||
|
#if 1
|
||||||
|
unsigned i;
|
||||||
|
#endif
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
nk_menu_handle_t *nk = NULL;
|
nk_menu_handle_t *nk = NULL;
|
||||||
menu_handle_t *menu = (menu_handle_t*)
|
menu_handle_t *menu = (menu_handle_t*)
|
||||||
@ -169,16 +172,18 @@ static void *nk_menu_init(void **userdata)
|
|||||||
"nuklear", sizeof(nk->assets_directory));
|
"nuklear", sizeof(nk->assets_directory));
|
||||||
nk_menu_init_device(nk);
|
nk_menu_init_device(nk);
|
||||||
|
|
||||||
/* for demo puposes only, opens all windows */
|
/* for demo purposes only, opens all windows */
|
||||||
#if 1
|
#if 1
|
||||||
for (int i=0; i < NK_WND_LAST; i++)
|
for (i = 0; i < NK_WND_LAST; i++)
|
||||||
nk->window[i].open = true;
|
nk->window[i].open = true;
|
||||||
#else
|
#else
|
||||||
nk->window[NK_WND_MAIN].open = true;
|
nk->window[NK_WND_MAIN].open = true;
|
||||||
#endif
|
#endif
|
||||||
xmb_init_ribbon(nk);
|
xmb_init_ribbon(nk);
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
error:
|
error:
|
||||||
|
|
||||||
if (menu)
|
if (menu)
|
||||||
free(menu);
|
free(menu);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -250,6 +255,7 @@ static void nk_menu_get_message(void *data, const char *message)
|
|||||||
|
|
||||||
static void nk_draw_bg(
|
static void nk_draw_bg(
|
||||||
nk_menu_handle_t *nk,
|
nk_menu_handle_t *nk,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
unsigned height,
|
unsigned height,
|
||||||
float alpha,
|
float alpha,
|
||||||
@ -273,7 +279,7 @@ static void nk_draw_bg(
|
|||||||
draw.pipeline.id = 0;
|
draw.pipeline.id = 0;
|
||||||
|
|
||||||
menu_display_blend_begin();
|
menu_display_blend_begin();
|
||||||
menu_display_set_viewport();
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
draw.pipeline.id = VIDEO_SHADER_MENU_5;
|
draw.pipeline.id = VIDEO_SHADER_MENU_5;
|
||||||
draw.pipeline.active = false;
|
draw.pipeline.active = false;
|
||||||
@ -302,18 +308,24 @@ static void nk_menu_main(nk_menu_handle_t *nk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void nk_menu_frame(void *data)
|
static void nk_menu_frame(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
float white_bg[16]= {
|
unsigned ticker_limit, i;
|
||||||
|
float coord_black[16], coord_white[16];
|
||||||
|
nk_menu_handle_t *nk = (nk_menu_handle_t*)data;
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
|
bool libretro_running = menu_display_libretro_running();
|
||||||
|
float white_bg[16] = {
|
||||||
0.98, 0.98, 0.98, 1,
|
0.98, 0.98, 0.98, 1,
|
||||||
0.98, 0.98, 0.98, 1,
|
0.98, 0.98, 0.98, 1,
|
||||||
0.98, 0.98, 0.98, 1,
|
0.98, 0.98, 0.98, 1,
|
||||||
0.98, 0.98, 0.98, 1,
|
0.98, 0.98, 0.98, 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
float coord_black[16], coord_white[16];
|
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
coord_black[i] = 0;
|
coord_black[i] = 0;
|
||||||
coord_white[i] = 1.0f;
|
coord_white[i] = 1.0f;
|
||||||
@ -322,18 +334,10 @@ static void nk_menu_frame(void *data)
|
|||||||
menu_display_set_alpha(coord_black, 0.75);
|
menu_display_set_alpha(coord_black, 0.75);
|
||||||
menu_display_set_alpha(coord_white, 0.75);
|
menu_display_set_alpha(coord_white, 0.75);
|
||||||
|
|
||||||
unsigned width, height, ticker_limit, i;
|
|
||||||
nk_menu_handle_t *nk = (nk_menu_handle_t*)data;
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
bool libretro_running = menu_display_libretro_running();
|
|
||||||
|
|
||||||
if (!nk)
|
if (!nk)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
menu_display_set_viewport();
|
|
||||||
|
|
||||||
nk_input_begin(&nk->ctx);
|
nk_input_begin(&nk->ctx);
|
||||||
nk_menu_input_gamepad(nk);
|
nk_menu_input_gamepad(nk);
|
||||||
@ -350,7 +354,7 @@ static void nk_menu_frame(void *data)
|
|||||||
|
|
||||||
nk_input_end(&nk->ctx);
|
nk_input_end(&nk->ctx);
|
||||||
nk_menu_main(nk);
|
nk_menu_main(nk);
|
||||||
nk_draw_bg(nk, width, height, 0.5, nk->textures.bg, coord_black, coord_white);
|
nk_draw_bg(nk, video_info, width, height, 0.5, nk->textures.bg, coord_black, coord_white);
|
||||||
nk_common_device_draw(&device, &nk->ctx, width, height, NK_ANTI_ALIASING_ON);
|
nk_common_device_draw(&device, &nk->ctx, width, height, NK_ANTI_ALIASING_ON);
|
||||||
|
|
||||||
menu_display_draw_cursor(
|
menu_display_draw_cursor(
|
||||||
@ -363,7 +367,7 @@ static void nk_menu_frame(void *data)
|
|||||||
height);
|
height);
|
||||||
|
|
||||||
menu_display_restore_clear_color();
|
menu_display_restore_clear_color();
|
||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nk_menu_free(void *data)
|
static void nk_menu_free(void *data)
|
||||||
|
@ -62,6 +62,7 @@ typedef struct
|
|||||||
unsigned last_height;
|
unsigned last_height;
|
||||||
float scroll_y;
|
float scroll_y;
|
||||||
bool mouse_show;
|
bool mouse_show;
|
||||||
|
unsigned int frame_count;
|
||||||
} rgui_t;
|
} rgui_t;
|
||||||
|
|
||||||
static uint16_t *rgui_framebuf_data = NULL;
|
static uint16_t *rgui_framebuf_data = NULL;
|
||||||
@ -381,6 +382,12 @@ static void rgui_blit_cursor(void)
|
|||||||
rgui_color_rect(fb_pitch, fb_width, fb_height, x - 5, y, 11, 1, 0xFFFF);
|
rgui_color_rect(fb_pitch, fb_width, fb_height, x - 5, y, 11, 1, 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void rgui_frame(void *data, video_frame_info_t *video_info)
|
||||||
|
{
|
||||||
|
rgui_t *rgui = (rgui_t*)data;
|
||||||
|
rgui->frame_count = video_info->frame_count;
|
||||||
|
}
|
||||||
|
|
||||||
static void rgui_render(void *data)
|
static void rgui_render(void *data)
|
||||||
{
|
{
|
||||||
menu_animation_ctx_ticker_t ticker;
|
menu_animation_ctx_ticker_t ticker;
|
||||||
@ -394,11 +401,9 @@ static void rgui_render(void *data)
|
|||||||
char title_msg[64];
|
char title_msg[64];
|
||||||
char msg[255];
|
char msg[255];
|
||||||
bool msg_force = false;
|
bool msg_force = false;
|
||||||
uint64_t frame_count = 0;
|
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
rgui_t *rgui = (rgui_t*)data;
|
rgui_t *rgui = (rgui_t*)data;
|
||||||
|
uint64_t frame_count = rgui->frame_count;
|
||||||
frame_count = video_driver_get_frame_count();
|
|
||||||
|
|
||||||
msg[0] = title[0] = title_buf[0] = title_msg[0] = '\0';
|
msg[0] = title[0] = title_buf[0] = title_msg[0] = '\0';
|
||||||
|
|
||||||
@ -874,7 +879,7 @@ menu_ctx_driver_t menu_ctx_rgui = {
|
|||||||
rgui_set_message,
|
rgui_set_message,
|
||||||
generic_menu_iterate,
|
generic_menu_iterate,
|
||||||
rgui_render,
|
rgui_render,
|
||||||
NULL,
|
rgui_frame,
|
||||||
rgui_init,
|
rgui_init,
|
||||||
rgui_free,
|
rgui_free,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -706,11 +706,15 @@ static void xmb_messagebox(void *data, const char *message)
|
|||||||
strlcpy(xmb->box_message, message, sizeof(xmb->box_message));
|
strlcpy(xmb->box_message, message, sizeof(xmb->box_message));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned id)
|
static void xmb_render_keyboard(xmb_handle_t *xmb,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
|
const char *grid[], unsigned id)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
int ptr_width, ptr_height;
|
int ptr_width, ptr_height;
|
||||||
unsigned i, width, height;
|
unsigned width = video_info->height;
|
||||||
float dark[16]= {
|
unsigned height = video_info->height;
|
||||||
|
float dark[16] = {
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.85,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
@ -724,8 +728,6 @@ static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned
|
|||||||
1.00, 1.00, 1.00, 1.00,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
};
|
};
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
menu_display_draw_quad(0, height/2.0, width, height/2.0,
|
||||||
width, height,
|
width, height,
|
||||||
&dark[0]);
|
&dark[0]);
|
||||||
@ -765,18 +767,16 @@ static void xmb_render_keyboard(xmb_handle_t *xmb, const char *grid[], unsigned
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the OSK key at a given position */
|
/* Returns the OSK key at a given position */
|
||||||
static int xmb_osk_ptr_at_pos(void *data, int x, int y)
|
static int xmb_osk_ptr_at_pos(void *data, int x, int y, unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
|
unsigned i;
|
||||||
int ptr_width, ptr_height;
|
int ptr_width, ptr_height;
|
||||||
unsigned i, width, height;
|
|
||||||
|
|
||||||
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
xmb_handle_t *xmb = (xmb_handle_t*)data;
|
||||||
|
|
||||||
if (!xmb)
|
if (!xmb)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
ptr_width = width / 11;
|
||||||
|
|
||||||
ptr_width = width / 11;
|
|
||||||
ptr_height = height / 10;
|
ptr_height = height / 10;
|
||||||
|
|
||||||
if (ptr_width >= ptr_height)
|
if (ptr_width >= ptr_height)
|
||||||
@ -798,19 +798,14 @@ static int xmb_osk_ptr_at_pos(void *data, int x, int y)
|
|||||||
|
|
||||||
static void xmb_render_messagebox_internal(
|
static void xmb_render_messagebox_internal(
|
||||||
menu_display_frame_info_t menu_disp_info,
|
menu_display_frame_info_t menu_disp_info,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
xmb_handle_t *xmb, const char *message)
|
xmb_handle_t *xmb, const char *message)
|
||||||
{
|
{
|
||||||
int x, y, longest = 0, longest_width = 0;
|
|
||||||
unsigned i, y_position;
|
unsigned i, y_position;
|
||||||
unsigned width, height;
|
int x, y, longest = 0, longest_width = 0;
|
||||||
struct string_list *list = NULL;
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
if (!xmb)
|
struct string_list *list = string_split(message, "\n");
|
||||||
return;
|
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
list = string_split(message, "\n");
|
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -856,6 +851,7 @@ static void xmb_render_messagebox_internal(
|
|||||||
|
|
||||||
if (menu_input_dialog_get_display_kb())
|
if (menu_input_dialog_get_display_kb())
|
||||||
xmb_render_keyboard(xmb,
|
xmb_render_keyboard(xmb,
|
||||||
|
video_info,
|
||||||
menu_event_get_osk_grid(),
|
menu_event_get_osk_grid(),
|
||||||
menu_event_get_osk_ptr());
|
menu_event_get_osk_ptr());
|
||||||
|
|
||||||
@ -2064,6 +2060,7 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_draw_items(
|
static void xmb_draw_items(
|
||||||
|
video_frame_info_t *video_info,
|
||||||
menu_display_frame_info_t menu_disp_info,
|
menu_display_frame_info_t menu_disp_info,
|
||||||
xmb_handle_t *xmb,
|
xmb_handle_t *xmb,
|
||||||
file_list_t *list, file_list_t *stack,
|
file_list_t *list, file_list_t *stack,
|
||||||
@ -2073,10 +2070,9 @@ static void xmb_draw_items(
|
|||||||
size_t i;
|
size_t i;
|
||||||
math_matrix_4x4 mymat;
|
math_matrix_4x4 mymat;
|
||||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||||
uint64_t frame_count = 0;
|
|
||||||
xmb_node_t *core_node = NULL;
|
xmb_node_t *core_node = NULL;
|
||||||
size_t end = 0;
|
size_t end = 0;
|
||||||
frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_info->frame_count;
|
||||||
|
|
||||||
if (!list || !list->size)
|
if (!list || !list->size)
|
||||||
return;
|
return;
|
||||||
@ -2413,6 +2409,7 @@ static bool xmb_shader_pipeline_active(settings_t *settings)
|
|||||||
|
|
||||||
static void xmb_draw_bg(
|
static void xmb_draw_bg(
|
||||||
xmb_handle_t *xmb,
|
xmb_handle_t *xmb,
|
||||||
|
video_frame_info_t *video_info,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
unsigned height,
|
unsigned height,
|
||||||
float alpha,
|
float alpha,
|
||||||
@ -2427,7 +2424,7 @@ static void xmb_draw_bg(
|
|||||||
RARCH_LOG("DRAW BG %d %d \n",width,height);
|
RARCH_LOG("DRAW BG %d %d \n",width,height);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool running = menu_display_libretro_running();
|
bool running = menu_display_libretro_running();
|
||||||
|
|
||||||
draw.x = 0;
|
draw.x = 0;
|
||||||
draw.y = 0;
|
draw.y = 0;
|
||||||
@ -2443,7 +2440,7 @@ static void xmb_draw_bg(
|
|||||||
draw.pipeline.active = xmb_shader_pipeline_active(settings);
|
draw.pipeline.active = xmb_shader_pipeline_active(settings);
|
||||||
|
|
||||||
menu_display_blend_begin();
|
menu_display_blend_begin();
|
||||||
menu_display_set_viewport();
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
#ifdef HAVE_SHADERPIPELINE
|
#ifdef HAVE_SHADERPIPELINE
|
||||||
if (settings->menu.xmb.shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
|
if (settings->menu.xmb.shader_pipeline > XMB_SHADER_PIPELINE_WALLPAPER
|
||||||
@ -2553,18 +2550,20 @@ static void xmb_draw_dark_layer(
|
|||||||
menu_display_blend_end();
|
menu_display_blend_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_frame(void *data)
|
static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
size_t selection;
|
size_t selection;
|
||||||
size_t percent_width = 0;
|
size_t percent_width = 0;
|
||||||
math_matrix_4x4 mymat;
|
math_matrix_4x4 mymat;
|
||||||
unsigned i, width, height;
|
unsigned i;
|
||||||
float item_color[16], coord_black[16], coord_white[16];
|
float item_color[16], coord_black[16], coord_white[16];
|
||||||
menu_display_ctx_rotate_draw_t rotate_draw;
|
menu_display_ctx_rotate_draw_t rotate_draw;
|
||||||
char msg[1024];
|
char msg[1024];
|
||||||
char title_msg[255];
|
char title_msg[255];
|
||||||
char title_truncated[255];
|
char title_truncated[255];
|
||||||
menu_display_frame_info_t menu_disp_info;
|
menu_display_frame_info_t menu_disp_info;
|
||||||
|
unsigned width = video_info->width;
|
||||||
|
unsigned height = video_info->height;
|
||||||
bool render_background = false;
|
bool render_background = false;
|
||||||
file_list_t *selection_buf = NULL;
|
file_list_t *selection_buf = NULL;
|
||||||
file_list_t *menu_stack = NULL;
|
file_list_t *menu_stack = NULL;
|
||||||
@ -2580,8 +2579,6 @@ static void xmb_frame(void *data)
|
|||||||
title_msg[0] = '\0';
|
title_msg[0] = '\0';
|
||||||
title_truncated[0] = '\0';
|
title_truncated[0] = '\0';
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
|
|
||||||
menu_display_font_bind_block(xmb->font, &xmb->raster_block);
|
menu_display_font_bind_block(xmb->font, &xmb->raster_block);
|
||||||
menu_display_font_bind_block(xmb->font2, &xmb->raster_block2);
|
menu_display_font_bind_block(xmb->font2, &xmb->raster_block2);
|
||||||
|
|
||||||
@ -2601,6 +2598,7 @@ static void xmb_frame(void *data)
|
|||||||
|
|
||||||
xmb_draw_bg(
|
xmb_draw_bg(
|
||||||
xmb,
|
xmb,
|
||||||
|
video_info,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
xmb->alpha,
|
xmb->alpha,
|
||||||
@ -2813,7 +2811,9 @@ static void xmb_frame(void *data)
|
|||||||
menu_display_blend_end();
|
menu_display_blend_end();
|
||||||
|
|
||||||
/* Vertical icons */
|
/* Vertical icons */
|
||||||
xmb_draw_items(menu_disp_info,
|
xmb_draw_items(
|
||||||
|
video_info,
|
||||||
|
menu_disp_info,
|
||||||
xmb,
|
xmb,
|
||||||
xmb->selection_buf_old,
|
xmb->selection_buf_old,
|
||||||
xmb->menu_stack_old,
|
xmb->menu_stack_old,
|
||||||
@ -2828,6 +2828,7 @@ static void xmb_frame(void *data)
|
|||||||
menu_stack = menu_entries_get_menu_stack_ptr(0);
|
menu_stack = menu_entries_get_menu_stack_ptr(0);
|
||||||
|
|
||||||
xmb_draw_items(
|
xmb_draw_items(
|
||||||
|
video_info,
|
||||||
menu_disp_info,
|
menu_disp_info,
|
||||||
xmb,
|
xmb,
|
||||||
selection_buf,
|
selection_buf,
|
||||||
@ -2882,7 +2883,7 @@ static void xmb_frame(void *data)
|
|||||||
{
|
{
|
||||||
xmb_draw_dark_layer(xmb, width, height);
|
xmb_draw_dark_layer(xmb, width, height);
|
||||||
|
|
||||||
xmb_render_messagebox_internal(menu_disp_info, xmb, msg);
|
xmb_render_messagebox_internal(menu_disp_info, video_info, xmb, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cursor image */
|
/* Cursor image */
|
||||||
@ -2899,7 +2900,7 @@ static void xmb_frame(void *data)
|
|||||||
height);
|
height);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
|
static void xmb_layout_ps3(xmb_handle_t *xmb, int width)
|
||||||
|
@ -399,7 +399,7 @@ end:
|
|||||||
string_list_free(list);
|
string_list_free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xui_frame(void *data)
|
static void xui_frame(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
XUIMessage msg;
|
XUIMessage msg;
|
||||||
XUIMessageRender msgRender;
|
XUIMessageRender msgRender;
|
||||||
@ -417,7 +417,7 @@ static void xui_frame(void *data)
|
|||||||
if (!d3dr)
|
if (!d3dr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
menu_display_set_viewport();
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
app.RunFrame();
|
app.RunFrame();
|
||||||
XuiTimersRun();
|
XuiTimersRun();
|
||||||
@ -445,7 +445,7 @@ static void xui_frame(void *data)
|
|||||||
|
|
||||||
XuiRenderEnd( app.GetDC() );
|
XuiRenderEnd( app.GetDC() );
|
||||||
|
|
||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blit_line(int x, int y, const char *message, bool green)
|
static void blit_line(int x, int y, const char *message, bool green)
|
||||||
|
@ -311,19 +311,19 @@ static bool zarch_zui_button(zui_t *zui, int x1, int y1, const char *label)
|
|||||||
+ zarch_zui_strwidth(zui->font, label, 1.0) + 24, y1 + 64, label);
|
+ zarch_zui_strwidth(zui->font, label, 1.0) + 24, y1 + 64, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool zarch_zui_list_item(zui_t *zui, struct zui_tabbed *tab, int x1, int y1,
|
static bool zarch_zui_list_item(video_frame_info_t *video_info,
|
||||||
|
zui_t *zui, struct zui_tabbed *tab, int x1, int y1,
|
||||||
const char *label, unsigned item_id, const char *entry, bool selected)
|
const char *label, unsigned item_id, const char *entry, bool selected)
|
||||||
{
|
{
|
||||||
menu_animation_ctx_ticker_t ticker;
|
menu_animation_ctx_ticker_t ticker;
|
||||||
unsigned ticker_size;
|
unsigned ticker_size;
|
||||||
char title_buf[PATH_MAX_LENGTH];
|
char title_buf[PATH_MAX_LENGTH];
|
||||||
uint64_t frame_count = NULL;
|
|
||||||
unsigned id = zarch_zui_hash(zui, label);
|
unsigned id = zarch_zui_hash(zui, label);
|
||||||
int x2 = x1 + zui->width - 290 - 40;
|
int x2 = x1 + zui->width - 290 - 40;
|
||||||
int y2 = y1 + 50;
|
int y2 = y1 + 50;
|
||||||
bool active = zarch_zui_check_button_up(zui, id, x1, y1, x2, y2);
|
bool active = zarch_zui_check_button_up(zui, id, x1, y1, x2, y2);
|
||||||
const float *bg = zui_bg_panel;
|
const float *bg = zui_bg_panel;
|
||||||
frame_count = video_driver_get_frame_count();
|
uint64_t frame_count = video_info->frame_count;
|
||||||
|
|
||||||
title_buf[0] = '\0';
|
title_buf[0] = '\0';
|
||||||
|
|
||||||
@ -500,7 +500,9 @@ static bool zarch_zui_gamepad_input(zui_t *zui,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zarch_zui_render_lay_root_recent(zui_t *zui, struct zui_tabbed *tabbed)
|
static int zarch_zui_render_lay_root_recent(
|
||||||
|
video_frame_info_t *video_info,
|
||||||
|
zui_t *zui, struct zui_tabbed *tabbed)
|
||||||
{
|
{
|
||||||
if (zarch_zui_tab(zui, tabbed, "Recent", 0))
|
if (zarch_zui_tab(zui, tabbed, "Recent", 0))
|
||||||
{
|
{
|
||||||
@ -524,7 +526,9 @@ static int zarch_zui_render_lay_root_recent(zui_t *zui, struct zui_tabbed *tabbe
|
|||||||
menu_entry_get_rich_label(i, rich_label, sizeof(rich_label));
|
menu_entry_get_rich_label(i, rich_label, sizeof(rich_label));
|
||||||
menu_entry_get_value(i, NULL, entry_value,sizeof(entry_value));
|
menu_entry_get_value(i, NULL, entry_value,sizeof(entry_value));
|
||||||
|
|
||||||
if (zarch_zui_list_item(zui, tabbed, 0,
|
if (zarch_zui_list_item(
|
||||||
|
video_info,
|
||||||
|
zui, tabbed, 0,
|
||||||
tabbed->tabline_size + j * ZUI_ITEM_SIZE_PX,
|
tabbed->tabline_size + j * ZUI_ITEM_SIZE_PX,
|
||||||
rich_label, i, entry_value, gamepad_index == (signed)i))
|
rich_label, i, entry_value, gamepad_index == (signed)i))
|
||||||
{
|
{
|
||||||
@ -563,7 +567,9 @@ static void zarch_zui_render_lay_root_load_set_new_path(zui_t *zui,
|
|||||||
zui->load_dlist = NULL;
|
zui->load_dlist = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zarch_zui_render_lay_root_load(zui_t *zui,
|
static int zarch_zui_render_lay_root_load(
|
||||||
|
video_frame_info_t *video_info,
|
||||||
|
zui_t *zui,
|
||||||
struct zui_tabbed *tabbed)
|
struct zui_tabbed *tabbed)
|
||||||
{
|
{
|
||||||
char parent_dir[PATH_MAX_LENGTH];
|
char parent_dir[PATH_MAX_LENGTH];
|
||||||
@ -605,7 +611,9 @@ static int zarch_zui_render_lay_root_load(zui_t *zui,
|
|||||||
fill_pathname_parent_dir(parent_dir,
|
fill_pathname_parent_dir(parent_dir,
|
||||||
zui->load_cwd, sizeof(parent_dir));
|
zui->load_cwd, sizeof(parent_dir));
|
||||||
if (!string_is_empty(parent_dir) &&
|
if (!string_is_empty(parent_dir) &&
|
||||||
zarch_zui_list_item(zui, tabbed, 0,
|
zarch_zui_list_item(
|
||||||
|
video_info,
|
||||||
|
zui, tabbed, 0,
|
||||||
tabbed->tabline_size + 73, " ..", 0, NULL, false /* TODO/FIXME */))
|
tabbed->tabline_size + 73, " ..", 0, NULL, false /* TODO/FIXME */))
|
||||||
{
|
{
|
||||||
zarch_zui_render_lay_root_load_set_new_path(zui, parent_dir);
|
zarch_zui_render_lay_root_load_set_new_path(zui, parent_dir);
|
||||||
@ -651,7 +659,9 @@ static int zarch_zui_render_lay_root_load(zui_t *zui,
|
|||||||
if (path_is_directory(path))
|
if (path_is_directory(path))
|
||||||
strncat(label, "/", sizeof(label)-1);
|
strncat(label, "/", sizeof(label)-1);
|
||||||
|
|
||||||
if (zarch_zui_list_item(zui, tabbed, 0,
|
if (zarch_zui_list_item(
|
||||||
|
video_info,
|
||||||
|
zui, tabbed, 0,
|
||||||
tabbed->tabline_size + 73 + j * ZUI_ITEM_SIZE_PX,
|
tabbed->tabline_size + 73 + j * ZUI_ITEM_SIZE_PX,
|
||||||
label, i, NULL, gamepad_index == (signed)(i-skip)))
|
label, i, NULL, gamepad_index == (signed)(i-skip)))
|
||||||
{
|
{
|
||||||
@ -709,7 +719,8 @@ static int zarch_zui_render_lay_root_downloads(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zarch_zui_render_lay_root(zui_t *zui)
|
static int zarch_zui_render_lay_root(video_frame_info_t *video_info,
|
||||||
|
zui_t *zui)
|
||||||
{
|
{
|
||||||
char item[PATH_MAX_LENGTH];
|
char item[PATH_MAX_LENGTH];
|
||||||
static struct zui_tabbed tabbed = {~0U};
|
static struct zui_tabbed tabbed = {~0U};
|
||||||
@ -719,9 +730,9 @@ static int zarch_zui_render_lay_root(zui_t *zui)
|
|||||||
tabbed.width = zui->width - 290 - 40;
|
tabbed.width = zui->width - 290 - 40;
|
||||||
zui->next_selection_set = false;
|
zui->next_selection_set = false;
|
||||||
|
|
||||||
if (zarch_zui_render_lay_root_recent(zui, &tabbed))
|
if (zarch_zui_render_lay_root_recent(video_info, zui, &tabbed))
|
||||||
return 0;
|
return 0;
|
||||||
if (zarch_zui_render_lay_root_load (zui, &tabbed))
|
if (zarch_zui_render_lay_root_load(video_info, zui, &tabbed))
|
||||||
return 0;
|
return 0;
|
||||||
if (zarch_zui_render_lay_root_collections(zui, &tabbed))
|
if (zarch_zui_render_lay_root_collections(zui, &tabbed))
|
||||||
return 0;
|
return 0;
|
||||||
@ -792,7 +803,8 @@ static void zarch_zui_draw_cursor(float x, float y)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zarch_zui_render_pick_core(zui_t *zui)
|
static int zarch_zui_render_pick_core(video_frame_info_t *video_info,
|
||||||
|
zui_t *zui)
|
||||||
{
|
{
|
||||||
static struct zui_tabbed tabbed = {~0U};
|
static struct zui_tabbed tabbed = {~0U};
|
||||||
unsigned i, j = 0;
|
unsigned i, j = 0;
|
||||||
@ -814,7 +826,9 @@ static int zarch_zui_render_pick_core(zui_t *zui)
|
|||||||
|
|
||||||
if (!zui->pick_supported)
|
if (!zui->pick_supported)
|
||||||
{
|
{
|
||||||
zarch_zui_list_item(zui, &tabbed, 0, ZUI_ITEM_SIZE_PX,
|
zarch_zui_list_item(
|
||||||
|
video_info,
|
||||||
|
zui, &tabbed, 0, ZUI_ITEM_SIZE_PX,
|
||||||
"Content unsupported", 0, NULL, false /* TODO/FIXME */);
|
"Content unsupported", 0, NULL, false /* TODO/FIXME */);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -828,7 +842,9 @@ static int zarch_zui_render_pick_core(zui_t *zui)
|
|||||||
if (j > 10)
|
if (j > 10)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (zarch_zui_list_item(zui, &tabbed, 0, ZUI_ITEM_SIZE_PX + j * ZUI_ITEM_SIZE_PX,
|
if (zarch_zui_list_item(
|
||||||
|
video_info,
|
||||||
|
zui, &tabbed, 0, ZUI_ITEM_SIZE_PX + j * ZUI_ITEM_SIZE_PX,
|
||||||
zui->pick_cores[i].display_name, i, NULL, false))
|
zui->pick_cores[i].display_name, i, NULL, false))
|
||||||
{
|
{
|
||||||
int ret = zarch_zui_load_content(zui, i);
|
int ret = zarch_zui_load_content(zui, i);
|
||||||
@ -846,7 +862,7 @@ static int zarch_zui_render_pick_core(zui_t *zui)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zarch_frame(void *data)
|
static void zarch_frame(void *data, video_frame_info_t *video_info)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
float coord_color[16];
|
float coord_color[16];
|
||||||
@ -862,7 +878,7 @@ static void zarch_frame(void *data)
|
|||||||
|
|
||||||
video_driver_get_size(&zui->width, &zui->height);
|
video_driver_get_size(&zui->width, &zui->height);
|
||||||
|
|
||||||
menu_display_set_viewport();
|
menu_display_set_viewport(video_info->width, video_info->height);
|
||||||
|
|
||||||
for (i = 0; i < 16; i++)
|
for (i = 0; i < 16; i++)
|
||||||
{
|
{
|
||||||
@ -899,7 +915,7 @@ static void zarch_frame(void *data)
|
|||||||
case LAY_HOME:
|
case LAY_HOME:
|
||||||
if (zarch_zui_render_sidebar(zui))
|
if (zarch_zui_render_sidebar(zui))
|
||||||
return;
|
return;
|
||||||
if (zarch_zui_render_lay_root(zui))
|
if (zarch_zui_render_lay_root(video_info, zui))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
case LAY_SETTINGS:
|
case LAY_SETTINGS:
|
||||||
@ -908,7 +924,7 @@ static void zarch_frame(void *data)
|
|||||||
case LAY_PICK_CORE:
|
case LAY_PICK_CORE:
|
||||||
if (zarch_zui_render_sidebar(zui))
|
if (zarch_zui_render_sidebar(zui))
|
||||||
return;
|
return;
|
||||||
if (zarch_zui_render_pick_core(zui))
|
if (zarch_zui_render_pick_core(video_info, zui))
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -967,7 +983,7 @@ static void zarch_frame(void *data)
|
|||||||
zui->rendering = false;
|
zui->rendering = false;
|
||||||
|
|
||||||
menu_display_font_flush_block((font_data_t*)zui->font);
|
menu_display_font_flush_block((font_data_t*)zui->font);
|
||||||
menu_display_unset_viewport();
|
menu_display_unset_viewport(video_info->width, video_info->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *zarch_init(void **userdata)
|
static void *zarch_init(void **userdata)
|
||||||
|
@ -397,17 +397,13 @@ bool menu_display_get_update_pending(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_display_set_viewport(void)
|
void menu_display_set_viewport(unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
video_driver_set_viewport(width, height, true, false);
|
video_driver_set_viewport(width, height, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_display_unset_viewport(void)
|
void menu_display_unset_viewport(unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
unsigned width, height;
|
|
||||||
video_driver_get_size(&width, &height);
|
|
||||||
video_driver_set_viewport(width, height, false, true);
|
video_driver_set_viewport(width, height, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,8 +227,8 @@ void menu_display_set_msg_force(bool state);
|
|||||||
bool menu_display_get_font_data_init(void);
|
bool menu_display_get_font_data_init(void);
|
||||||
void menu_display_set_font_data_init(bool state);
|
void menu_display_set_font_data_init(bool state);
|
||||||
bool menu_display_get_update_pending(void);
|
bool menu_display_get_update_pending(void);
|
||||||
void menu_display_set_viewport(void);
|
void menu_display_set_viewport(unsigned width, unsigned height);
|
||||||
void menu_display_unset_viewport(void);
|
void menu_display_unset_viewport(unsigned width, unsigned height);
|
||||||
bool menu_display_get_framebuffer_dirty_flag(void);
|
bool menu_display_get_framebuffer_dirty_flag(void);
|
||||||
void menu_display_set_framebuffer_dirty_flag(void);
|
void menu_display_set_framebuffer_dirty_flag(void);
|
||||||
void menu_display_unset_framebuffer_dirty_flag(void);
|
void menu_display_unset_framebuffer_dirty_flag(void);
|
||||||
|
@ -302,6 +302,15 @@ const char *menu_driver_ident(void)
|
|||||||
return menu_driver_ctx->ident;
|
return menu_driver_ctx->ident;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_driver_frame(video_frame_info_t *video_info)
|
||||||
|
{
|
||||||
|
if (!menu_driver_alive)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (menu_driver_ctx->frame)
|
||||||
|
menu_driver_ctx->frame(menu_userdata, video_info);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu_update_libretro_info:
|
* menu_update_libretro_info:
|
||||||
*
|
*
|
||||||
@ -484,12 +493,6 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
|
|
||||||
menu_driver_data->state = 0;
|
menu_driver_data->state = 0;
|
||||||
break;
|
break;
|
||||||
case RARCH_MENU_CTL_FRAME:
|
|
||||||
if (!menu_driver_alive)
|
|
||||||
return false;
|
|
||||||
if (menu_driver_ctx->frame)
|
|
||||||
menu_driver_ctx->frame(menu_userdata);
|
|
||||||
break;
|
|
||||||
case RARCH_MENU_CTL_SET_PREVENT_POPULATE:
|
case RARCH_MENU_CTL_SET_PREVENT_POPULATE:
|
||||||
menu_driver_prevent_populate = true;
|
menu_driver_prevent_populate = true;
|
||||||
break;
|
break;
|
||||||
@ -883,14 +886,17 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data)
|
|||||||
break;
|
break;
|
||||||
case RARCH_MENU_CTL_OSK_PTR_AT_POS:
|
case RARCH_MENU_CTL_OSK_PTR_AT_POS:
|
||||||
{
|
{
|
||||||
|
unsigned width = 0;
|
||||||
|
unsigned height = 0;
|
||||||
menu_ctx_pointer_t *point = (menu_ctx_pointer_t*)data;
|
menu_ctx_pointer_t *point = (menu_ctx_pointer_t*)data;
|
||||||
if (!menu_driver_ctx || !menu_driver_ctx->osk_ptr_at_pos)
|
if (!menu_driver_ctx || !menu_driver_ctx->osk_ptr_at_pos)
|
||||||
{
|
{
|
||||||
point->retcode = 0;
|
point->retcode = 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
video_driver_get_size(&width, &height);
|
||||||
point->retcode = menu_driver_ctx->osk_ptr_at_pos(menu_userdata,
|
point->retcode = menu_driver_ctx->osk_ptr_at_pos(menu_userdata,
|
||||||
point->x, point->y);
|
point->x, point->y, width, height);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RARCH_MENU_CTL_BIND_INIT:
|
case RARCH_MENU_CTL_BIND_INIT:
|
||||||
|
@ -99,7 +99,6 @@ enum rarch_menu_ctl_state
|
|||||||
RARCH_MENU_CTL_BLIT_RENDER,
|
RARCH_MENU_CTL_BLIT_RENDER,
|
||||||
RARCH_MENU_CTL_RENDER,
|
RARCH_MENU_CTL_RENDER,
|
||||||
RARCH_MENU_CTL_RENDER_MESSAGEBOX,
|
RARCH_MENU_CTL_RENDER_MESSAGEBOX,
|
||||||
RARCH_MENU_CTL_FRAME,
|
|
||||||
RARCH_MENU_CTL_SET_PREVENT_POPULATE,
|
RARCH_MENU_CTL_SET_PREVENT_POPULATE,
|
||||||
RARCH_MENU_CTL_UNSET_PREVENT_POPULATE,
|
RARCH_MENU_CTL_UNSET_PREVENT_POPULATE,
|
||||||
RARCH_MENU_CTL_IS_PREVENT_POPULATE,
|
RARCH_MENU_CTL_IS_PREVENT_POPULATE,
|
||||||
@ -238,7 +237,7 @@ typedef struct menu_ctx_driver
|
|||||||
void (*render_messagebox)(void *data, const char *msg);
|
void (*render_messagebox)(void *data, const char *msg);
|
||||||
int (*iterate)(void *data, void *userdata, enum menu_action action);
|
int (*iterate)(void *data, void *userdata, enum menu_action action);
|
||||||
void (*render)(void *data);
|
void (*render)(void *data);
|
||||||
void (*frame)(void *data);
|
void (*frame)(void *data, video_frame_info_t *video_info);
|
||||||
void* (*init)(void**);
|
void* (*init)(void**);
|
||||||
void (*free)(void*);
|
void (*free)(void*);
|
||||||
void (*context_reset)(void *data);
|
void (*context_reset)(void *data);
|
||||||
@ -277,7 +276,7 @@ typedef struct menu_ctx_driver
|
|||||||
menu_entry_t *entry, unsigned action);
|
menu_entry_t *entry, unsigned action);
|
||||||
void (*update_thumbnail_path)(void *data, unsigned i);
|
void (*update_thumbnail_path)(void *data, unsigned i);
|
||||||
void (*update_thumbnail_image)(void *data);
|
void (*update_thumbnail_image)(void *data);
|
||||||
int (*osk_ptr_at_pos)(void *data, int x, int y);
|
int (*osk_ptr_at_pos)(void *data, int x, int y, unsigned width, unsigned height);
|
||||||
void (*update_savestate_thumbnail_path)(void *data, unsigned i);
|
void (*update_savestate_thumbnail_path)(void *data, unsigned i);
|
||||||
void (*update_savestate_thumbnail_image)(void *data);
|
void (*update_savestate_thumbnail_image)(void *data);
|
||||||
} menu_ctx_driver_t;
|
} menu_ctx_driver_t;
|
||||||
@ -390,6 +389,8 @@ bool menu_driver_is_binding_state(void);
|
|||||||
|
|
||||||
void menu_driver_set_binding_state(bool on);
|
void menu_driver_set_binding_state(bool on);
|
||||||
|
|
||||||
|
void menu_driver_frame(video_frame_info_t *video_info);
|
||||||
|
|
||||||
extern menu_ctx_driver_t menu_ctx_xui;
|
extern menu_ctx_driver_t menu_ctx_xui;
|
||||||
extern menu_ctx_driver_t menu_ctx_rgui;
|
extern menu_ctx_driver_t menu_ctx_rgui;
|
||||||
extern menu_ctx_driver_t menu_ctx_mui;
|
extern menu_ctx_driver_t menu_ctx_mui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user