mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
(menu display driver) Get rid of remaining pointer grabbing
This commit is contained in:
parent
407d7e2c4e
commit
35f1c9ba33
@ -343,7 +343,7 @@ static void mui_draw_icon(
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
coords.vertices = 4;
|
||||
coords.vertex = NULL;
|
||||
|
@ -699,7 +699,7 @@ static void xmb_draw_thumbnail(
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
coords.vertices = 4;
|
||||
coords.vertex = NULL;
|
||||
@ -2548,7 +2548,7 @@ static int xmb_draw_item(
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
xmb_draw_icon(video_info,
|
||||
menu_disp_info,
|
||||
@ -2629,7 +2629,7 @@ static void xmb_draw_items(
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_START_GET, &i);
|
||||
|
||||
@ -2980,7 +2980,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
menu_display_blend_begin(video_info);
|
||||
|
||||
if (xmb->savestate_thumbnail)
|
||||
@ -3168,7 +3168,7 @@ static void xmb_frame(void *data, video_frame_info_t *video_info)
|
||||
rotate_draw.scale_z = 1;
|
||||
rotate_draw.scale_enable = true;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
xmb_draw_icon(video_info,
|
||||
menu_disp_info,
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "../menu_driver.h"
|
||||
|
||||
static void *menu_display_caca_get_default_mvp(void)
|
||||
static void *menu_display_caca_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -48,7 +48,7 @@ static void menu_display_caca_draw_pipeline(void *data, video_frame_info_t *vide
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void menu_display_caca_viewport(void *data)
|
||||
static void menu_display_caca_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ static const float *menu_display_ctr_get_default_tex_coords(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *menu_display_ctr_get_default_mvp(void)
|
||||
static void *menu_display_ctr_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -53,7 +53,7 @@ static void menu_display_ctr_blend_end(video_frame_info_t *video_info)
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_ctr_viewport(void *data)
|
||||
static void menu_display_ctr_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ static const float *menu_display_d3d_get_default_tex_coords(void)
|
||||
return &d3d_tex_coords[0];
|
||||
}
|
||||
|
||||
static void *menu_display_d3d_get_default_mvp(void)
|
||||
static void *menu_display_d3d_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
static math_matrix_4x4 id;
|
||||
matrix_4x4_identity(id);
|
||||
@ -100,7 +100,7 @@ static void menu_display_d3d_blend_end(video_frame_info_t *video_info)
|
||||
d3d_disable_blend_func(d3d->dev);
|
||||
}
|
||||
|
||||
static void menu_display_d3d_viewport(void *data)
|
||||
static void menu_display_d3d_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ static void menu_display_d3d_draw(void *data, video_frame_info_t *video_info)
|
||||
d3d_vertex_buffer_unlock(d3d->menu_display.buffer);
|
||||
|
||||
if(!draw->matrix_data)
|
||||
draw->matrix_data = menu_display_d3d_get_default_mvp();
|
||||
draw->matrix_data = menu_display_d3d_get_default_mvp(video_info);
|
||||
|
||||
/* ugh */
|
||||
video_driver_get_size(&width, &height);
|
||||
|
@ -28,11 +28,20 @@
|
||||
#include "../../gfx/video_driver.h"
|
||||
#include "../../gfx/common/d3d11_common.h"
|
||||
|
||||
static const float* menu_display_d3d11_get_default_vertices(void) { return NULL; }
|
||||
static const float* menu_display_d3d11_get_default_vertices(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const float* menu_display_d3d11_get_default_tex_coords(void) { return NULL; }
|
||||
static const float* menu_display_d3d11_get_default_tex_coords(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void* menu_display_d3d11_get_default_mvp(void) { return NULL; }
|
||||
static void* menu_display_d3d11_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_d3d11_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
@ -48,7 +57,9 @@ static void menu_display_d3d11_blend_end(video_frame_info_t *video_info)
|
||||
d3d11->blend_disable, NULL, D3D11_DEFAULT_SAMPLE_MASK);
|
||||
}
|
||||
|
||||
static void menu_display_d3d11_viewport(void* data) {}
|
||||
static void menu_display_d3d11_viewport(void* data, video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_d3d11_draw(void* data, video_frame_info_t *video_info)
|
||||
{
|
||||
|
@ -28,11 +28,20 @@
|
||||
#include "../../gfx/video_driver.h"
|
||||
#include "../../gfx/common/d3d12_common.h"
|
||||
|
||||
static const float* menu_display_d3d12_get_default_vertices(void) { return NULL; }
|
||||
static const float* menu_display_d3d12_get_default_vertices(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const float* menu_display_d3d12_get_default_tex_coords(void) { return NULL; }
|
||||
static const float* menu_display_d3d12_get_default_tex_coords(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void* menu_display_d3d12_get_default_mvp(void) { return NULL; }
|
||||
static void* menu_display_d3d12_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void menu_display_d3d12_blend_begin(video_frame_info_t *video_info)
|
||||
{
|
||||
@ -50,7 +59,9 @@ static void menu_display_d3d12_blend_end(video_frame_info_t *video_info)
|
||||
D3D12SetPipelineState(d3d12->queue.cmd, d3d12->sprites.pipe);
|
||||
}
|
||||
|
||||
static void menu_display_d3d12_viewport(void* data) {}
|
||||
static void menu_display_d3d12_viewport(void* data, video_frame_info_t *video_info)
|
||||
{
|
||||
}
|
||||
|
||||
static void menu_display_d3d12_draw(void* data, video_frame_info_t *video_info)
|
||||
{
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "../../gfx/common/win32_common.h"
|
||||
#endif
|
||||
|
||||
static void *menu_display_gdi_get_default_mvp(void)
|
||||
static void *menu_display_gdi_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -52,7 +52,7 @@ static void menu_display_gdi_draw_pipeline(void *data, video_frame_info_t *video
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void menu_display_gdi_viewport(void *data)
|
||||
static void menu_display_gdi_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -50,9 +50,9 @@ static const float *menu_display_gl_get_default_tex_coords(void)
|
||||
return &gl_tex_coords[0];
|
||||
}
|
||||
|
||||
static void *menu_display_gl_get_default_mvp(void)
|
||||
static void *menu_display_gl_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
gl_t *gl = (gl_t*)video_driver_get_ptr(false);
|
||||
gl_t *gl = video_info ? (gl_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!gl)
|
||||
return NULL;
|
||||
@ -96,13 +96,12 @@ static void menu_display_gl_blend_end(video_frame_info_t *video_info)
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
static void menu_display_gl_viewport(void *data)
|
||||
static void menu_display_gl_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
|
||||
if (!draw)
|
||||
return;
|
||||
glViewport(draw->x, draw->y, draw->width, draw->height);
|
||||
if (draw)
|
||||
glViewport(draw->x, draw->y, draw->width, draw->height);
|
||||
}
|
||||
|
||||
static void menu_display_gl_bind_texture(void *data)
|
||||
@ -132,7 +131,7 @@ static void menu_display_gl_draw(void *data, video_frame_info_t *video_info)
|
||||
if (!draw->coords->lut_tex_coord)
|
||||
draw->coords->lut_tex_coord = menu_display_gl_get_default_tex_coords();
|
||||
|
||||
menu_display_gl_viewport(draw);
|
||||
menu_display_gl_viewport(draw, video_info);
|
||||
menu_display_gl_bind_texture(draw);
|
||||
|
||||
coords.handle_data = gl;
|
||||
@ -142,7 +141,7 @@ static void menu_display_gl_draw(void *data, video_frame_info_t *video_info)
|
||||
|
||||
mvp.data = gl;
|
||||
mvp.matrix = draw->matrix_data ? (math_matrix_4x4*)draw->matrix_data
|
||||
: (math_matrix_4x4*)menu_display_gl_get_default_mvp();
|
||||
: (math_matrix_4x4*)menu_display_gl_get_default_mvp(video_info);
|
||||
|
||||
video_driver_set_mvp(&mvp);
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "../menu_driver.h"
|
||||
|
||||
static void *menu_display_null_get_default_mvp(void)
|
||||
static void *menu_display_null_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -47,7 +47,7 @@ static void menu_display_null_draw_pipeline(
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void menu_display_null_viewport(void *data)
|
||||
static void menu_display_null_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include "../menu_driver.h"
|
||||
|
||||
static void *menu_display_vga_get_default_mvp(void)
|
||||
static void *menu_display_vga_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -48,7 +48,7 @@ static void menu_display_vga_draw_pipeline(void *data, video_frame_info_t *video
|
||||
(void)data;
|
||||
}
|
||||
|
||||
static void menu_display_vga_viewport(void *data)
|
||||
static void menu_display_vga_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
(void)data;
|
||||
}
|
||||
|
@ -53,9 +53,11 @@ static const float *menu_display_vita2d_get_default_tex_coords(void)
|
||||
return &vita2d_tex_coords[0];
|
||||
}
|
||||
|
||||
static void *menu_display_vita2d_get_default_mvp(void)
|
||||
static void *menu_display_vita2d_get_default_mvp(
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
vita_video_t *vita2d = (vita_video_t*)video_driver_get_ptr(false);
|
||||
vita_video_t *vita2d = video_info ?
|
||||
(vita_video_t*)video_info->userdata : NULL;
|
||||
|
||||
if (!vita2d)
|
||||
return NULL;
|
||||
@ -92,10 +94,10 @@ static void menu_display_vita2d_blend_end(video_frame_info_t *video_info)
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_vita2d_viewport(void *data)
|
||||
static void menu_display_vita2d_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
vita_video_t *vita2d = (vita_video_t*)video_driver_get_ptr(false);
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
vita_video_t *vita2d = video_info ? (vita_video_t*)video_info->userdata : NULL;
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
|
||||
if (!vita2d || !draw)
|
||||
return;
|
||||
|
@ -48,9 +48,9 @@ static const float vk_colors[] = {
|
||||
1.0f, 1.0f, 1.0f, 1.0f,
|
||||
};
|
||||
|
||||
static void *menu_display_vk_get_default_mvp(void)
|
||||
static void *menu_display_vk_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
|
||||
if (!vk)
|
||||
return NULL;
|
||||
return &vk->mvp_no_rot;
|
||||
@ -99,10 +99,12 @@ static unsigned to_menu_pipeline(
|
||||
}
|
||||
#endif
|
||||
|
||||
static void menu_display_vk_viewport(void *data)
|
||||
static void menu_display_vk_viewport(void *data,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
menu_display_ctx_draw_t *draw = (menu_display_ctx_draw_t*)data;
|
||||
vk_t *vk = (vk_t*)video_driver_get_ptr(false);
|
||||
vk_t *vk = video_info ? (vk_t*)video_info->userdata
|
||||
: NULL;
|
||||
|
||||
if (!vk || !draw)
|
||||
return;
|
||||
@ -160,8 +162,12 @@ static void menu_display_vk_draw_pipeline(void *data, video_frame_info_t *video_
|
||||
draw->pipeline.backend_data_size = sizeof(math_matrix_4x4) + 3 * sizeof(float);
|
||||
|
||||
/* Match UBO layout in shader. */
|
||||
memcpy(ubo_scratch_data, menu_display_vk_get_default_mvp(), sizeof(math_matrix_4x4));
|
||||
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4), output_size, sizeof(output_size));
|
||||
memcpy(ubo_scratch_data,
|
||||
menu_display_vk_get_default_mvp(video_info),
|
||||
sizeof(math_matrix_4x4));
|
||||
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4),
|
||||
output_size,
|
||||
sizeof(output_size));
|
||||
memcpy(ubo_scratch_data + sizeof(math_matrix_4x4) + 2 * sizeof(float), &t, sizeof(t));
|
||||
draw->coords = &blank_coords;
|
||||
blank_coords.vertices = 4;
|
||||
@ -204,7 +210,8 @@ static void menu_display_vk_draw(void *data, video_frame_info_t *video_info)
|
||||
if (!color)
|
||||
color = menu_display_vk_get_default_color();
|
||||
|
||||
menu_display_vk_viewport(draw);
|
||||
menu_display_vk_viewport(draw, video_info);
|
||||
|
||||
vk->tracker.dirty |= VULKAN_DIRTY_DYNAMIC_BIT;
|
||||
|
||||
/* Bake interleaved VBO. Kinda ugly, we should probably try to move to
|
||||
@ -266,7 +273,7 @@ static void menu_display_vk_draw(void *data, video_frame_info_t *video_info)
|
||||
(texture->default_smooth ? vk->samplers.linear
|
||||
: vk->samplers.nearest);
|
||||
call.uniform = draw->matrix_data
|
||||
? draw->matrix_data : menu_display_vk_get_default_mvp();
|
||||
? draw->matrix_data : menu_display_vk_get_default_mvp(video_info);
|
||||
call.uniform_size = sizeof(math_matrix_4x4);
|
||||
call.vbo = ⦥
|
||||
call.vertices = draw->coords->vertices;
|
||||
|
@ -39,7 +39,7 @@ static const float *menu_display_wiiu_get_default_tex_coords(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *menu_display_wiiu_get_default_mvp(void)
|
||||
static void *menu_display_wiiu_get_default_mvp(video_frame_info_t *video_info)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@ -54,7 +54,7 @@ static void menu_display_wiiu_blend_end(video_frame_info_t *video_info)
|
||||
|
||||
}
|
||||
|
||||
static void menu_display_wiiu_viewport(void *data)
|
||||
static void menu_display_wiiu_viewport(void *data, video_frame_info_t *video_info)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ void menu_display_draw_bg(menu_display_ctx_draw_t *draw,
|
||||
if (!draw->texture)
|
||||
draw->texture = menu_display_white_texture;
|
||||
|
||||
draw->matrix_data = (math_matrix_4x4*)menu_disp->get_default_mvp();
|
||||
draw->matrix_data = (math_matrix_4x4*)menu_disp->get_default_mvp(video_info);
|
||||
}
|
||||
|
||||
void menu_display_draw_gradient(menu_display_ctx_draw_t *draw,
|
||||
@ -719,7 +719,7 @@ void menu_display_draw_texture(
|
||||
draw.pipeline.id = 0;
|
||||
coords.color = (const float*)color;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
draw.texture = texture;
|
||||
draw.x = x;
|
||||
@ -806,7 +806,7 @@ void menu_display_draw_texture_slice(
|
||||
draw.pipeline.id = 0;
|
||||
coords.color = (const float*)colors;
|
||||
|
||||
menu_display_rotate_z(&rotate_draw);
|
||||
menu_display_rotate_z(&rotate_draw, video_info);
|
||||
|
||||
draw.texture = texture;
|
||||
draw.x = 0;
|
||||
@ -1012,7 +1012,8 @@ void menu_display_draw_texture_slice(
|
||||
free(tex_coord);
|
||||
}
|
||||
|
||||
void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw)
|
||||
void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw,
|
||||
video_frame_info_t *video_info)
|
||||
{
|
||||
#if !defined(VITA) && !defined(_3DS) && !defined(WIIU)
|
||||
math_matrix_4x4 matrix_rotated, matrix_scaled;
|
||||
@ -1021,7 +1022,7 @@ void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw)
|
||||
if (!draw || !menu_disp || !menu_disp->get_default_mvp)
|
||||
return;
|
||||
|
||||
b = (math_matrix_4x4*)menu_disp->get_default_mvp();
|
||||
b = (math_matrix_4x4*)menu_disp->get_default_mvp(video_info);
|
||||
|
||||
if (!b)
|
||||
return;
|
||||
|
@ -323,7 +323,7 @@ typedef struct menu_display_ctx_driver
|
||||
void (*draw)(void *data, video_frame_info_t *video_info);
|
||||
/* Draw one of the menu pipeline shaders. */
|
||||
void (*draw_pipeline)(void *data, video_frame_info_t *video_info);
|
||||
void (*viewport)(void *data);
|
||||
void (*viewport)(void *data, video_frame_info_t *video_info);
|
||||
/* Start blending operation. */
|
||||
void (*blend_begin)(video_frame_info_t *video_info);
|
||||
/* Finish blending operation. */
|
||||
@ -334,7 +334,7 @@ typedef struct menu_display_ctx_driver
|
||||
void (*clear_color)(menu_display_ctx_clearcolor_t *clearcolor,
|
||||
video_frame_info_t *video_info);
|
||||
/* Get the default Model-View-Projection matrix */
|
||||
void *(*get_default_mvp)(void);
|
||||
void *(*get_default_mvp)(video_frame_info_t *video_info);
|
||||
/* Get the default vertices matrix */
|
||||
const float *(*get_default_vertices)(void);
|
||||
/* Get the default texture coordinates matrix */
|
||||
@ -704,7 +704,8 @@ void menu_display_draw_texture_slice(
|
||||
int x, int y, unsigned w, unsigned h,
|
||||
unsigned new_w, unsigned new_h, unsigned width, unsigned height,
|
||||
float *color, unsigned offset, float scale_factor, uintptr_t texture);
|
||||
void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw);
|
||||
void menu_display_rotate_z(menu_display_ctx_rotate_draw_t *draw,
|
||||
video_frame_info_t *video_info);
|
||||
bool menu_display_get_tex_coords(menu_display_ctx_coord_draw_t *draw);
|
||||
|
||||
void menu_display_timedate(menu_display_ctx_datetime_t *datetime);
|
||||
|
Loading…
x
Reference in New Issue
Block a user