static void ResizeStep2(void) { g_CritialSection.Lock(); // Delete all OpenGL textures gTextureManager.CleanUp(); RDP_Cleanup(); // delete our opengl renderer CDeviceBuilder::GetBuilder()->DeleteRender(); // call video extension function with updated width, height (this creates a new OpenGL context) windowSetting.uDisplayWidth = status.gNewResizeWidth; windowSetting.uDisplayHeight = status.gNewResizeHeight; CoreVideo_ResizeWindow(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); // re-initialize our OpenGL graphics context state bool res = CGraphicsContext::Get()->ResizeInitialize(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight, !windowSetting.bDisplayFullscreen); if (res) { // re-create the OpenGL renderer CDeviceBuilder::GetBuilder()->CreateRender(); CRender::GetRender()->Initialize(); DLParser_Init(); } g_CritialSection.Unlock(); status.ToResize = false; }
void StopVideo() { if( CGraphicsContext::Get()->IsWindowed() == false ) { status.ToToggleFullScreen = TRUE; CGraphicsContext::Get()->ToggleFullscreen(); status.ToToggleFullScreen = FALSE; } g_CritialSection.Lock(); status.bGameIsRunning = false; try { // Kill all textures? gTextureManager.RecycleAllTextures(); gTextureManager.CleanUp(); RDP_Cleanup(); CloseExternalTextures(); CDeviceBuilder::GetBuilder()->DeleteRender(); CGraphicsContext::Get()->CleanUp(); CDeviceBuilder::GetBuilder()->DeleteGraphicsContext(); } catch(...) { TRACE0("Some exceptions during RomClosed"); } g_CritialSection.Unlock(); windowSetting.dps = windowSetting.fps = -1; windowSetting.lastSecDlistCount = windowSetting.lastSecFrameCount = 0xFFFFFFFF; status.gDlistCount = status.gFrameCount = 0; #ifndef _XBOX KillTimer(g_GraphicsInfo.hWnd, windowSetting.timer); if( windowSetting.screenSaverStatus ) SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, TRUE, 0, 0); // Enable screen saver #endif DEBUGGER_ONLY({delete surfTlut;});
void riceRomClosed(void) { TRACE0("To stop video"); Ini_StoreRomOptions(&g_curRomInfo); status.bGameIsRunning = false; // Kill all textures? gTextureManager.RecycleAllTextures(); gTextureManager.CleanUp(); RDP_Cleanup(); CDeviceBuilder::GetBuilder()->DeleteRender(); CGraphicsContext::Get()->CleanUp(); CDeviceBuilder::GetBuilder()->DeleteGraphicsContext(); windowSetting.dps = windowSetting.fps = -1; windowSetting.lastSecDlistCount = windowSetting.lastSecFrameCount = 0xFFFFFFFF; status.gDlistCount = status.gFrameCount = 0; TRACE0("Video is stopped"); }
void StopVideo() { if( CGraphicsContext::Get()->IsWindowed() == false ) { status.ToToggleFullScreen = TRUE; CGraphicsContext::Get()->ToggleFullscreen(); status.ToToggleFullScreen = FALSE; } g_CritialSection.Lock(); status.bGameIsRunning = false; try { CloseExternalTextures(); // Kill all textures? gTextureManager.RecycleAllTextures(); gTextureManager.CleanUp(); RDP_Cleanup(); CDeviceBuilder::GetBuilder()->DeleteRender(); CGraphicsContext::Get()->CleanUp(); CDeviceBuilder::GetBuilder()->DeleteGraphicsContext(); } catch(...) { TRACE0("Some exceptions during RomClosed"); } g_CritialSection.Unlock(); windowSetting.dps = windowSetting.fps = -1; windowSetting.lastSecDlistCount = windowSetting.lastSecFrameCount = 0xFFFFFFFF; status.gDlistCount = status.gFrameCount = 0; }
void riceUpdateScreen(void) { status.bVIOriginIsUpdated = false; if (status.ToResize && status.gDlistCount > 0) { // Delete all OpenGL textures gTextureManager.CleanUp(); RDP_Cleanup(); // delete our opengl renderer CDeviceBuilder::GetBuilder()->DeleteRender(); // call video extension function with updated width, height (this creates a new OpenGL context) windowSetting.uDisplayWidth = status.gNewResizeWidth; windowSetting.uDisplayHeight = status.gNewResizeHeight; //CoreVideo_ResizeWindow(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); // re-initialize our OpenGL graphics context state bool res = CGraphicsContext::Get()->ResizeInitialize(windowSetting.uDisplayWidth, windowSetting.uDisplayHeight); if (res) { // re-create the OpenGL renderer CDeviceBuilder::GetBuilder()->CreateRender(); CRender::GetRender()->Initialize(); DLParser_Init(); } status.ToResize = false; return; } if( status.bHandleN64RenderTexture ) g_pFrameBufferManager->CloseRenderTexture(true); g_pFrameBufferManager->SetAddrBeDisplayed(*gfx_info.VI_ORIGIN_REG); if( status.gDlistCount == 0 ) { // CPU frame buffer update uint32_t width = *gfx_info.VI_WIDTH_REG; if( (*gfx_info.VI_ORIGIN_REG & (g_dwRamSize-1) ) > width*2 && *gfx_info.VI_H_START_REG != 0 && width != 0 ) { SetVIScales(); CRender::GetRender()->DrawFrameBuffer(true, 0, 0, 0, 0); CGraphicsContext::Get()->UpdateFrame(false); } return; } TXTRBUF_DETAIL_DUMP(TRACE1("VI ORIG is updated to %08X", *gfx_info.VI_ORIGIN_REG)); if( currentRomOptions.screenUpdateSetting == SCREEN_UPDATE_AT_VI_UPDATE ) { CGraphicsContext::Get()->UpdateFrame(false); return; } TXTRBUF_DETAIL_DUMP(TRACE1("VI ORIG is updated to %08X", *gfx_info.VI_ORIGIN_REG)); if( currentRomOptions.screenUpdateSetting == SCREEN_UPDATE_AT_VI_UPDATE_AND_DRAWN ) { if( status.bScreenIsDrawn ) CGraphicsContext::Get()->UpdateFrame(false); return; } if( currentRomOptions.screenUpdateSetting==SCREEN_UPDATE_AT_VI_CHANGE ) { if( *gfx_info.VI_ORIGIN_REG != status.curVIOriginReg ) { if( *gfx_info.VI_ORIGIN_REG < status.curDisplayBuffer || *gfx_info.VI_ORIGIN_REG > status.curDisplayBuffer+0x2000 ) { status.curDisplayBuffer = *gfx_info.VI_ORIGIN_REG; status.curVIOriginReg = status.curDisplayBuffer; //status.curRenderBuffer = NULL; CGraphicsContext::Get()->UpdateFrame(false); } else { status.curDisplayBuffer = *gfx_info.VI_ORIGIN_REG; status.curVIOriginReg = status.curDisplayBuffer; } } return; } if( currentRomOptions.screenUpdateSetting >= SCREEN_UPDATE_AT_1ST_CI_CHANGE ) { status.bVIOriginIsUpdated=true; return; } }