2015-04-21 12:44:14 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2016-01-10 03:06:50 +00:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2016-10-27 15:47:10 +00:00
|
|
|
* Copyright (C) 2016 - Brad Parker
|
2015-04-21 12:44:14 +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 __MENU_DISPLAY_H__
|
|
|
|
#define __MENU_DISPLAY_H__
|
|
|
|
|
2015-06-13 21:07:27 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2016-06-03 03:49:46 +00:00
|
|
|
#include <boolean.h>
|
|
|
|
#include <retro_common_api.h>
|
2016-01-08 07:42:29 +00:00
|
|
|
#include <gfx/math/matrix_4x4.h>
|
|
|
|
|
2016-06-11 19:11:57 +00:00
|
|
|
#include "../file_path_special.h"
|
2015-11-08 00:30:07 +00:00
|
|
|
#include "../gfx/video_context_driver.h"
|
2016-03-05 06:27:48 +00:00
|
|
|
#include "../gfx/video_coord_array.h"
|
2015-11-02 21:06:51 +00:00
|
|
|
|
2016-06-03 03:49:46 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-04-21 12:44:14 +00:00
|
|
|
|
2016-07-10 14:08:38 +00:00
|
|
|
enum materialui_color_theme
|
|
|
|
{
|
2016-07-10 14:11:03 +00:00
|
|
|
MATERIALUI_THEME_BLUE = 0,
|
2016-07-10 19:23:57 +00:00
|
|
|
MATERIALUI_THEME_BLUE_GREY,
|
2016-07-10 22:48:23 +00:00
|
|
|
MATERIALUI_THEME_DARK_BLUE,
|
2016-07-10 15:06:43 +00:00
|
|
|
MATERIALUI_THEME_GREEN,
|
|
|
|
MATERIALUI_THEME_RED,
|
2016-07-10 22:55:07 +00:00
|
|
|
MATERIALUI_THEME_YELLOW,
|
2016-07-14 16:29:05 +00:00
|
|
|
MATERIALUI_THEME_NVIDIA_SHIELD,
|
|
|
|
MATERIALUI_THEME_LAST
|
2016-07-10 14:08:38 +00:00
|
|
|
};
|
|
|
|
|
2016-07-14 16:19:59 +00:00
|
|
|
enum xmb_color_theme
|
|
|
|
{
|
|
|
|
XMB_THEME_LEGACY_RED = 0,
|
|
|
|
XMB_THEME_DARK_PURPLE,
|
|
|
|
XMB_THEME_MIDNIGHT_BLUE,
|
|
|
|
XMB_THEME_GOLDEN,
|
|
|
|
XMB_THEME_ELECTRIC_BLUE,
|
|
|
|
XMB_THEME_APPLE_GREEN,
|
|
|
|
XMB_THEME_UNDERSEA,
|
|
|
|
XMB_THEME_VOLCANIC_RED,
|
2016-07-14 16:29:05 +00:00
|
|
|
XMB_THEME_DARK,
|
|
|
|
XMB_THEME_WALLPAPER,
|
|
|
|
XMB_THEME_LAST
|
2016-07-14 16:19:59 +00:00
|
|
|
};
|
|
|
|
|
2016-07-14 19:24:33 +00:00
|
|
|
enum xmb_icon_theme
|
|
|
|
{
|
|
|
|
XMB_ICON_THEME_MONOCHROME = 0,
|
|
|
|
XMB_ICON_THEME_FLATUI,
|
|
|
|
XMB_ICON_THEME_RETROACTIVE,
|
|
|
|
XMB_ICON_THEME_PIXEL,
|
|
|
|
XMB_ICON_THEME_CUSTOM
|
|
|
|
};
|
|
|
|
|
2016-07-14 16:40:57 +00:00
|
|
|
enum xmb_shader_pipeline
|
|
|
|
{
|
|
|
|
XMB_SHADER_PIPELINE_WALLPAPER = 0,
|
|
|
|
XMB_SHADER_PIPELINE_SIMPLE_RIBBON,
|
|
|
|
XMB_SHADER_PIPELINE_RIBBON,
|
|
|
|
XMB_SHADER_PIPELINE_LAST
|
|
|
|
};
|
|
|
|
|
2015-10-24 05:51:33 +00:00
|
|
|
enum menu_display_prim_type
|
|
|
|
{
|
|
|
|
MENU_DISPLAY_PRIM_NONE = 0,
|
|
|
|
MENU_DISPLAY_PRIM_TRIANGLESTRIP,
|
|
|
|
MENU_DISPLAY_PRIM_TRIANGLES
|
|
|
|
};
|
|
|
|
|
2015-11-08 00:30:07 +00:00
|
|
|
enum menu_display_driver_type
|
|
|
|
{
|
|
|
|
MENU_VIDEO_DRIVER_GENERIC = 0,
|
|
|
|
MENU_VIDEO_DRIVER_OPENGL,
|
2016-02-16 19:24:00 +00:00
|
|
|
MENU_VIDEO_DRIVER_VULKAN,
|
2016-08-23 00:49:53 +00:00
|
|
|
MENU_VIDEO_DRIVER_DIRECT3D,
|
2016-09-29 19:14:12 +00:00
|
|
|
MENU_VIDEO_DRIVER_VITA2D,
|
|
|
|
MENU_VIDEO_DRIVER_CTR
|
2015-11-08 00:30:07 +00:00
|
|
|
};
|
|
|
|
|
2016-02-09 02:04:23 +00:00
|
|
|
typedef struct menu_display_ctx_clearcolor
|
|
|
|
{
|
|
|
|
float r;
|
|
|
|
float g;
|
|
|
|
float b;
|
|
|
|
float a;
|
|
|
|
} menu_display_ctx_clearcolor_t;
|
|
|
|
|
2016-02-09 03:12:33 +00:00
|
|
|
typedef struct menu_display_ctx_draw
|
|
|
|
{
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
unsigned width;
|
|
|
|
unsigned height;
|
2016-05-10 00:32:49 +00:00
|
|
|
struct video_coords *coords;
|
2016-02-09 03:12:33 +00:00
|
|
|
void *matrix_data;
|
|
|
|
uintptr_t texture;
|
|
|
|
enum menu_display_prim_type prim_type;
|
|
|
|
float *color;
|
|
|
|
const float *vertex;
|
|
|
|
const float *tex_coord;
|
|
|
|
size_t vertex_count;
|
2016-04-24 20:56:28 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned id;
|
2016-05-08 09:11:28 +00:00
|
|
|
const void *backend_data;
|
2016-04-24 20:56:28 +00:00
|
|
|
} pipeline;
|
2016-02-09 03:12:33 +00:00
|
|
|
} menu_display_ctx_draw_t;
|
|
|
|
|
|
|
|
typedef struct menu_display_ctx_rotate_draw
|
|
|
|
{
|
|
|
|
math_matrix_4x4 *matrix;
|
|
|
|
float rotation;
|
|
|
|
float scale_x;
|
|
|
|
float scale_y;
|
|
|
|
float scale_z;
|
|
|
|
bool scale_enable;
|
|
|
|
} menu_display_ctx_rotate_draw_t;
|
|
|
|
|
2016-02-09 03:49:47 +00:00
|
|
|
typedef struct menu_display_ctx_coord_draw
|
|
|
|
{
|
|
|
|
const float *ptr;
|
|
|
|
} menu_display_ctx_coord_draw_t;
|
|
|
|
|
2016-02-09 04:03:13 +00:00
|
|
|
typedef struct menu_display_ctx_datetime
|
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
size_t len;
|
|
|
|
unsigned time_mode;
|
|
|
|
} menu_display_ctx_datetime_t;
|
2015-04-26 16:08:17 +00:00
|
|
|
|
2016-02-09 14:55:31 +00:00
|
|
|
typedef struct menu_display_ctx_driver
|
|
|
|
{
|
2016-02-09 15:11:37 +00:00
|
|
|
void (*draw)(void *data);
|
2016-04-25 11:56:12 +00:00
|
|
|
void (*draw_pipeline)(void *data);
|
2016-04-19 06:50:35 +00:00
|
|
|
void (*viewport)(void *data);
|
2016-02-09 14:55:31 +00:00
|
|
|
void (*blend_begin)(void);
|
|
|
|
void (*blend_end)(void);
|
|
|
|
void (*restore_clear_color)(void);
|
2016-04-15 02:20:57 +00:00
|
|
|
void (*clear_color)(menu_display_ctx_clearcolor_t *clearcolor);
|
2016-02-09 14:55:31 +00:00
|
|
|
void *(*get_default_mvp)(void);
|
2016-04-15 01:31:59 +00:00
|
|
|
const float *(*get_default_vertices)(void);
|
|
|
|
const float *(*get_default_tex_coords)(void);
|
2016-02-09 14:55:31 +00:00
|
|
|
bool (*font_init_first)(
|
2016-02-09 15:11:37 +00:00
|
|
|
void **font_handle, void *video_data,
|
|
|
|
const char *font_path, float font_size);
|
2016-02-09 14:55:31 +00:00
|
|
|
enum menu_display_driver_type type;
|
|
|
|
const char *ident;
|
|
|
|
} menu_display_ctx_driver_t;
|
|
|
|
|
|
|
|
typedef struct menu_display_ctx_font
|
|
|
|
{
|
|
|
|
const char *path;
|
|
|
|
float size;
|
|
|
|
} menu_display_ctx_font_t;
|
|
|
|
|
2016-03-05 07:40:28 +00:00
|
|
|
typedef uintptr_t menu_texture_item;
|
|
|
|
|
2016-09-05 15:35:27 +00:00
|
|
|
enum menu_toggle_reason
|
|
|
|
{
|
|
|
|
MENU_TOGGLE_REASON_NONE = 0,
|
|
|
|
MENU_TOGGLE_REASON_USER,
|
|
|
|
MENU_TOGGLE_REASON_MESSAGE
|
|
|
|
};
|
|
|
|
|
|
|
|
enum menu_toggle_reason menu_display_toggle_get_reason(void);
|
|
|
|
void menu_display_toggle_set_reason(enum menu_toggle_reason reason);
|
|
|
|
|
2016-05-08 10:33:28 +00:00
|
|
|
void menu_display_blend_begin(void);
|
|
|
|
void menu_display_blend_end(void);
|
|
|
|
|
2016-10-18 23:36:54 +00:00
|
|
|
void menu_display_font_free(font_data_t *font);
|
|
|
|
font_data_t *menu_display_font_main_init(menu_display_ctx_font_t *font);
|
|
|
|
void menu_display_font_bind_block(font_data_t *font, void *block);
|
|
|
|
bool menu_display_font_flush_block(font_data_t *font);
|
2016-05-08 10:33:28 +00:00
|
|
|
|
|
|
|
void menu_display_framebuffer_deinit(void);
|
|
|
|
|
|
|
|
void menu_display_deinit(void);
|
|
|
|
bool menu_display_init(void);
|
|
|
|
|
|
|
|
void menu_display_coords_array_reset(void);
|
2016-05-10 00:32:49 +00:00
|
|
|
video_coord_array_t *menu_display_get_coords_array(void);
|
2016-05-08 10:33:28 +00:00
|
|
|
const uint8_t *menu_display_get_font_framebuffer(void);
|
|
|
|
void menu_display_set_font_framebuffer(const uint8_t *buffer);
|
|
|
|
bool menu_display_libretro_running(void);
|
|
|
|
bool menu_display_libretro(void);
|
|
|
|
|
|
|
|
void menu_display_set_width(unsigned width);
|
|
|
|
unsigned menu_display_get_width(void);
|
|
|
|
void menu_display_set_height(unsigned height);
|
|
|
|
unsigned menu_display_get_height(void);
|
|
|
|
void menu_display_set_header_height(unsigned height);
|
|
|
|
unsigned menu_display_get_header_height(void);
|
|
|
|
size_t menu_display_get_framebuffer_pitch(void);
|
|
|
|
void menu_display_set_framebuffer_pitch(size_t pitch);
|
|
|
|
|
|
|
|
bool menu_display_get_msg_force(void);
|
|
|
|
void menu_display_set_msg_force(bool state);
|
|
|
|
bool menu_display_get_font_data_init(void);
|
|
|
|
void menu_display_set_font_data_init(bool state);
|
|
|
|
bool menu_display_get_update_pending(void);
|
|
|
|
void menu_display_set_viewport(void);
|
|
|
|
void menu_display_unset_viewport(void);
|
|
|
|
bool menu_display_get_framebuffer_dirty_flag(void);
|
|
|
|
void menu_display_set_framebuffer_dirty_flag(void);
|
|
|
|
void menu_display_unset_framebuffer_dirty_flag(void);
|
|
|
|
float menu_display_get_dpi(void);
|
|
|
|
bool menu_display_init_first_driver(void);
|
|
|
|
bool menu_display_restore_clear_color(void);
|
|
|
|
void menu_display_clear_color(menu_display_ctx_clearcolor_t *color);
|
|
|
|
void menu_display_draw(menu_display_ctx_draw_t *draw);
|
|
|
|
|
|
|
|
void menu_display_draw_pipeline(menu_display_ctx_draw_t *draw);
|
|
|
|
void menu_display_draw_bg(menu_display_ctx_draw_t *draw);
|
|
|
|
void menu_display_draw_gradient(menu_display_ctx_draw_t *draw);
|
2016-10-25 06:11:37 +00:00
|
|
|
void menu_display_draw_quad(int x, int y, unsigned w, unsigned h,
|
|
|
|
unsigned width, unsigned height,
|
|
|
|
float *color);
|
2016-05-08 10:33:28 +00:00
|
|
|
void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw);
|
|
|
|
bool menu_display_get_tex_coords(menu_display_ctx_coord_draw_t *draw);
|
|
|
|
|
|
|
|
void menu_display_timedate(menu_display_ctx_datetime_t *datetime);
|
2015-06-08 12:57:46 +00:00
|
|
|
|
2016-02-08 23:59:42 +00:00
|
|
|
void menu_display_handle_wallpaper_upload(void *task_data,
|
|
|
|
void *user_data, const char *err);
|
2015-11-23 03:17:27 +00:00
|
|
|
|
2016-05-21 18:47:49 +00:00
|
|
|
void menu_display_handle_thumbnail_upload(void *task_data,
|
|
|
|
void *user_data, const char *err);
|
|
|
|
|
2016-09-05 15:35:27 +00:00
|
|
|
void menu_display_push_quad(
|
2016-04-19 05:04:00 +00:00
|
|
|
unsigned width, unsigned height,
|
|
|
|
const float *colors, int x1, int y1,
|
2016-04-19 04:57:53 +00:00
|
|
|
int x2, int y2);
|
|
|
|
|
2016-04-19 05:17:17 +00:00
|
|
|
void menu_display_snow(int width, int height);
|
2016-04-19 04:57:53 +00:00
|
|
|
|
2016-04-19 05:41:05 +00:00
|
|
|
void menu_display_allocate_white_texture(void);
|
|
|
|
|
|
|
|
void menu_display_draw_cursor(
|
|
|
|
float *color, float cursor_size, uintptr_t texture,
|
|
|
|
float x, float y, unsigned width, unsigned height);
|
|
|
|
|
2016-10-18 23:36:54 +00:00
|
|
|
void menu_display_draw_text(const font_data_t *font, const char *msg, int width, int height,
|
2016-04-20 04:56:19 +00:00
|
|
|
struct font_params *params);
|
|
|
|
|
2016-07-09 14:33:55 +00:00
|
|
|
bool menu_display_shader_pipeline_active(void);
|
|
|
|
|
2016-04-21 02:34:02 +00:00
|
|
|
void menu_display_set_alpha(float *color, float alpha_value);
|
|
|
|
|
2016-10-18 23:36:54 +00:00
|
|
|
font_data_t *menu_display_font(enum application_special_type type, float font_size);
|
2016-06-11 19:11:57 +00:00
|
|
|
|
2016-07-21 01:00:00 +00:00
|
|
|
void menu_display_reset_textures_list(const char *texture_path, const char *iconpath,
|
|
|
|
uintptr_t *item);
|
|
|
|
|
2016-04-18 00:56:42 +00:00
|
|
|
extern uintptr_t menu_display_white_texture;
|
2016-04-11 21:30:25 +00:00
|
|
|
|
2015-11-08 00:30:07 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_gl;
|
2016-02-16 19:24:00 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_vulkan;
|
2015-11-08 22:18:43 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_d3d;
|
2016-08-23 00:49:53 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_vita2d;
|
2016-09-29 19:14:12 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_ctr;
|
2015-11-08 00:30:07 +00:00
|
|
|
extern menu_display_ctx_driver_t menu_display_ctx_null;
|
2015-11-02 19:41:42 +00:00
|
|
|
|
2016-06-03 03:49:46 +00:00
|
|
|
RETRO_END_DECLS
|
2015-04-21 12:44:14 +00:00
|
|
|
|
|
|
|
#endif
|