mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Create video_driver_build_info
This commit is contained in:
parent
6ed4de0d79
commit
8c9e0405fb
@ -296,18 +296,8 @@ static void gl_set_viewport_wrapper(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
video_frame_info_t video_info;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
video_info.refresh_rate = settings->video.refresh_rate;
|
||||
video_info.black_frame_insertion =
|
||||
settings->video.black_frame_insertion;
|
||||
video_info.hard_sync = settings->video.hard_sync;
|
||||
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||
video_info.fps_show = settings->fps_show;
|
||||
video_info.scale_integer = settings->video.scale_integer;
|
||||
video_info.aspect_ratio_idx = settings->video.aspect_ratio_idx;
|
||||
video_info.post_filter_record = settings->video.post_filter_record;
|
||||
video_info.max_swapchain_images = settings->video.max_swapchain_images;
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
gl_set_viewport(data, video_info,
|
||||
viewport_width, viewport_height, force_full, allow_rotate);
|
||||
|
@ -528,16 +528,7 @@ static void *xv_init(const video_info_t *video,
|
||||
|
||||
XMapWindow(g_x11_dpy, g_x11_win);
|
||||
|
||||
video_info.refresh_rate = settings->video.refresh_rate;
|
||||
video_info.black_frame_insertion =
|
||||
settings->video.black_frame_insertion;
|
||||
video_info.hard_sync = settings->video.hard_sync;
|
||||
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||
video_info.fps_show = settings->fps_show;
|
||||
video_info.scale_integer = settings->video.scale_integer;
|
||||
video_info.aspect_ratio_idx = settings->video.aspect_ratio_idx;
|
||||
video_info.post_filter_record = settings->video.post_filter_record;
|
||||
video_info.max_swapchain_images = settings->video.max_swapchain_images;
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
if (video_monitor_get_fps(video_info, buf, sizeof(buf), NULL, 0))
|
||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
||||
|
@ -234,7 +234,7 @@ error:
|
||||
static void sdl_ctx_get_video_size(void *data,
|
||||
unsigned *width, unsigned *height)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||
|
||||
if (!sdl)
|
||||
|
@ -438,23 +438,11 @@ bool video_context_driver_get_ident(gfx_ctx_ident_t *ident)
|
||||
bool video_context_driver_set_video_mode(gfx_ctx_mode_t *mode_info)
|
||||
{
|
||||
video_frame_info_t video_info;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!current_video_context || !current_video_context->set_video_mode)
|
||||
return false;
|
||||
|
||||
video_info.refresh_rate = settings->video.refresh_rate;
|
||||
video_info.black_frame_insertion =
|
||||
settings->video.black_frame_insertion;
|
||||
video_info.hard_sync = settings->video.hard_sync;
|
||||
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||
video_info.fps_show = settings->fps_show;
|
||||
video_info.scale_integer = settings->video.scale_integer;
|
||||
video_info.aspect_ratio_idx = settings->video.aspect_ratio_idx;
|
||||
video_info.post_filter_record = settings->video.post_filter_record;
|
||||
video_info.max_swapchain_images = settings->video.max_swapchain_images;
|
||||
video_info.windowed_fullscreen = settings->video.windowed_fullscreen;
|
||||
video_info.monitor_index = settings->video.monitor_index;
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
if (!current_video_context->set_video_mode(
|
||||
video_context_data, video_info, mode_info->width,
|
||||
|
@ -687,7 +687,7 @@ static bool init_video(void)
|
||||
{
|
||||
if(settings->video.window_x || settings->video.window_y)
|
||||
{
|
||||
width = settings->video.window_x;
|
||||
width = settings->video.window_x;
|
||||
height = settings->video.window_y;
|
||||
}
|
||||
else
|
||||
@ -2186,6 +2186,27 @@ bool video_driver_texture_unload(uintptr_t *id)
|
||||
return true;
|
||||
}
|
||||
|
||||
void video_driver_build_info(video_frame_info_t *video_info)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!video_info)
|
||||
return;
|
||||
|
||||
video_info->refresh_rate = settings->video.refresh_rate;
|
||||
video_info->black_frame_insertion =
|
||||
settings->video.black_frame_insertion;
|
||||
video_info->hard_sync = settings->video.hard_sync;
|
||||
video_info->hard_sync_frames = settings->video.hard_sync_frames;
|
||||
video_info->fps_show = settings->fps_show;
|
||||
video_info->scale_integer = settings->video.scale_integer;
|
||||
video_info->aspect_ratio_idx = settings->video.aspect_ratio_idx;
|
||||
video_info->post_filter_record = settings->video.post_filter_record;
|
||||
video_info->max_swapchain_images = settings->video.max_swapchain_images;
|
||||
video_info->windowed_fullscreen = settings->video.windowed_fullscreen;
|
||||
video_info->monitor_index = settings->video.monitor_index;
|
||||
}
|
||||
|
||||
/**
|
||||
* video_driver_translate_coord_viewport:
|
||||
* @mouse_x : Pointer X coordinate.
|
||||
|
@ -536,6 +536,8 @@ bool video_driver_texture_load(void *data,
|
||||
|
||||
bool video_driver_texture_unload(uintptr_t *id);
|
||||
|
||||
void video_driver_build_info(video_frame_info_t *video_info);
|
||||
|
||||
void video_driver_reinit(void);
|
||||
|
||||
extern video_driver_t video_gl;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "font_driver.h"
|
||||
#include "video_shader_driver.h"
|
||||
|
||||
#include "../configuration.h"
|
||||
#include "../performance_counters.h"
|
||||
#include "../runloop.h"
|
||||
#include "../verbosity.h"
|
||||
@ -614,18 +613,7 @@ static void video_thread_loop(void *data)
|
||||
if (thr->driver && thr->driver->frame)
|
||||
{
|
||||
video_frame_info_t video_info;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
video_info.refresh_rate = settings->video.refresh_rate;
|
||||
video_info.black_frame_insertion =
|
||||
settings->video.black_frame_insertion;
|
||||
video_info.hard_sync = settings->video.hard_sync;
|
||||
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||
video_info.fps_show = settings->fps_show;
|
||||
video_info.scale_integer = settings->video.scale_integer;
|
||||
video_info.aspect_ratio_idx = settings->video.aspect_ratio_idx;
|
||||
video_info.post_filter_record = settings->video.post_filter_record;
|
||||
video_info.max_swapchain_images = settings->video.max_swapchain_images;
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
ret = thr->driver->frame(thr->driver_data,
|
||||
thr->frame.buffer, thr->frame.width, thr->frame.height,
|
||||
|
Loading…
x
Reference in New Issue
Block a user