mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
Create menu_display_set_viewport
This commit is contained in:
parent
15dd8e71ac
commit
d3dba0edc2
@ -38,6 +38,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "d3d_defines.h"
|
||||||
|
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
#include <xfont.h>
|
#include <xfont.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -238,6 +238,14 @@ static const video_driver_t *video_driver_ctx_get_ptr(void)
|
|||||||
return driver->video;
|
return driver->video;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *video_driver_get_ident(void)
|
||||||
|
{
|
||||||
|
const video_driver_t *video = video_driver_ctx_get_ptr();
|
||||||
|
if (video)
|
||||||
|
return video->ident;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* video_driver_get_current_framebuffer:
|
* video_driver_get_current_framebuffer:
|
||||||
*
|
*
|
||||||
|
@ -331,6 +331,8 @@ bool video_driver_frame(const void *frame, unsigned width,
|
|||||||
|
|
||||||
bool video_driver_suppress_screensaver(bool enable);
|
bool video_driver_suppress_screensaver(bool enable);
|
||||||
|
|
||||||
|
const char *video_driver_get_ident(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -465,7 +465,7 @@ static void glui_frame(void)
|
|||||||
&& !menu->msg_force)
|
&& !menu->msg_force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl_set_viewport(gl, global->video_data.width, global->video_data.height, true, false);
|
menu_display_set_viewport(menu);
|
||||||
|
|
||||||
glui_render_background(settings, gl, glui);
|
glui_render_background(settings, gl, glui);
|
||||||
|
|
||||||
|
@ -438,15 +438,7 @@ static void rmenu_xui_frame(void)
|
|||||||
if (!d3dr)
|
if (!d3dr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(void)menu;
|
menu_display_set_viewport(menu);
|
||||||
|
|
||||||
vp_full.X = 0;
|
|
||||||
vp_full.Y = 0;
|
|
||||||
vp_full.Width = global->video_data.width;
|
|
||||||
vp_full.Height = global->video_data.height;
|
|
||||||
vp_full.MinZ = 0.0f;
|
|
||||||
vp_full.MaxZ = 1.0f;
|
|
||||||
d3d_set_viewport(d3dr, &vp_full);
|
|
||||||
|
|
||||||
app.RunFrame();
|
app.RunFrame();
|
||||||
XuiTimersRun();
|
XuiTimersRun();
|
||||||
|
@ -1321,8 +1321,7 @@ static void xmb_frame(void)
|
|||||||
if (!gl)
|
if (!gl)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gl_set_viewport(gl, global->video_data.width,
|
menu_display_set_viewport(menu);
|
||||||
global->video_data.height, true, false);
|
|
||||||
|
|
||||||
menu_display_font_bind_block(menu, font_driver, &xmb->raster_block);
|
menu_display_font_bind_block(menu, font_driver, &xmb->raster_block);
|
||||||
|
|
||||||
|
@ -17,10 +17,15 @@
|
|||||||
#include "menu_display.h"
|
#include "menu_display.h"
|
||||||
#include "menu_animation.h"
|
#include "menu_animation.h"
|
||||||
#include "../dynamic.h"
|
#include "../dynamic.h"
|
||||||
|
#include "../../gfx/drivers/gl_common.h"
|
||||||
#include "../../retroarch.h"
|
#include "../../retroarch.h"
|
||||||
#include "../../config.def.h"
|
#include "../../config.def.h"
|
||||||
#include "../gfx/video_context_driver.h"
|
#include "../gfx/video_context_driver.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_D3D
|
||||||
|
#include "../gfx/d3d/d3d.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
bool menu_display_update_pending(void)
|
bool menu_display_update_pending(void)
|
||||||
{
|
{
|
||||||
runloop_t *runloop = rarch_main_get_ptr();
|
runloop_t *runloop = rarch_main_get_ptr();
|
||||||
@ -155,3 +160,40 @@ bool menu_display_font_flush_block(menu_handle_t *menu,
|
|||||||
return menu_display_font_bind_block(menu,
|
return menu_display_font_bind_block(menu,
|
||||||
font_driver, NULL);
|
font_driver, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void menu_display_set_viewport(menu_handle_t *menu)
|
||||||
|
{
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
driver_t *driver = driver_get_ptr();
|
||||||
|
const char *ident = video_driver_get_ident();
|
||||||
|
|
||||||
|
#ifdef HAVE_OPENGL
|
||||||
|
if (!strcmp(ident, "gl"))
|
||||||
|
{
|
||||||
|
gl_set_viewport(driver->video_data,
|
||||||
|
global->video_data.width,
|
||||||
|
global->video_data.height, true, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_D3D
|
||||||
|
if (!strcmp(ident, "d3d"))
|
||||||
|
{
|
||||||
|
D3DVIEWPORT vp_full;
|
||||||
|
LPDIRECT3DDEVICE d3dr;
|
||||||
|
d3d_video_t *d3d = (d3d_video_t*)driver->video_data;
|
||||||
|
|
||||||
|
vp_full.X = 0;
|
||||||
|
vp_full.Y = 0;
|
||||||
|
vp_full.Width = global->video_data.width;
|
||||||
|
vp_full.Height = global->video_data.height;
|
||||||
|
vp_full.MinZ = 0.0f;
|
||||||
|
vp_full.MaxZ = 1.0f;
|
||||||
|
|
||||||
|
d3dr = (LPDIRECT3DDEVICE)d3d->dev;
|
||||||
|
|
||||||
|
d3d_set_viewport(d3dr, &vp_full);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user