2015-01-12 17:26:46 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 12:40:32 +00:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2015-08-30 18:04:52 +00:00
|
|
|
*
|
2015-01-12 17:26:46 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIDEO_DRIVER__H
|
|
|
|
#define __VIDEO_DRIVER__H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <sys/types.h>
|
2015-12-05 20:23:34 +00:00
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 03:43:49 +00:00
|
|
|
#include <retro_common_api.h>
|
2015-12-05 20:23:34 +00:00
|
|
|
|
2016-09-12 16:34:57 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_OVERLAY
|
|
|
|
#include "../input/input_overlay.h"
|
|
|
|
#endif
|
|
|
|
|
2016-10-25 18:18:31 +00:00
|
|
|
#include "video_defines.h"
|
2015-01-13 21:11:26 +00:00
|
|
|
#include "video_filter.h"
|
|
|
|
#include "video_shader_parse.h"
|
2015-01-12 17:26:46 +00:00
|
|
|
|
2015-01-12 17:39:27 +00:00
|
|
|
#include "../input/input_driver.h"
|
2015-01-12 17:26:46 +00:00
|
|
|
|
2016-06-03 03:43:49 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-01-12 17:26:46 +00:00
|
|
|
|
|
|
|
typedef struct video_info
|
|
|
|
{
|
2017-01-26 01:49:42 +00:00
|
|
|
/* Width of window.
|
|
|
|
* If fullscreen mode is requested,
|
|
|
|
* a width of 0 means the resolution of the
|
|
|
|
* desktop should be used. */
|
2015-01-12 17:26:46 +00:00
|
|
|
unsigned width;
|
2017-01-26 01:49:42 +00:00
|
|
|
|
|
|
|
/* Height of window.
|
|
|
|
* If fullscreen mode is requested,
|
|
|
|
* a height of 0 means the resolutiof the desktop should be used.
|
|
|
|
*/
|
2015-01-12 17:26:46 +00:00
|
|
|
unsigned height;
|
2016-09-07 11:55:46 +00:00
|
|
|
|
|
|
|
/* Launch in fullscreen mode instead of windowed mode. */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool fullscreen;
|
2016-09-07 12:12:40 +00:00
|
|
|
|
|
|
|
/* Start with V-Sync enabled. */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool vsync;
|
2016-09-07 12:12:40 +00:00
|
|
|
|
2017-01-26 01:49:42 +00:00
|
|
|
/* If true, the output image should have the aspect ratio
|
|
|
|
* as set in aspect_ratio. */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool force_aspect;
|
2016-09-07 11:55:46 +00:00
|
|
|
|
2017-01-10 17:08:05 +00:00
|
|
|
unsigned swap_interval;
|
|
|
|
|
|
|
|
bool font_enable;
|
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
#ifdef GEKKO
|
|
|
|
/* TODO - we can't really have driver system-specific
|
|
|
|
* variables in here. There should be some
|
|
|
|
* kind of publicly accessible driver implementation
|
|
|
|
* video struct for specific things like this.
|
|
|
|
*/
|
2016-09-07 11:53:46 +00:00
|
|
|
|
|
|
|
/* Wii-specific settings. Ignored for everything else. */
|
2015-01-12 17:26:46 +00:00
|
|
|
unsigned viwidth;
|
|
|
|
bool vfilter;
|
2016-09-07 11:53:46 +00:00
|
|
|
#endif
|
2016-09-07 11:55:46 +00:00
|
|
|
|
2016-09-07 11:53:46 +00:00
|
|
|
/* If true, applies bilinear filtering to the image,
|
|
|
|
* otherwise nearest filtering. */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool smooth;
|
2016-09-07 11:55:46 +00:00
|
|
|
|
2017-01-26 01:49:42 +00:00
|
|
|
/*
|
|
|
|
* input_scale defines the maximum size of the picture that will
|
|
|
|
* ever be used with the frame callback.
|
|
|
|
*
|
|
|
|
* The maximum resolution is a multiple of 256x256 size (RARCH_SCALE_BASE),
|
|
|
|
* so an input scale of 2 means you should allocate a texture or of 512x512.
|
|
|
|
*
|
|
|
|
* Maximum input size: RARCH_SCALE_BASE * input_scale
|
|
|
|
*/
|
2015-01-12 17:26:46 +00:00
|
|
|
unsigned input_scale;
|
2016-09-07 11:55:46 +00:00
|
|
|
|
2017-01-26 01:49:42 +00:00
|
|
|
/* Use 32bit RGBA rather than native RGB565/XBGR1555.
|
|
|
|
*
|
|
|
|
* XRGB1555 format is 16-bit and has byte ordering: 0RRRRRGGGGGBBBBB,
|
|
|
|
* in native endian.
|
|
|
|
*
|
|
|
|
* ARGB8888 is AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB, native endian.
|
|
|
|
* Alpha channel should be disregarded.
|
|
|
|
* */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool rgb32;
|
2016-09-07 12:28:15 +00:00
|
|
|
|
|
|
|
#ifndef RARCH_INTERNAL
|
|
|
|
uintptr_t parent;
|
|
|
|
#endif
|
2015-01-12 17:26:46 +00:00
|
|
|
} video_info_t;
|
|
|
|
|
2017-01-09 13:25:59 +00:00
|
|
|
typedef struct video_frame_info
|
|
|
|
{
|
2017-01-20 13:25:00 +00:00
|
|
|
float menu_wallpaper_opacity;
|
2017-01-09 13:25:59 +00:00
|
|
|
float refresh_rate;
|
2017-01-13 15:52:07 +00:00
|
|
|
bool shared_context;
|
2017-01-09 13:25:59 +00:00
|
|
|
bool black_frame_insertion;
|
|
|
|
bool hard_sync;
|
|
|
|
unsigned hard_sync_frames;
|
|
|
|
bool fps_show;
|
2017-01-09 14:14:16 +00:00
|
|
|
bool scale_integer;
|
|
|
|
unsigned aspect_ratio_idx;
|
2017-01-09 14:46:40 +00:00
|
|
|
bool post_filter_record;
|
2017-01-09 13:59:15 +00:00
|
|
|
unsigned max_swapchain_images;
|
2017-01-11 05:44:41 +00:00
|
|
|
bool windowed_fullscreen;
|
2017-01-17 22:54:13 +00:00
|
|
|
bool fullscreen;
|
2017-01-11 05:44:41 +00:00
|
|
|
unsigned monitor_index;
|
2017-01-14 12:55:49 +00:00
|
|
|
bool font_enable;
|
2017-01-18 16:41:27 +00:00
|
|
|
char fps_text[128];
|
2017-01-18 21:30:16 +00:00
|
|
|
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
2017-01-19 15:30:40 +00:00
|
|
|
|
|
|
|
float font_msg_pos_x;
|
|
|
|
float font_msg_pos_y;
|
|
|
|
float font_msg_color_r;
|
|
|
|
float font_msg_color_g;
|
|
|
|
float font_msg_color_b;
|
2017-01-20 13:04:50 +00:00
|
|
|
bool use_rgba;
|
2017-01-20 13:25:00 +00:00
|
|
|
bool libretro_running;
|
2017-01-20 14:33:47 +00:00
|
|
|
|
2017-01-20 14:38:20 +00:00
|
|
|
float menu_header_opacity;
|
|
|
|
float menu_footer_opacity;
|
|
|
|
|
2017-01-20 14:33:47 +00:00
|
|
|
bool xmb_shadows_enable;
|
|
|
|
float xmb_alpha_factor;
|
|
|
|
unsigned xmb_theme;
|
|
|
|
unsigned xmb_color_theme;
|
|
|
|
unsigned menu_shader_pipeline;
|
|
|
|
|
2017-01-20 14:38:20 +00:00
|
|
|
unsigned materialui_color_theme;
|
|
|
|
|
2017-01-20 14:33:47 +00:00
|
|
|
bool battery_level_enable;
|
|
|
|
bool timedate_enable;
|
2017-01-22 01:04:58 +00:00
|
|
|
bool runloop_is_slowmotion;
|
|
|
|
bool runloop_is_idle;
|
|
|
|
bool runloop_is_paused;
|
2017-01-25 15:57:22 +00:00
|
|
|
bool is_perfcnt_enable;
|
2017-01-22 16:30:32 +00:00
|
|
|
|
|
|
|
bool menu_is_alive;
|
2017-01-09 13:25:59 +00:00
|
|
|
} video_frame_info_t;
|
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
/* Optionally implemented interface to poke more
|
|
|
|
* deeply into video driver. */
|
|
|
|
|
|
|
|
typedef struct video_poke_interface
|
|
|
|
{
|
2015-12-20 21:38:18 +00:00
|
|
|
uintptr_t (*load_texture)(void *video_data, void *data,
|
2015-12-20 19:52:23 +00:00
|
|
|
bool threaded, enum texture_filter_type filter_type);
|
2016-02-16 19:24:00 +00:00
|
|
|
void (*unload_texture)(void *data, uintptr_t id);
|
2016-10-25 18:18:31 +00:00
|
|
|
void (*set_video_mode)(void *data, unsigned width,
|
|
|
|
unsigned height, bool fullscreen);
|
2015-01-12 17:26:46 +00:00
|
|
|
void (*set_filtering)(void *data, unsigned index, bool smooth);
|
2016-02-06 20:41:26 +00:00
|
|
|
void (*get_video_output_size)(void *data,
|
|
|
|
unsigned *width, unsigned *height);
|
2016-09-07 11:55:46 +00:00
|
|
|
|
|
|
|
/* Move index to previous resolution */
|
2015-02-24 20:36:23 +00:00
|
|
|
void (*get_video_output_prev)(void *data);
|
2016-09-07 11:55:46 +00:00
|
|
|
|
|
|
|
/* Move index to next resolution */
|
2015-02-24 20:36:23 +00:00
|
|
|
void (*get_video_output_next)(void *data);
|
2016-09-07 11:55:46 +00:00
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
uintptr_t (*get_current_framebuffer)(void *data);
|
2015-02-08 17:39:12 +00:00
|
|
|
retro_proc_address_t (*get_proc_address)(void *data, const char *sym);
|
2015-01-12 17:26:46 +00:00
|
|
|
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
|
|
|
|
void (*apply_state_changes)(void *data);
|
|
|
|
|
|
|
|
#ifdef HAVE_MENU
|
|
|
|
/* Update texture. */
|
|
|
|
void (*set_texture_frame)(void *data, const void *frame, bool rgb32,
|
|
|
|
unsigned width, unsigned height, float alpha);
|
2015-07-26 22:08:14 +00:00
|
|
|
#endif
|
2015-01-12 17:26:46 +00:00
|
|
|
/* Enable or disable rendering. */
|
|
|
|
void (*set_texture_enable)(void *data, bool enable, bool full_screen);
|
|
|
|
void (*set_osd_msg)(void *data, const char *msg,
|
2017-01-19 15:30:40 +00:00
|
|
|
const void *params, void *font);
|
2015-01-12 17:26:46 +00:00
|
|
|
|
|
|
|
void (*show_mouse)(void *data, bool state);
|
|
|
|
void (*grab_mouse_toggle)(void *data);
|
|
|
|
|
2015-01-19 20:24:08 +00:00
|
|
|
struct video_shader *(*get_current_shader)(void *data);
|
2016-02-06 20:41:26 +00:00
|
|
|
bool (*get_current_software_framebuffer)(void *data,
|
|
|
|
struct retro_framebuffer *framebuffer);
|
2016-02-16 19:24:00 +00:00
|
|
|
bool (*get_hw_render_interface)(void *data,
|
|
|
|
const struct retro_hw_render_interface **iface);
|
2015-01-12 17:26:46 +00:00
|
|
|
} video_poke_interface_t;
|
|
|
|
|
2015-11-21 12:01:23 +00:00
|
|
|
typedef struct video_viewport
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
unsigned full_width;
|
|
|
|
unsigned full_height;
|
|
|
|
} video_viewport_t;
|
|
|
|
|
2016-02-06 20:41:26 +00:00
|
|
|
/* msg is for showing a message on the screen
|
|
|
|
* along with the video frame. */
|
|
|
|
typedef bool (*video_driver_frame_t)(void *data,
|
|
|
|
const void *frame, unsigned width,
|
|
|
|
unsigned height, uint64_t frame_count,
|
2017-01-18 16:41:27 +00:00
|
|
|
unsigned pitch, const char *msg, video_frame_info_t *video_info);
|
2015-12-07 20:16:15 +00:00
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
typedef struct video_driver
|
|
|
|
{
|
|
|
|
/* Should the video driver act as an input driver as well?
|
2015-08-30 18:04:52 +00:00
|
|
|
* The video initialization might preinitialize an input driver
|
|
|
|
* to override the settings in case the video driver relies on
|
2015-01-12 17:26:46 +00:00
|
|
|
* input driver for event handling. */
|
2016-02-06 20:41:26 +00:00
|
|
|
void *(*init)(const video_info_t *video,
|
|
|
|
const input_driver_t **input,
|
2015-08-30 18:04:52 +00:00
|
|
|
void **input_data);
|
2015-01-12 17:26:46 +00:00
|
|
|
|
2017-01-26 01:49:42 +00:00
|
|
|
/* Updates frame on the screen.
|
|
|
|
* Frame can be either XRGB1555, RGB565 or ARGB32 format
|
|
|
|
* depending on rgb32 setting in video_info_t.
|
|
|
|
* Pitch is the distance in bytes between two scanlines in memory.
|
|
|
|
*
|
|
|
|
* When msg is non-NULL,
|
|
|
|
* it's a message that should be displayed to the user. */
|
2015-12-07 20:16:15 +00:00
|
|
|
video_driver_frame_t frame;
|
2015-01-12 17:26:46 +00:00
|
|
|
|
2017-01-26 01:49:42 +00:00
|
|
|
/* Should we care about syncing to vblank? Fast forwarding.
|
|
|
|
*
|
|
|
|
* Requests nonblocking operation.
|
|
|
|
*
|
|
|
|
* True = VSync is turned off.
|
|
|
|
* False = VSync is turned on.
|
|
|
|
* */
|
2015-01-12 17:26:46 +00:00
|
|
|
void (*set_nonblock_state)(void *data, bool toggle);
|
|
|
|
|
|
|
|
/* Is the window still active? */
|
|
|
|
bool (*alive)(void *data);
|
|
|
|
|
|
|
|
/* Does the window have focus? */
|
|
|
|
bool (*focus)(void *data);
|
|
|
|
|
2015-01-18 21:32:14 +00:00
|
|
|
/* Should the screensaver be suppressed? */
|
|
|
|
bool (*suppress_screensaver)(void *data, bool enable);
|
|
|
|
|
|
|
|
/* Does the graphics context support windowed mode? */
|
2015-01-12 17:26:46 +00:00
|
|
|
bool (*has_windowed)(void *data);
|
|
|
|
|
|
|
|
/* Sets shader. Might not be implemented. Will be moved to
|
|
|
|
* poke_interface later. */
|
|
|
|
bool (*set_shader)(void *data, enum rarch_shader_type type,
|
|
|
|
const char *path);
|
|
|
|
|
|
|
|
/* Frees driver. */
|
|
|
|
void (*free)(void *data);
|
|
|
|
|
|
|
|
/* Human-readable identifier. */
|
|
|
|
const char *ident;
|
|
|
|
|
2015-04-26 17:46:59 +00:00
|
|
|
void (*set_viewport)(void *data, unsigned width, unsigned height,
|
|
|
|
bool force_full, bool allow_rotate);
|
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
void (*set_rotation)(void *data, unsigned rotation);
|
2015-02-14 04:52:05 +00:00
|
|
|
void (*viewport_info)(void *data, struct video_viewport *vp);
|
2015-01-12 17:26:46 +00:00
|
|
|
|
|
|
|
/* Reads out in BGR byte order (24bpp). */
|
2017-01-22 17:17:48 +00:00
|
|
|
bool (*read_viewport)(void *data, uint8_t *buffer, bool is_idle);
|
2015-01-12 17:26:46 +00:00
|
|
|
|
2015-03-16 08:33:16 +00:00
|
|
|
/* Returns a pointer to a newly allocated buffer that can
|
|
|
|
* (and must) be passed to free() by the caller, containing a
|
|
|
|
* copy of the current raw frame in the active pixel format
|
|
|
|
* and sets width, height and pitch to the correct values. */
|
|
|
|
void* (*read_frame_raw)(void *data, unsigned *width,
|
|
|
|
unsigned *height, size_t *pitch);
|
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2016-02-06 20:41:26 +00:00
|
|
|
void (*overlay_interface)(void *data,
|
|
|
|
const video_overlay_interface_t **iface);
|
2015-01-12 17:26:46 +00:00
|
|
|
#endif
|
|
|
|
void (*poke_interface)(void *data, const video_poke_interface_t **iface);
|
|
|
|
unsigned (*wrap_type_to_enum)(enum gfx_wrap_type type);
|
|
|
|
} video_driver_t;
|
|
|
|
|
2015-11-21 12:01:23 +00:00
|
|
|
struct aspect_ratio_elem
|
|
|
|
{
|
|
|
|
char name[64];
|
|
|
|
float value;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
|
|
|
|
|
2016-11-21 12:17:28 +00:00
|
|
|
#define video_driver_is_alive() ((current_video) ? current_video->alive(video_driver_data) : true)
|
|
|
|
|
|
|
|
#define video_driver_is_focused() (current_video->focus(video_driver_data))
|
|
|
|
|
|
|
|
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)
|
|
|
|
#define video_driver_has_windowed() (false)
|
|
|
|
#else
|
2017-01-19 01:50:56 +00:00
|
|
|
#define video_driver_has_windowed() (current_video->has_windowed && current_video->has_windowed(video_driver_data))
|
2016-11-21 12:17:28 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define video_driver_cached_frame_has_valid_framebuffer() (frame_cache_data ? (frame_cache_data == RETRO_HW_FRAME_BUFFER_VALID) : false)
|
|
|
|
|
2016-05-08 12:00:51 +00:00
|
|
|
void video_driver_destroy(void);
|
|
|
|
void video_driver_set_cached_frame_ptr(const void *data);
|
|
|
|
void video_driver_set_stub_frame(void);
|
|
|
|
void video_driver_unset_stub_frame(void);
|
|
|
|
bool video_driver_supports_recording(void);
|
|
|
|
bool video_driver_supports_viewport_read(void);
|
|
|
|
bool video_driver_supports_read_frame_raw(void);
|
|
|
|
void video_driver_set_viewport_config(void);
|
|
|
|
void video_driver_set_viewport_square_pixel(void);
|
|
|
|
void video_driver_set_viewport_core(void);
|
|
|
|
void video_driver_reset_custom_viewport(void);
|
|
|
|
void video_driver_set_rgba(void);
|
|
|
|
void video_driver_unset_rgba(void);
|
|
|
|
bool video_driver_supports_rgba(void);
|
|
|
|
bool video_driver_get_next_video_out(void);
|
|
|
|
bool video_driver_get_prev_video_out(void);
|
2016-12-22 22:36:11 +00:00
|
|
|
bool video_driver_init(void);
|
2016-05-08 12:00:51 +00:00
|
|
|
void video_driver_destroy_data(void);
|
2017-01-25 14:22:12 +00:00
|
|
|
void video_driver_free(void);
|
|
|
|
void video_driver_free_hw_context(void);
|
2016-05-08 12:00:51 +00:00
|
|
|
void video_driver_monitor_reset(void);
|
|
|
|
void video_driver_set_aspect_ratio(void);
|
|
|
|
void video_driver_show_mouse(void);
|
|
|
|
void video_driver_hide_mouse(void);
|
|
|
|
void video_driver_set_nonblock_state(bool toggle);
|
|
|
|
bool video_driver_find_driver(void);
|
|
|
|
void video_driver_apply_state_changes(void);
|
2017-01-22 17:17:48 +00:00
|
|
|
bool video_driver_read_viewport(uint8_t *buffer, bool is_idle);
|
2016-10-24 22:42:14 +00:00
|
|
|
bool video_driver_cached_frame(void);
|
2016-05-08 12:00:51 +00:00
|
|
|
bool video_driver_frame_filter_alive(void);
|
|
|
|
bool video_driver_frame_filter_is_32bit(void);
|
|
|
|
void video_driver_default_settings(void);
|
|
|
|
void video_driver_load_settings(config_file_t *conf);
|
|
|
|
void video_driver_save_settings(config_file_t *conf);
|
|
|
|
void video_driver_set_own_driver(void);
|
|
|
|
void video_driver_unset_own_driver(void);
|
|
|
|
bool video_driver_owns_driver(void);
|
|
|
|
bool video_driver_is_hw_context(void);
|
|
|
|
struct retro_hw_render_callback *video_driver_get_hw_context(void);
|
2016-10-25 18:18:31 +00:00
|
|
|
const struct retro_hw_render_context_negotiation_interface
|
|
|
|
*video_driver_get_context_negotiation_interface(void);
|
|
|
|
void video_driver_set_context_negotiation_interface(const struct
|
|
|
|
retro_hw_render_context_negotiation_interface *iface);
|
2016-05-08 12:00:51 +00:00
|
|
|
bool video_driver_is_video_cache_context(void);
|
|
|
|
void video_driver_set_video_cache_context_ack(void);
|
|
|
|
bool video_driver_is_video_cache_context_ack(void);
|
|
|
|
void video_driver_set_active(void);
|
|
|
|
bool video_driver_is_active(void);
|
|
|
|
bool video_driver_gpu_record_init(unsigned size);
|
|
|
|
void video_driver_gpu_record_deinit(void);
|
2016-10-25 18:18:31 +00:00
|
|
|
bool video_driver_get_current_software_framebuffer(struct
|
|
|
|
retro_framebuffer *fb);
|
|
|
|
bool video_driver_get_hw_render_interface(const struct
|
|
|
|
retro_hw_render_interface **iface);
|
2016-05-08 12:00:51 +00:00
|
|
|
bool video_driver_get_viewport_info(struct video_viewport *viewport);
|
|
|
|
void video_driver_set_title_buf(void);
|
|
|
|
void video_driver_monitor_adjust_system_rates(void);
|
2017-01-05 20:53:55 +00:00
|
|
|
bool video_driver_is_threaded(void);
|
2015-11-20 14:08:27 +00:00
|
|
|
|
2015-01-12 17:26:46 +00:00
|
|
|
/**
|
|
|
|
* video_driver_find_handle:
|
|
|
|
* @index : index of driver to get handle to.
|
|
|
|
*
|
|
|
|
* Returns: handle to video driver at index. Can be NULL
|
|
|
|
* if nothing found.
|
|
|
|
**/
|
|
|
|
const void *video_driver_find_handle(int index);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* video_driver_find_ident:
|
|
|
|
* @index : index of driver to get handle to.
|
|
|
|
*
|
2016-02-06 20:41:26 +00:00
|
|
|
* Returns: Human-readable identifier of video driver at index.
|
|
|
|
* Can be NULL if nothing found.
|
2015-01-12 17:26:46 +00:00
|
|
|
**/
|
|
|
|
const char *video_driver_find_ident(int index);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* config_get_video_driver_options:
|
|
|
|
*
|
|
|
|
* Get an enumerated list of all video driver names, separated by '|'.
|
|
|
|
*
|
|
|
|
* Returns: string listing of all video driver names, separated by '|'.
|
|
|
|
**/
|
|
|
|
const char* config_get_video_driver_options(void);
|
|
|
|
|
2015-01-12 19:20:58 +00:00
|
|
|
/**
|
2015-03-21 22:46:49 +00:00
|
|
|
* video_driver_get_ptr:
|
2015-01-12 19:20:58 +00:00
|
|
|
*
|
2015-08-30 18:04:52 +00:00
|
|
|
* Use this if you need the real video driver
|
2015-01-12 19:20:58 +00:00
|
|
|
* and driver data pointers.
|
|
|
|
*
|
|
|
|
* Returns: video driver's userdata.
|
|
|
|
**/
|
2015-11-23 15:06:09 +00:00
|
|
|
void *video_driver_get_ptr(bool force_nonthreaded_data);
|
2015-01-12 19:20:58 +00:00
|
|
|
|
2015-01-19 03:19:30 +00:00
|
|
|
/**
|
|
|
|
* video_driver_get_current_framebuffer:
|
|
|
|
*
|
|
|
|
* Gets pointer to current hardware renderer framebuffer object.
|
|
|
|
* Used by RETRO_ENVIRONMENT_SET_HW_RENDER.
|
|
|
|
*
|
|
|
|
* Returns: pointer to hardware framebuffer object, otherwise 0.
|
|
|
|
**/
|
|
|
|
uintptr_t video_driver_get_current_framebuffer(void);
|
|
|
|
|
|
|
|
retro_proc_address_t video_driver_get_proc_address(const char *sym);
|
|
|
|
|
2015-02-10 16:20:02 +00:00
|
|
|
bool video_driver_set_shader(enum rarch_shader_type type,
|
|
|
|
const char *shader);
|
|
|
|
|
2015-03-22 09:38:26 +00:00
|
|
|
bool video_driver_set_rotation(unsigned rotation);
|
|
|
|
|
2015-11-21 07:39:46 +00:00
|
|
|
bool video_driver_set_video_mode(unsigned width,
|
2015-03-22 17:38:11 +00:00
|
|
|
unsigned height, bool fullscreen);
|
|
|
|
|
|
|
|
bool video_driver_get_video_output_size(
|
|
|
|
unsigned *width, unsigned *height);
|
|
|
|
|
2015-03-22 17:48:24 +00:00
|
|
|
void video_driver_set_osd_msg(const char *msg,
|
2017-01-19 15:30:40 +00:00
|
|
|
const void *params, void *font);
|
2015-03-22 17:48:24 +00:00
|
|
|
|
2015-03-22 17:59:16 +00:00
|
|
|
void video_driver_set_texture_enable(bool enable, bool full_screen);
|
|
|
|
|
2015-03-22 18:15:34 +00:00
|
|
|
void video_driver_set_texture_frame(const void *frame, bool rgb32,
|
|
|
|
unsigned width, unsigned height, float alpha);
|
|
|
|
|
2015-03-23 03:32:12 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2016-02-06 20:41:26 +00:00
|
|
|
bool video_driver_overlay_interface(
|
|
|
|
const video_overlay_interface_t **iface);
|
2015-03-23 03:32:12 +00:00
|
|
|
#endif
|
2015-03-22 22:44:58 +00:00
|
|
|
|
2015-03-22 22:52:01 +00:00
|
|
|
void * video_driver_read_frame_raw(unsigned *width,
|
|
|
|
unsigned *height, size_t *pitch);
|
|
|
|
|
2015-03-22 23:39:42 +00:00
|
|
|
void video_driver_set_filtering(unsigned index, bool smooth);
|
|
|
|
|
2015-04-26 14:46:56 +00:00
|
|
|
const char *video_driver_get_ident(void);
|
|
|
|
|
2015-04-26 17:46:59 +00:00
|
|
|
bool video_driver_set_viewport(unsigned width, unsigned height,
|
|
|
|
bool force_fullscreen, bool allow_rotate);
|
|
|
|
|
2015-05-19 22:29:46 +00:00
|
|
|
void video_driver_get_size(unsigned *width, unsigned *height);
|
|
|
|
|
2015-11-23 11:54:15 +00:00
|
|
|
void video_driver_set_size(unsigned *width, unsigned *height);
|
2015-05-19 23:39:35 +00:00
|
|
|
|
2016-11-06 13:18:29 +00:00
|
|
|
void video_driver_unset_video_cache_context_ack(void);
|
|
|
|
|
2015-05-20 16:24:45 +00:00
|
|
|
float video_driver_get_aspect_ratio(void);
|
|
|
|
|
|
|
|
void video_driver_set_aspect_ratio_value(float value);
|
|
|
|
|
2015-05-20 18:49:52 +00:00
|
|
|
rarch_softfilter_t *video_driver_frame_filter_get_ptr(void);
|
|
|
|
|
2015-05-20 18:59:12 +00:00
|
|
|
enum retro_pixel_format video_driver_get_pixel_format(void);
|
|
|
|
|
|
|
|
void video_driver_set_pixel_format(enum retro_pixel_format fmt);
|
|
|
|
|
2015-05-20 19:13:25 +00:00
|
|
|
void video_driver_cached_frame_set(const void *data, unsigned width,
|
|
|
|
unsigned height, size_t pitch);
|
|
|
|
|
2015-06-17 12:29:09 +00:00
|
|
|
void video_driver_cached_frame_get(const void **data, unsigned *width,
|
2015-05-20 19:29:23 +00:00
|
|
|
unsigned *height, size_t *pitch);
|
|
|
|
|
2015-11-21 15:32:22 +00:00
|
|
|
void video_driver_menu_settings(void **list_data, void *list_info_data,
|
|
|
|
void *group_data, void *subgroup_data, const char *parent_group);
|
2015-11-21 10:22:34 +00:00
|
|
|
|
2015-11-21 12:01:23 +00:00
|
|
|
/**
|
|
|
|
* video_viewport_get_scaled_integer:
|
|
|
|
* @vp : Viewport handle
|
|
|
|
* @width : Width.
|
|
|
|
* @height : Height.
|
|
|
|
* @aspect_ratio : Aspect ratio (in float).
|
|
|
|
* @keep_aspect : Preserve aspect ratio?
|
|
|
|
*
|
|
|
|
* Gets viewport scaling dimensions based on
|
|
|
|
* scaled integer aspect ratio.
|
|
|
|
**/
|
|
|
|
void video_viewport_get_scaled_integer(struct video_viewport *vp,
|
|
|
|
unsigned width, unsigned height,
|
|
|
|
float aspect_ratio, bool keep_aspect);
|
|
|
|
|
|
|
|
struct retro_system_av_info *video_viewport_get_system_av_info(void);
|
|
|
|
|
|
|
|
struct video_viewport *video_viewport_get_custom(void);
|
|
|
|
|
2015-11-22 12:32:46 +00:00
|
|
|
/**
|
|
|
|
* video_monitor_set_refresh_rate:
|
|
|
|
* @hz : New refresh rate for monitor.
|
|
|
|
*
|
|
|
|
* Sets monitor refresh rate to new value.
|
|
|
|
**/
|
|
|
|
void video_monitor_set_refresh_rate(float hz);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* video_monitor_fps_statistics
|
|
|
|
* @refresh_rate : Monitor refresh rate.
|
|
|
|
* @deviation : Deviation from measured refresh rate.
|
|
|
|
* @sample_points : Amount of sampled points.
|
|
|
|
*
|
|
|
|
* Gets the monitor FPS statistics based on the current
|
|
|
|
* runtime.
|
|
|
|
*
|
|
|
|
* Returns: true (1) on success.
|
|
|
|
* false (0) if:
|
|
|
|
* a) threaded video mode is enabled
|
|
|
|
* b) less than 2 frame time samples.
|
|
|
|
* c) FPS monitor enable is off.
|
|
|
|
**/
|
|
|
|
bool video_monitor_fps_statistics(double *refresh_rate,
|
|
|
|
double *deviation, unsigned *sample_points);
|
|
|
|
|
2015-11-23 12:02:07 +00:00
|
|
|
unsigned video_pixel_get_alignment(unsigned pitch);
|
|
|
|
|
2015-11-23 21:14:39 +00:00
|
|
|
const video_poke_interface_t *video_driver_get_poke(void);
|
|
|
|
|
2015-11-24 00:26:59 +00:00
|
|
|
/**
|
2015-12-03 23:26:09 +00:00
|
|
|
* video_driver_frame:
|
2015-11-24 00:26:59 +00:00
|
|
|
* @data : pointer to data of the video frame.
|
|
|
|
* @width : width of the video frame.
|
|
|
|
* @height : height of the video frame.
|
|
|
|
* @pitch : pitch of the video frame.
|
|
|
|
*
|
|
|
|
* Video frame render callback function.
|
|
|
|
**/
|
2015-12-03 23:26:09 +00:00
|
|
|
void video_driver_frame(const void *data, unsigned width,
|
2015-11-24 00:26:59 +00:00
|
|
|
unsigned height, size_t pitch);
|
|
|
|
|
2016-12-07 07:07:11 +00:00
|
|
|
#define video_driver_translate_coord_viewport_wrap(vp, mouse_x, mouse_y, res_x, res_y, res_screen_x, res_screen_y) \
|
|
|
|
(video_driver_get_viewport_info(vp) ? video_driver_translate_coord_viewport(vp, mouse_x, mouse_y, res_x, res_y, res_screen_x, res_screen_y) : false)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* video_driver_translate_coord_viewport:
|
|
|
|
* @mouse_x : Pointer X coordinate.
|
|
|
|
* @mouse_y : Pointer Y coordinate.
|
|
|
|
* @res_x : Scaled X coordinate.
|
|
|
|
* @res_y : Scaled Y coordinate.
|
|
|
|
* @res_screen_x : Scaled screen X coordinate.
|
|
|
|
* @res_screen_y : Scaled screen Y coordinate.
|
|
|
|
*
|
|
|
|
* Translates pointer [X,Y] coordinates into scaled screen
|
|
|
|
* coordinates based on viewport info.
|
|
|
|
*
|
|
|
|
* Returns: true (1) if successful, false if video driver doesn't support
|
|
|
|
* viewport info.
|
|
|
|
**/
|
|
|
|
bool video_driver_translate_coord_viewport(
|
|
|
|
void *data,
|
|
|
|
int mouse_x, int mouse_y,
|
|
|
|
int16_t *res_x, int16_t *res_y, int16_t *res_screen_x,
|
|
|
|
int16_t *res_screen_y);
|
|
|
|
|
2015-11-29 00:12:49 +00:00
|
|
|
uintptr_t video_driver_display_get(void);
|
|
|
|
|
|
|
|
enum rarch_display_type video_driver_display_type_get(void);
|
|
|
|
|
|
|
|
uintptr_t video_driver_window_get(void);
|
|
|
|
|
|
|
|
void video_driver_display_type_set(enum rarch_display_type type);
|
|
|
|
|
|
|
|
void video_driver_display_set(uintptr_t idx);
|
|
|
|
|
|
|
|
void video_driver_window_set(uintptr_t idx);
|
|
|
|
|
2015-12-20 19:52:23 +00:00
|
|
|
bool video_driver_texture_load(void *data,
|
|
|
|
enum texture_filter_type filter_type,
|
2016-02-16 19:24:00 +00:00
|
|
|
uintptr_t *id);
|
2015-12-20 19:52:23 +00:00
|
|
|
|
|
|
|
bool video_driver_texture_unload(uintptr_t *id);
|
|
|
|
|
2017-01-13 15:09:32 +00:00
|
|
|
void video_driver_build_info(video_frame_info_t *video_info);
|
|
|
|
|
2016-11-06 13:18:29 +00:00
|
|
|
void video_driver_reinit(void);
|
|
|
|
|
2017-01-19 05:33:52 +00:00
|
|
|
void video_driver_get_window_title(char *buf, unsigned len);
|
|
|
|
|
2017-01-25 14:30:51 +00:00
|
|
|
void video_driver_get_record_status(
|
|
|
|
bool *has_gpu_record,
|
|
|
|
uint8_t **gpu_buf);
|
|
|
|
|
2017-01-25 03:42:19 +00:00
|
|
|
void video_driver_get_status(uint64_t *frame_count, bool * is_alive,
|
|
|
|
bool *is_focused);
|
2017-01-25 03:39:21 +00:00
|
|
|
|
2015-11-21 12:01:23 +00:00
|
|
|
extern video_driver_t video_gl;
|
2016-02-16 19:24:00 +00:00
|
|
|
extern video_driver_t video_vulkan;
|
2015-11-21 12:01:23 +00:00
|
|
|
extern video_driver_t video_psp1;
|
|
|
|
extern video_driver_t video_vita2d;
|
|
|
|
extern video_driver_t video_ctr;
|
|
|
|
extern video_driver_t video_d3d;
|
|
|
|
extern video_driver_t video_gx;
|
2016-10-27 00:34:10 +00:00
|
|
|
extern video_driver_t video_wiiu;
|
2015-11-21 12:01:23 +00:00
|
|
|
extern video_driver_t video_xenon360;
|
|
|
|
extern video_driver_t video_xvideo;
|
|
|
|
extern video_driver_t video_xdk_d3d;
|
|
|
|
extern video_driver_t video_sdl;
|
|
|
|
extern video_driver_t video_sdl2;
|
|
|
|
extern video_driver_t video_vg;
|
|
|
|
extern video_driver_t video_omap;
|
|
|
|
extern video_driver_t video_exynos;
|
|
|
|
extern video_driver_t video_dispmanx;
|
|
|
|
extern video_driver_t video_sunxi;
|
2016-07-03 08:37:07 +00:00
|
|
|
extern video_driver_t video_drm;
|
2015-11-21 12:01:23 +00:00
|
|
|
extern video_driver_t video_xshm;
|
2016-12-01 17:13:36 +00:00
|
|
|
extern video_driver_t video_caca;
|
2017-01-04 07:07:19 +00:00
|
|
|
extern video_driver_t video_gdi;
|
2017-01-21 22:41:20 +00:00
|
|
|
extern video_driver_t video_vga;
|
2015-11-21 12:01:23 +00:00
|
|
|
extern video_driver_t video_null;
|
|
|
|
|
2016-11-21 12:23:36 +00:00
|
|
|
extern const void *frame_cache_data;
|
|
|
|
|
2016-11-21 12:17:28 +00:00
|
|
|
extern void *video_driver_data;
|
|
|
|
extern video_driver_t *current_video;
|
|
|
|
|
2016-06-03 03:43:49 +00:00
|
|
|
RETRO_END_DECLS
|
2015-01-12 17:26:46 +00:00
|
|
|
|
|
|
|
#endif
|