From dc21864405b4c83fadbcaa90ff16eff7db18f6c0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 3 Aug 2012 04:39:37 +0200 Subject: [PATCH] (Xbox 1) Create more context functions for XDK --- console/griffin/hook.h | 2 -- gfx/context/ps3_ctx.c | 2 +- gfx/context/xdk_ctx.c | 12 +++++++++++- xbox1/frontend/menu.c | 5 ++--- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/console/griffin/hook.h b/console/griffin/hook.h index d8aa70bb29..045dff26e0 100644 --- a/console/griffin/hook.h +++ b/console/griffin/hook.h @@ -41,7 +41,6 @@ #define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx) #define gfx_ctx_window_has_focus() (true) -#define gfx_ctx_swap_buffers() (psglSwap()) #define input_init_func() ps3_input_initialize() #define input_poll_func() ps3_input_poll(driver.input_data) @@ -69,7 +68,6 @@ #define video_set_aspect_ratio_func(aspectratio_idx) gfx_ctx_set_aspect_ratio(driver.video_data, aspectratio_idx) #define gfx_ctx_window_has_focus() (true) -#define gfx_ctx_swap_buffers() (d3d->d3d_render_device->Present(NULL, NULL, NULL, NULL)) #define input_init_func() xinput_input_init() #define input_poll_func() xinput_input_poll(driver.input_data) diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index 3d4b307cc2..2c187b849d 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -99,12 +99,12 @@ bool gfx_ctx_window_has_focus(void) { return true; } +#endif void gfx_ctx_swap_buffers(void) { psglSwap(); } -#endif void gfx_ctx_clear(void) { diff --git a/gfx/context/xdk_ctx.c b/gfx/context/xdk_ctx.c index c57567133d..c1728bc679 100644 --- a/gfx/context/xdk_ctx.c +++ b/gfx/context/xdk_ctx.c @@ -59,13 +59,23 @@ void gfx_ctx_check_window(bool *quit, void gfx_ctx_set_resize(unsigned width, unsigned height) { } -#ifndef HAVE_GRIFFIN void gfx_ctx_swap_buffers(void) { xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data; +#ifdef _XBOX1 + d3d->d3d_render_device->EndScene(); +#endif d3d->d3d_render_device->Present(NULL, NULL, NULL, NULL); } +void gfx_ctx_clear(void) +{ + xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data; + device_ptr->d3d_render_device->Clear(0, NULL, D3DCLEAR_TARGET, + D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0); +} + +#ifndef HAVE_GRIFFIN bool gfx_ctx_window_has_focus(void) { return true; diff --git a/xbox1/frontend/menu.c b/xbox1/frontend/menu.c index 6861bc11f0..deaf863be1 100644 --- a/xbox1/frontend/menu.c +++ b/xbox1/frontend/menu.c @@ -990,9 +990,8 @@ void menu_loop(void) { SET_TIMER_EXPIRATION(device_ptr, 30); } - - device_ptr->d3d_render_device->EndScene(); - device_ptr->d3d_render_device->Present(NULL, NULL, NULL, NULL); + + gfx_ctx_swap_buffers(); }while(g_console.menu_enable); if(g_console.ingame_menu_enable)