static void rmenu_xui_frame(void) { XUIMessage msg; XUIMessageRender msgRender; D3DXMATRIX matOrigView; D3DVIEWPORT vp_full; LPDIRECT3DDEVICE d3dr; d3d_video_t *d3d = NULL; menu_handle_t *menu = menu_driver_get_ptr(); driver_t *driver = driver_get_ptr(); if (!menu) return; d3d = (d3d_video_t*)driver->video_data; if (!d3d) return; d3dr = (LPDIRECT3DDEVICE)d3d->dev; if (!d3dr) return; (void)menu; vp_full.X = 0; vp_full.Y = 0; vp_full.Width = d3d->screen_width; vp_full.Height = d3d->screen_height; vp_full.MinZ = 0.0f; vp_full.MaxZ = 1.0f; d3d_set_viewport(d3dr, &vp_full); app.RunFrame(); XuiTimersRun(); XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); const char *message = rarch_main_msg_queue_pull(); if (message) xui_render_message(message); else { const char *message = rarch_main_msg_queue_pull(); if (message) xui_render_message(message); } XuiRenderEnd( app.GetDC() ); d3d_set_viewport(d3dr, &d3d->final_viewport); }
void menu_init (void) { HRESULT hr; xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data; bool hdmenus_allowed = g_extern.console.rmenu.state.rmenu_hd.enable; D3DPRESENT_PARAMETERS d3dpp; video_info_t video_info = {0}; video_info.vsync = g_settings.video.vsync; video_info.force_aspect = false; video_info.smooth = g_settings.video.smooth; video_info.input_scale = 2; video_info.fullscreen = true; video_info.rgb32 = false; xdk_d3d_generate_pp(&d3dpp, &video_info); hr = app.InitShared(device_ptr->d3d_render_device, &d3dpp, XuiPNGTextureLoader); if (hr < 0) { RARCH_ERR("Failed initializing XUI application.\n"); return; } /* Register font */ hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game:/media/rarch.ttf" ); if (hr < 0) { RARCH_ERR("Failed to register default typeface.\n"); return; } hr = app.LoadSkin( L"file://game:/media/rarch_scene_skin.xur"); if (hr < 0) { RARCH_ERR("Failed to load skin.\n"); return; } hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &app.hMainScene); if (hr < 0) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); return; } hCur = app.hMainScene; XuiSceneNavigateFirst(app.GetRootObj(), app.hMainScene, XUSER_INDEX_FOCUS); filebrowser_new(&browser, g_extern.console.main_wrap.paths.default_rom_startup_dir, rarch_console_get_rom_ext()); }
static void rmenu_xui_frame(void) { XUIMessage msg; XUIMessageRender msgRender; D3DXMATRIX matOrigView; LPDIRECT3DDEVICE d3dr; const char *message; D3DVIEWPORT vp_full = {0}; d3d_video_t *d3d = NULL; menu_handle_t *menu = menu_driver_get_ptr(); driver_t *driver = driver_get_ptr(); global_t *global = global_get_ptr(); if (!menu) return; d3d = (d3d_video_t*)driver->video_data; if (!d3d) return; d3dr = (LPDIRECT3DDEVICE)d3d->dev; if (!d3dr) return; menu_display_set_viewport(menu); app.RunFrame(); XuiTimersRun(); XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); message = rarch_main_msg_queue_pull(); if (message) xui_render_message(message); else { message = rarch_main_msg_queue_pull(); if (message) xui_render_message(message); } XuiRenderEnd( app.GetDC() ); menu_display_unset_viewport(menu); }
static void xui_frame(void *data) { XUIMessage msg; XUIMessageRender msgRender; D3DXMATRIX matOrigView; LPDIRECT3DDEVICE d3dr; const char *message = NULL; D3DVIEWPORT vp_full = {0}; d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(false); if (!d3d) return; d3dr = (LPDIRECT3DDEVICE)d3d->dev; if (!d3dr) return; menu_display_ctl(MENU_DISPLAY_CTL_SET_VIEWPORT, NULL); app.RunFrame(); XuiTimersRun(); XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); else { runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); } XuiRenderEnd( app.GetDC() ); menu_display_ctl(MENU_DISPLAY_CTL_UNSET_VIEWPORT, NULL); }
static void xui_frame(void *data, video_frame_info_t *video_info) { XUIMessage msg; XUIMessageRender msgRender; D3DXMATRIX matOrigView; const char *message = NULL; D3DVIEWPORT9 vp_full = {0}; d3d9_video_t *d3d = (d3d9_video_t*)video_driver_get_ptr(false); if (!d3d) return; xui_frame_count++; menu_display_set_viewport(video_info->width, video_info->height); app.RunFrame(); XuiTimersRun(); XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); #if 0 /* TODO/FIXME - update this code */ rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); else { rarch_ctl(RARCH_CTL_MSG_QUEUE_PULL, &message); if (message) xui_render_message(message); } #endif XuiRenderEnd( app.GetDC() ); menu_display_unset_viewport(video_info->width, video_info->height); }
void menu_init (void) { HRESULT hr; context = (rmenu_context_t*)&rmenu_ctx_xdk; xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data; bool hdmenus_allowed = g_extern.console.rmenu.state.rmenu_hd.enable; hr = app.InitShared(vid->d3d_render_device, &vid->d3dpp, XuiPNGTextureLoader); if (hr < 0) { RARCH_ERR("Failed initializing XUI application.\n"); return; } /* Register font */ hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game:/media/rarch.ttf" ); if (hr < 0) { RARCH_ERR("Failed to register default typeface.\n"); return; } hr = app.LoadSkin( L"file://game:/media/rarch_scene_skin.xur"); if (hr < 0) { RARCH_ERR("Failed to load skin.\n"); return; } hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &app.hMainScene); if (hr < 0) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); return; } hCur = app.hMainScene; XuiSceneNavigateFirst(app.GetRootObj(), app.hMainScene, XUSER_INDEX_FOCUS); browser = (filebrowser_t*)malloc(1 * sizeof(filebrowser_t)); tmp_browser = (filebrowser_t*)malloc(1 * sizeof(filebrowser_t)); filebrowser_new(browser, g_extern.console.main_wrap.paths.default_rom_startup_dir, rarch_console_get_rom_ext()); }
static void rmenu_xui_frame(void) { d3d_video_t *d3d = (d3d_video_t*)driver.video_data; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->dev; D3DVIEWPORT vp_full; vp_full.X = 0; vp_full.Y = 0; vp_full.Width = d3d->screen_width; vp_full.Height = d3d->screen_height; vp_full.MinZ = 0.0f; vp_full.MaxZ = 1.0f; d3d_set_viewport(d3dr, &vp_full); app.RunFrame(); XuiTimersRun(); XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); D3DXMATRIX matOrigView; XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XUIMessage msg; XUIMessageRender msgRender; XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); const char *message = msg_queue_pull(xui_msg_queue); if (message) xui_render_message(message); else { const char *message = msg_queue_pull(g_extern.msg_queue); if (message) xui_render_message(message); } XuiRenderEnd( app.GetDC() ); d3d_set_viewport(d3dr, &d3d->final_viewport); }
int menu_init (void) { HRESULT hr; xdk360_video_t *vid = (xdk360_video_t*)g_d3d; hr = app.InitShared(vid->d3d_render_device, &vid->d3dpp, XuiPNGTextureLoader); if (FAILED(hr)) { RARCH_ERR("Failed initializing XUI application.\n"); return 1; } /* Register font */ hr = app.RegisterDefaultTypeface(L"Arial Unicode MS", L"file://game:/media/rarch.ttf" ); if (FAILED(hr)) { RARCH_ERR("Failed to register default typeface.\n"); return 1; } hr = app.LoadSkin( L"file://game:/media/rarch_scene_skin.xur"); if (FAILED(hr)) { RARCH_ERR("Failed to load skin.\n"); return 1; } hr = XuiSceneCreate(L"file://game:/media/sd/", L"rarch_main.xur", NULL, &app.hMainScene); if (FAILED(hr)) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); return 1; } XuiSceneNavigateFirst(app.GetRootObj(), app.hMainScene, XUSER_INDEX_FOCUS); filebrowser_new(&browser, g_console.default_rom_startup_dir, rarch_console_get_rom_ext()); return 0; }
bool menu_iterate_xui(void) { xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data; LPDIRECT3DDEVICE d3dr = (LPDIRECT3DDEVICE)d3d->d3d_render_device; app.RunFrame(); /* Update XUI */ XuiRenderBegin( app.GetDC(), D3DCOLOR_ARGB( 255, 0, 0, 0 ) ); D3DXMATRIX matOrigView; XuiRenderGetViewTransform( app.GetDC(), &matOrigView ); XUIMessage msg; XUIMessageRender msgRender; XuiMessageRender( &msg, &msgRender, app.GetDC(), 0xffffffff, XUI_BLEND_NORMAL ); XuiSendMessage( app.GetRootObj(), &msg ); XuiRenderSetViewTransform( app.GetDC(), &matOrigView ); XuiRenderEnd( app.GetDC() ); XuiTimersRun(); return true; }
static void* xui_init(void **userdata, bool video_is_threaded) { HRESULT hr; d3d9_video_t *d3d = NULL; D3DPRESENT_PARAMETERS d3dpp = {0}; video_info_t video_info = {0}; TypefaceDescriptor typeface = {0}; settings_t *settings = config_get_ptr(); menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu)); if (!menu) return NULL; d3d = (d3d9_video_t*)video_driver_get_ptr(false); if (d3d->resolution_hd_enable) RARCH_LOG("HD menus enabled.\n"); video_info.vsync = settings->bools.video_vsync; video_info.force_aspect = false; video_info.smooth = settings->bools.video_smooth; video_info.input_scale = 2; video_info.fullscreen = true; video_info.rgb32 = false; d3d9_make_d3dpp(d3d, &video_info, &d3dpp); hr = app.InitShared((D3DDevice*)d3d->dev, &d3dpp, (PFN_XUITEXTURELOADER)XuiTextureLoader); if (FAILED(hr)) { RARCH_ERR("Failed initializing XUI application.\n"); goto error; } /* Register font */ typeface.szTypeface = L"Arial Unicode MS"; typeface.szLocator = L"file://game:/media/rarch.ttf"; typeface.szReserved1 = NULL; hr = XuiRegisterTypeface( &typeface, TRUE ); if (FAILED(hr)) { RARCH_ERR("Failed to register default typeface.\n"); goto error; } hr = XuiLoadVisualFromBinary( L"file://game:/media/rarch_scene_skin.xur", NULL); if (FAILED(hr)) { RARCH_ERR("Failed to load skin.\n"); goto error; } hr = XuiSceneCreate(d3d->resolution_hd_enable ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &root_menu); if (FAILED(hr)) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); goto error; } current_menu = root_menu; hr = XuiSceneNavigateFirst(app.GetRootObj(), current_menu, XUSER_INDEX_FOCUS); if (FAILED(hr)) { RARCH_ERR("XuiSceneNavigateFirst failed.\n"); goto error; } video_driver_set_texture_frame(NULL, true, 0, 0, 1.0f); xui_msg_queue = msg_queue_new(16); return menu; error: free(menu); return NULL; }
static void* rmenu_xui_init(void) { HRESULT hr; TypefaceDescriptor typeface = {0}; menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu)); if (!menu) return NULL; d3d_video_t *d3d= (d3d_video_t*)driver.video_data; bool hdmenus_allowed = (g_extern.lifecycle_state & (1ULL << MODE_MENU_HD)); if (hdmenus_allowed) RARCH_LOG("HD menus enabled.\n"); D3DPRESENT_PARAMETERS d3dpp; video_info_t video_info = {0}; video_info.vsync = g_settings.video.vsync; video_info.force_aspect = false; video_info.smooth = g_settings.video.smooth; video_info.input_scale = 2; video_info.fullscreen = true; video_info.rgb32 = false; d3d_make_d3dpp(d3d, &video_info, &d3dpp); hr = app.InitShared(d3d->dev, &d3dpp, XuiPNGTextureLoader); if (FAILED(hr)) { RARCH_ERR("Failed initializing XUI application.\n"); goto error; } /* Register font */ typeface.szTypeface = L"Arial Unicode MS"; typeface.szLocator = L"file://game:/media/rarch.ttf"; typeface.szReserved1 = NULL; hr = XuiRegisterTypeface( &typeface, TRUE ); if (FAILED(hr)) { RARCH_ERR("Failed to register default typeface.\n"); goto error; } hr = XuiLoadVisualFromBinary( L"file://game:/media/rarch_scene_skin.xur", NULL); if (FAILED(hr)) { RARCH_ERR("Failed to load skin.\n"); goto error; } hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &root_menu); if (FAILED(hr)) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); goto error; } current_menu = root_menu; hr = XuiSceneNavigateFirst(app.GetRootObj(), current_menu, XUSER_INDEX_FOCUS); if (FAILED(hr)) { RARCH_ERR("XuiSceneNavigateFirst failed.\n"); goto error; } if (driver.video_data && driver.video_poke && driver.video_poke->set_texture_enable) driver.video_poke->set_texture_frame(driver.video_data, NULL, true, 0, 0, 1.0f); xui_msg_queue = msg_queue_new(16); return menu; error: free(menu); return NULL; }
static void* rgui_init (void) { HRESULT hr; rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); if (rgui == NULL) { RARCH_ERR("Could not allocate RGUI handle.\n"); return NULL; } xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data; bool hdmenus_allowed = (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD)); if (hdmenus_allowed) RARCH_LOG("HD menus enabled.\n"); D3DPRESENT_PARAMETERS d3dpp; video_info_t video_info = {0}; video_info.vsync = g_settings.video.vsync; video_info.force_aspect = false; video_info.smooth = g_settings.video.smooth; video_info.input_scale = 2; video_info.fullscreen = true; video_info.rgb32 = false; xdk_d3d_generate_pp(&d3dpp, &video_info); hr = app.InitShared(device_ptr->d3d_render_device, &d3dpp, XuiPNGTextureLoader); if (hr != S_OK) { RARCH_ERR("Failed initializing XUI application.\n"); free(rgui); return NULL; } /* Register font */ TypefaceDescriptor typeface = {0}; typeface.szTypeface = L"Arial Unicode MS"; typeface.szLocator = L"file://game:/media/rarch.ttf"; typeface.szReserved1 = NULL; hr = XuiRegisterTypeface( &typeface, TRUE ); if (hr != S_OK) { RARCH_ERR("Failed to register default typeface.\n"); free(rgui); return NULL; } hr = XuiLoadVisualFromBinary( L"file://game:/media/rarch_scene_skin.xur", NULL); if (hr != S_OK) { RARCH_ERR("Failed to load skin.\n"); free(rgui); return NULL; } hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_main.xur", NULL, &root_menu); if (hr != S_OK) { RARCH_ERR("Failed to create scene 'rarch_main.xur'.\n"); free(rgui); return NULL; } current_menu = root_menu; hr = XuiSceneNavigateFirst(app.GetRootObj(), current_menu, XUSER_INDEX_FOCUS); if (hr != S_OK) { RARCH_ERR("XuiSceneNavigateFirst failed.\n"); free(rgui); return NULL; } if (driver.video_poke && driver.video_poke->set_texture_enable) driver.video_poke->set_texture_frame(driver.video_data, NULL, true, 0, 0, 1.0f); return rgui; }