2016-10-25 18:18:31 +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
|
2016-10-25 18:18:31 +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_DEFINES__H
|
|
|
|
#define __VIDEO_DEFINES__H
|
|
|
|
|
|
|
|
#include <retro_common_api.h>
|
|
|
|
|
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
2021-10-20 13:57:34 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
TEXTURES = 8,
|
|
|
|
TEXTURESMASK = TEXTURES - 1
|
|
|
|
};
|
|
|
|
|
2016-10-25 18:18:31 +00:00
|
|
|
enum texture_filter_type
|
|
|
|
{
|
|
|
|
TEXTURE_FILTER_LINEAR = 0,
|
|
|
|
TEXTURE_FILTER_NEAREST,
|
|
|
|
TEXTURE_FILTER_MIPMAP_LINEAR,
|
|
|
|
TEXTURE_FILTER_MIPMAP_NEAREST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum aspect_ratio
|
|
|
|
{
|
|
|
|
ASPECT_RATIO_4_3 = 0,
|
|
|
|
ASPECT_RATIO_16_9,
|
|
|
|
ASPECT_RATIO_16_10,
|
|
|
|
ASPECT_RATIO_16_15,
|
2018-09-02 20:03:16 +00:00
|
|
|
ASPECT_RATIO_21_9,
|
2016-10-25 18:18:31 +00:00
|
|
|
ASPECT_RATIO_1_1,
|
|
|
|
ASPECT_RATIO_2_1,
|
|
|
|
ASPECT_RATIO_3_2,
|
|
|
|
ASPECT_RATIO_3_4,
|
|
|
|
ASPECT_RATIO_4_1,
|
|
|
|
ASPECT_RATIO_4_4,
|
|
|
|
ASPECT_RATIO_5_4,
|
|
|
|
ASPECT_RATIO_6_5,
|
|
|
|
ASPECT_RATIO_7_9,
|
|
|
|
ASPECT_RATIO_8_3,
|
|
|
|
ASPECT_RATIO_8_7,
|
|
|
|
ASPECT_RATIO_19_12,
|
|
|
|
ASPECT_RATIO_19_14,
|
|
|
|
ASPECT_RATIO_30_17,
|
|
|
|
ASPECT_RATIO_32_9,
|
|
|
|
ASPECT_RATIO_CONFIG,
|
|
|
|
ASPECT_RATIO_SQUARE,
|
|
|
|
ASPECT_RATIO_CORE,
|
|
|
|
ASPECT_RATIO_CUSTOM,
|
2021-07-07 13:37:36 +00:00
|
|
|
ASPECT_RATIO_FULL,
|
2016-10-25 18:18:31 +00:00
|
|
|
|
|
|
|
ASPECT_RATIO_END
|
|
|
|
};
|
|
|
|
|
|
|
|
enum rotation
|
|
|
|
{
|
|
|
|
ORIENTATION_NORMAL = 0,
|
|
|
|
ORIENTATION_VERTICAL,
|
|
|
|
ORIENTATION_FLIPPED,
|
|
|
|
ORIENTATION_FLIPPED_ROTATED,
|
|
|
|
ORIENTATION_END
|
|
|
|
};
|
|
|
|
|
2022-12-19 20:36:06 +00:00
|
|
|
enum video_rotation_type
|
|
|
|
{
|
|
|
|
VIDEO_ROTATION_NORMAL = 0,
|
|
|
|
VIDEO_ROTATION_90_DEG,
|
|
|
|
VIDEO_ROTATION_180_DEG,
|
|
|
|
VIDEO_ROTATION_270_DEG
|
|
|
|
};
|
|
|
|
|
2022-05-16 15:50:11 +00:00
|
|
|
enum autoswitch_refresh_rate
|
|
|
|
{
|
|
|
|
AUTOSWITCH_REFRESH_RATE_EXCLUSIVE_FULLSCREEN = 0,
|
|
|
|
AUTOSWITCH_REFRESH_RATE_WINDOWED_FULLSCREEN,
|
|
|
|
AUTOSWITCH_REFRESH_RATE_ALL_FULLSCREEN,
|
|
|
|
AUTOSWITCH_REFRESH_RATE_OFF,
|
|
|
|
AUTOSWITCH_REFRESH_RATE_LAST
|
|
|
|
};
|
|
|
|
|
2016-10-25 18:18:31 +00:00
|
|
|
enum rarch_display_type
|
|
|
|
{
|
|
|
|
/* Non-bindable types like consoles, KMS, VideoCore, etc. */
|
|
|
|
RARCH_DISPLAY_NONE = 0,
|
|
|
|
/* video_display => Display*, video_window => Window */
|
|
|
|
RARCH_DISPLAY_X11,
|
|
|
|
/* video_display => N/A, video_window => HWND */
|
|
|
|
RARCH_DISPLAY_WIN32,
|
2019-09-22 10:40:40 +00:00
|
|
|
RARCH_DISPLAY_WAYLAND,
|
2023-05-19 10:05:57 +00:00
|
|
|
RARCH_DISPLAY_OSX,
|
|
|
|
RARCH_DISPLAY_KMS
|
2016-10-25 18:18:31 +00:00
|
|
|
};
|
|
|
|
|
2018-03-23 16:43:49 +00:00
|
|
|
enum font_driver_render_api
|
|
|
|
{
|
|
|
|
FONT_DRIVER_RENDER_DONT_CARE,
|
|
|
|
FONT_DRIVER_RENDER_OPENGL_API,
|
2019-03-02 10:53:14 +00:00
|
|
|
FONT_DRIVER_RENDER_OPENGL_CORE_API,
|
2019-02-08 17:14:55 +00:00
|
|
|
FONT_DRIVER_RENDER_OPENGL1_API,
|
2018-03-23 16:43:49 +00:00
|
|
|
FONT_DRIVER_RENDER_D3D8_API,
|
|
|
|
FONT_DRIVER_RENDER_D3D9_API,
|
2018-04-21 01:27:41 +00:00
|
|
|
FONT_DRIVER_RENDER_D3D10_API,
|
2018-03-23 16:43:49 +00:00
|
|
|
FONT_DRIVER_RENDER_D3D11_API,
|
|
|
|
FONT_DRIVER_RENDER_D3D12_API,
|
2019-01-07 20:49:55 +00:00
|
|
|
FONT_DRIVER_RENDER_PS2,
|
2018-03-23 16:43:49 +00:00
|
|
|
FONT_DRIVER_RENDER_VITA2D,
|
|
|
|
FONT_DRIVER_RENDER_CTR,
|
|
|
|
FONT_DRIVER_RENDER_WIIU,
|
|
|
|
FONT_DRIVER_RENDER_VULKAN_API,
|
2018-06-21 04:29:53 +00:00
|
|
|
FONT_DRIVER_RENDER_METAL_API,
|
2018-03-23 16:43:49 +00:00
|
|
|
FONT_DRIVER_RENDER_CACA,
|
2018-07-12 20:55:08 +00:00
|
|
|
FONT_DRIVER_RENDER_SIXEL,
|
2019-08-23 13:22:22 +00:00
|
|
|
FONT_DRIVER_RENDER_NETWORK_VIDEO,
|
2018-03-23 16:43:49 +00:00
|
|
|
FONT_DRIVER_RENDER_GDI,
|
2018-09-12 19:44:53 +00:00
|
|
|
FONT_DRIVER_RENDER_VGA,
|
2022-03-27 01:51:33 +00:00
|
|
|
FONT_DRIVER_RENDER_SWITCH,
|
|
|
|
FONT_DRIVER_RENDER_RSX
|
2018-03-23 16:43:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum text_alignment
|
|
|
|
{
|
|
|
|
TEXT_ALIGN_LEFT = 0,
|
|
|
|
TEXT_ALIGN_RIGHT,
|
|
|
|
TEXT_ALIGN_CENTER
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifndef COLOR_ABGR
|
|
|
|
#define COLOR_ABGR(r, g, b, a) (((unsigned)(a) << 24) | ((b) << 16) | ((g) << 8) | ((r) << 0))
|
|
|
|
#endif
|
|
|
|
|
2021-07-07 13:37:36 +00:00
|
|
|
#define LAST_ASPECT_RATIO ASPECT_RATIO_FULL
|
2016-10-25 18:18:31 +00:00
|
|
|
|
|
|
|
/* ABGR color format defines */
|
|
|
|
|
|
|
|
#define WHITE 0xffffffffu
|
|
|
|
#define RED 0xff0000ffu
|
|
|
|
#define GREEN 0xff00ff00u
|
|
|
|
#define BLUE 0xffff0000u
|
|
|
|
#define YELLOW 0xff00ffffu
|
|
|
|
#define PURPLE 0xffff00ffu
|
|
|
|
#define CYAN 0xffffff00u
|
|
|
|
#define ORANGE 0xff0063ffu
|
|
|
|
#define SILVER 0xff8c848cu
|
|
|
|
#define LIGHTBLUE 0xFFFFE0E0U
|
|
|
|
#define LIGHTORANGE 0xFFE0EEFFu
|
|
|
|
|
|
|
|
#define FONT_COLOR_RGBA(r, g, b, a) (((unsigned)(r) << 24) | ((g) << 16) | ((b) << 8) | ((a) << 0))
|
|
|
|
#define FONT_COLOR_GET_RED(col) (((col) >> 24) & 0xff)
|
|
|
|
#define FONT_COLOR_GET_GREEN(col) (((col) >> 16) & 0xff)
|
|
|
|
#define FONT_COLOR_GET_BLUE(col) (((col) >> 8) & 0xff)
|
|
|
|
#define FONT_COLOR_GET_ALPHA(col) (((col) >> 0) & 0xff)
|
|
|
|
#define FONT_COLOR_ARGB_TO_RGBA(col) ( (((col) >> 24) & 0xff) | (((unsigned)(col) << 8) & 0xffffff00) )
|
|
|
|
|
2019-01-31 19:43:07 +00:00
|
|
|
typedef struct video_viewport
|
|
|
|
{
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
unsigned full_width;
|
|
|
|
unsigned full_height;
|
|
|
|
} video_viewport_t;
|
|
|
|
|
2019-05-05 14:32:28 +00:00
|
|
|
typedef struct gfx_ctx_flags
|
|
|
|
{
|
|
|
|
uint32_t flags;
|
|
|
|
} gfx_ctx_flags_t;
|
|
|
|
|
2020-01-22 09:52:20 +00:00
|
|
|
struct Size2D
|
|
|
|
{
|
|
|
|
unsigned width, height;
|
|
|
|
};
|
|
|
|
|
2021-10-20 13:57:34 +00:00
|
|
|
enum gfx_ctx_api
|
|
|
|
{
|
|
|
|
GFX_CTX_NONE = 0,
|
|
|
|
GFX_CTX_OPENGL_API,
|
|
|
|
GFX_CTX_OPENGL_ES_API,
|
|
|
|
GFX_CTX_DIRECT3D8_API,
|
|
|
|
GFX_CTX_DIRECT3D9_API,
|
|
|
|
GFX_CTX_DIRECT3D10_API,
|
|
|
|
GFX_CTX_DIRECT3D11_API,
|
|
|
|
GFX_CTX_DIRECT3D12_API,
|
|
|
|
GFX_CTX_OPENVG_API,
|
|
|
|
GFX_CTX_VULKAN_API,
|
|
|
|
GFX_CTX_METAL_API,
|
|
|
|
GFX_CTX_RSX_API
|
|
|
|
};
|
|
|
|
|
|
|
|
enum display_metric_types
|
|
|
|
{
|
|
|
|
DISPLAY_METRIC_NONE = 0,
|
|
|
|
DISPLAY_METRIC_MM_WIDTH,
|
|
|
|
DISPLAY_METRIC_MM_HEIGHT,
|
|
|
|
DISPLAY_METRIC_DPI,
|
|
|
|
DISPLAY_METRIC_PIXEL_WIDTH,
|
|
|
|
DISPLAY_METRIC_PIXEL_HEIGHT
|
|
|
|
};
|
|
|
|
|
|
|
|
enum display_flags
|
|
|
|
{
|
|
|
|
GFX_CTX_FLAGS_NONE = 0,
|
|
|
|
GFX_CTX_FLAGS_GL_CORE_CONTEXT,
|
|
|
|
GFX_CTX_FLAGS_MULTISAMPLING,
|
|
|
|
GFX_CTX_FLAGS_CUSTOMIZABLE_SWAPCHAIN_IMAGES,
|
2022-06-06 21:06:23 +00:00
|
|
|
GFX_CTX_FLAGS_CUSTOMIZABLE_FRAME_LATENCY,
|
2021-10-20 13:57:34 +00:00
|
|
|
GFX_CTX_FLAGS_HARD_SYNC,
|
|
|
|
GFX_CTX_FLAGS_BLACK_FRAME_INSERTION,
|
|
|
|
GFX_CTX_FLAGS_MENU_FRAME_FILTERING,
|
|
|
|
GFX_CTX_FLAGS_ADAPTIVE_VSYNC,
|
|
|
|
GFX_CTX_FLAGS_SHADERS_GLSL,
|
|
|
|
GFX_CTX_FLAGS_SHADERS_CG,
|
|
|
|
GFX_CTX_FLAGS_SHADERS_HLSL,
|
|
|
|
GFX_CTX_FLAGS_SHADERS_SLANG,
|
2021-12-26 03:56:44 +00:00
|
|
|
GFX_CTX_FLAGS_SCREENSHOTS_SUPPORTED,
|
2023-03-25 10:57:10 +00:00
|
|
|
GFX_CTX_FLAGS_OVERLAY_BEHIND_MENU_SUPPORTED,
|
|
|
|
GFX_CTX_FLAGS_CRT_SWITCHRES
|
2021-10-20 13:57:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum shader_uniform_type
|
|
|
|
{
|
|
|
|
UNIFORM_1F = 0,
|
|
|
|
UNIFORM_2F,
|
|
|
|
UNIFORM_3F,
|
|
|
|
UNIFORM_4F,
|
|
|
|
UNIFORM_1FV,
|
|
|
|
UNIFORM_2FV,
|
|
|
|
UNIFORM_3FV,
|
|
|
|
UNIFORM_4FV,
|
|
|
|
UNIFORM_1I
|
|
|
|
};
|
|
|
|
|
|
|
|
enum shader_program_type
|
|
|
|
{
|
|
|
|
SHADER_PROGRAM_VERTEX = 0,
|
|
|
|
SHADER_PROGRAM_FRAGMENT,
|
|
|
|
SHADER_PROGRAM_COMBINED
|
|
|
|
};
|
|
|
|
|
2023-05-07 19:13:44 +00:00
|
|
|
/* All coordinates and offsets are top-left oriented.
|
|
|
|
*
|
|
|
|
* This is a texture-atlas approach which allows text to
|
|
|
|
* be drawn in a single draw call.
|
|
|
|
*
|
|
|
|
* It is up to the code using this interface to actually
|
|
|
|
* generate proper vertex buffers and upload the atlas texture to GPU. */
|
|
|
|
|
|
|
|
struct font_glyph
|
|
|
|
{
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
|
|
|
|
/* Texel coordinate offset for top-left pixel of this glyph. */
|
|
|
|
unsigned atlas_offset_x;
|
|
|
|
unsigned atlas_offset_y;
|
|
|
|
|
|
|
|
/* When drawing this glyph, apply an offset to
|
|
|
|
* current X/Y draw coordinate. */
|
|
|
|
int draw_offset_x;
|
|
|
|
int draw_offset_y;
|
|
|
|
|
|
|
|
/* Advance X/Y draw coordinates after drawing this glyph. */
|
|
|
|
int advance_x;
|
|
|
|
int advance_y;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct font_atlas
|
|
|
|
{
|
|
|
|
uint8_t *buffer; /* Alpha channel. */
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
|
|
|
bool dirty;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct font_params
|
|
|
|
{
|
|
|
|
/* Drop shadow offset.
|
|
|
|
* If both are 0, no drop shadow will be rendered. */
|
|
|
|
int drop_x, drop_y;
|
|
|
|
|
|
|
|
/* ABGR. Use the macros. */
|
|
|
|
uint32_t color;
|
|
|
|
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float scale;
|
|
|
|
/* Drop shadow color multiplier. */
|
|
|
|
float drop_mod;
|
|
|
|
/* Drop shadow alpha */
|
|
|
|
float drop_alpha;
|
|
|
|
|
|
|
|
enum text_alignment text_align;
|
|
|
|
|
|
|
|
bool full_screen;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct font_line_metrics
|
|
|
|
{
|
|
|
|
float height;
|
|
|
|
float ascender;
|
|
|
|
float descender;
|
|
|
|
};
|
|
|
|
|
2016-10-25 18:18:31 +00:00
|
|
|
RETRO_END_DECLS
|
|
|
|
|
|
|
|
#endif
|