diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index b7d6a44a5b5..be87231ad05 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -86,6 +86,7 @@ static void drawFramerateBar(); #include "WWMath/wwmath.h" #include "WWLib/registry.h" #include "WW3D2/ww3d.h" +#include "WW3D2/IRenderBackend.h" #include "WW3D2/predlod.h" #include "WW3D2/part_emt.h" #include "WW3D2/part_ldr.h" @@ -549,7 +550,7 @@ void W3DDisplay::setGamma(Real gamma, Real bright, Real contrast, Bool calibrate if (m_windowed) return; //we don't allow gamma to change in window because it would affect desktop. - DX8Wrapper::Set_Gamma(gamma,bright,contrast,calibrate, false); + WW3D::Get_Render_Backend().Set_Gamma(gamma,bright,contrast,calibrate, false); } /** Set resolution of display */ diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp index bed86510ad0..0afa61a078e 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DShaderManager.cpp @@ -54,6 +54,7 @@ //----------------------------------------------------------------------------- #include "WW3D2/dx8wrapper.h" +#include "WW3D2/IRenderBackend.h" #include "WW3D2/assetmgr.h" #include "Lib/BaseType.h" #include "Common/file.h" @@ -2906,7 +2907,7 @@ void W3DShaderManager::startRenderToTexture() DX8Wrapper::Set_DX8_Render_State(D3DRS_COLORWRITEENABLE,D3DCOLORWRITEENABLE_RED|D3DCOLORWRITEENABLE_GREEN|D3DCOLORWRITEENABLE_BLUE); //disable writes to alpha } else //normal clear that overwrites everything. - DX8Wrapper::Clear(true, false, Vector3( 0.0f, 0.0f, 0.0f ), TheWaterTransparency->m_minWaterOpacity); + WW3D::Get_Render_Backend().Clear(true, false, Vector3( 0.0f, 0.0f, 0.0f ), TheWaterTransparency->m_minWaterOpacity); } } diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp index d438761a744..eb1d5b6f540 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp @@ -94,6 +94,7 @@ #include "WW3D2/light.h" #include "WW3D2/predlod.h" #include "WW3D2/ww3d.h" +#include "WW3D2/IRenderBackend.h" #include "W3DDevice/GameClient/CameraShakeSystem.h" @@ -1916,7 +1917,7 @@ void W3DView::draw() //The pass that rendered into a texture may have left the z-buffer in a weird state //so clear it before rendering normal scene. ///@todo: Don't clear z-buffer unless shader uses z-bias or anything else that would cause <= z to fail on normal render. - DX8Wrapper::Clear(false, true, Vector3(0.0f,0.0f,0.0f), TheWaterTransparency->m_minWaterOpacity); // Clear z but not color + WW3D::Get_Render_Backend().Clear(false, true, Vector3(0.0f,0.0f,0.0f), TheWaterTransparency->m_minWaterOpacity); // Clear z but not color W3DDisplay::m_3DScene->setCustomPassMode(SCENE_PASS_DEFAULT); W3DDisplay::m_3DScene->doRender( m_3DCamera ); Coord2D deltaScroll; diff --git a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp index b2375cb1269..5b660e19a05 100644 --- a/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp +++ b/Core/GameEngineDevice/Source/W3DDevice/GameClient/Water/W3DWater.cpp @@ -43,6 +43,7 @@ #include "WW3D2/camera.h" #include "WW3D2/scene.h" #include "WW3D2/dx8wrapper.h" +#include "WW3D2/IRenderBackend.h" #include "WW3D2/light.h" #include "d3dx8math.h" #include "WWLib/simplevec.h" @@ -1711,7 +1712,7 @@ void WaterRenderObjClass::Render(RenderInfoClass & rinfo) rinfo.Camera.Apply(); //force an update of all the camera dependent parameters like frustum clip planes //clear the z-buffer to remove changes made by objects inside mirror - DX8Wrapper::Clear(false,true,Vector3(0.1f,0.1f,0.1f)); + WW3D::Get_Render_Backend().Clear(false,true,Vector3(0.1f,0.1f,0.1f)); } #endif diff --git a/Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h b/Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h index 28dd3b14ec8..1cdff7b0a9b 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/IRenderBackend.h @@ -44,7 +44,7 @@ struct RenderBackendViewport // caller migrates, at which point the method it needs moves here. // // Method names intentionally match the existing DX8Wrapper names so migrating a -// caller is a mechanical DX8Wrapper::X(...) -> Get_Render_Backend()->X(...) +// caller is a mechanical DX8Wrapper::X(...) -> Get_Render_Backend().X(...) // rewrite. class IRenderBackend diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp b/Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp index c43588d279d..a9c470aeacc 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3d.cpp @@ -866,12 +866,12 @@ WW3DErrorType WW3D::Begin_Render(bool clear,bool clearz,const Vector3 & color, f vp.height = height; vp.min_z = 0.0f; vp.max_z = 1.0f; - Get_Render_Backend()->Set_Viewport(vp); - Get_Render_Backend()->Clear(clear, clearz, color, dest_alpha); + Get_Render_Backend().Set_Viewport(vp); + Get_Render_Backend().Clear(clear, clearz, color, dest_alpha); } // Notify D3D that we are beginning to render the frame - Get_Render_Backend()->Begin_Scene(); + Get_Render_Backend().Begin_Scene(); return WW3D_ERROR_OK; } @@ -968,7 +968,7 @@ WW3DErrorType WW3D::Render(SceneClass * scene,CameraClass * cam,bool clear,bool // Clear the viewport if (clear || clearz) { - Get_Render_Backend()->Clear(clear, clearz, color); + Get_Render_Backend().Clear(clear, clearz, color); } // set the rendering mode @@ -986,7 +986,7 @@ WW3DErrorType WW3D::Render(SceneClass * scene,CameraClass * cam,bool clear,bool // Set the global ambient light value here. If the scene is using the LightEnvironment system // this setting will get overridden. - Get_Render_Backend()->Set_Ambient(scene->Get_Ambient_Light()); + Get_Render_Backend().Set_Ambient(scene->Get_Ambient_Light()); // render the scene @@ -1038,7 +1038,7 @@ WW3DErrorType WW3D::Render( // Install the lighting environment if one is supplied if (rinfo.light_environment != nullptr) { - Get_Render_Backend()->Set_Light_Environment(rinfo.light_environment); + Get_Render_Backend().Set_Light_Environment(rinfo.light_environment); } // Render the object @@ -1114,7 +1114,7 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) { WWPROFILE("IRenderBackend::End_Scene"); - Get_Render_Backend()->End_Scene(flip_frame); + Get_Render_Backend().End_Scene(flip_frame); } FrameCount++; @@ -1133,7 +1133,7 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) // (gth) I've found some cases where its not safe to rely on our "shadow" copy (of // matrices for example) across multiple frames. So even though this is slightly // less "optimal", lets just reset the caches each frame. - Get_Render_Backend()->Invalidate_Cached_Render_States(); + Get_Render_Backend().Invalidate_Cached_Render_States(); return WW3D_ERROR_OK; } @@ -1153,7 +1153,7 @@ WW3DErrorType WW3D::End_Render(bool flip_frame) *=============================================================================================*/ void WW3D::Flip_To_Primary() { - Get_Render_Backend()->Flip_To_Primary(); + Get_Render_Backend().Flip_To_Primary(); } @@ -2123,5 +2123,5 @@ void WW3D::Reset_Current_Static_Sort_Lists_To_Default() void WW3D::Set_Gamma(float gamma,float bright,float contrast,bool calibrate) { - Get_Render_Backend()->Set_Gamma(gamma,bright,contrast,calibrate); + Get_Render_Backend().Set_Gamma(gamma,bright,contrast,calibrate); } diff --git a/Core/Libraries/Source/WWVegas/WW3D2/ww3d.h b/Core/Libraries/Source/WWVegas/WW3D2/ww3d.h index f4dea7b6448..33a644cca22 100644 --- a/Core/Libraries/Source/WWVegas/WW3D2/ww3d.h +++ b/Core/Libraries/Source/WWVegas/WW3D2/ww3d.h @@ -116,7 +116,7 @@ class WW3D // The active rendering backend. // Created in Init and destroyed in Shutdown, so it is never null in between. - static IRenderBackend * Get_Render_Backend() { return RenderBackend; } + static IRenderBackend & Get_Render_Backend() { return *RenderBackend; } static int Get_Render_Device_Count(); static const char * Get_Render_Device_Name(int device_index); diff --git a/Core/Tools/W3DView/GammaDialog.cpp b/Core/Tools/W3DView/GammaDialog.cpp index 4b9467b11f9..87af72ba4cf 100644 --- a/Core/Tools/W3DView/GammaDialog.cpp +++ b/Core/Tools/W3DView/GammaDialog.cpp @@ -22,7 +22,7 @@ #include "StdAfx.h" #include "W3DView.h" #include "GammaDialog.h" -#include "WW3D2/dx8wrapper.h" +#include "WW3D2/ww3d.h" #ifdef RTS_DEBUG #define new DEBUG_NEW @@ -94,7 +94,7 @@ void GammaDialogClass::OnOK() if (m_gamma<10) m_gamma=10; if (m_gamma>30) m_gamma=30; ::AfxGetApp()->WriteProfileInt("Config","Gamma",m_gamma); - DX8Wrapper::Set_Gamma(m_gamma/10.0f,0.0f,1.0f); + WW3D::Set_Gamma(m_gamma/10.0f,0.0f,1.0f); CDialog::OnOK(); } @@ -103,7 +103,7 @@ void GammaDialogClass::OnReleasedcaptureGammaSlider(NMHDR* pNMHDR, LRESULT* pRes { // TODO: Add your control notification handler code here m_gamma=m_gammaslider.GetPos(); - DX8Wrapper::Set_Gamma(m_gamma/10.0f,0.0f,1.0f); + WW3D::Set_Gamma(m_gamma/10.0f,0.0f,1.0f); CString string; string.Format("%3.2f",m_gamma/10.0f); SetDlgItemText(IDC_GAMMA_DISPLAY,string); diff --git a/Core/Tools/W3DView/MainFrm.cpp b/Core/Tools/W3DView/MainFrm.cpp index e42303f5ee4..34e72ced8f9 100644 --- a/Core/Tools/W3DView/MainFrm.cpp +++ b/Core/Tools/W3DView/MainFrm.cpp @@ -587,7 +587,7 @@ CMainFrame::OnCreateClient gamma=gamma/10.0f; if (gamma<1.0) gamma=1.0; if (gamma>3.0) gamma=3.0; - DX8Wrapper::Set_Gamma(gamma,0.0f,1.0f); + WW3D::Set_Gamma(gamma,0.0f,1.0f); } } } @@ -4206,9 +4206,9 @@ void CMainFrame::OnEnableGammaCorrection() gamma=gamma/10.0f; if (gamma<1.0) gamma=1.0; if (gamma>3.0) gamma=3.0; - DX8Wrapper::Set_Gamma(gamma,0.0f,1.0f); + WW3D::Set_Gamma(gamma,0.0f,1.0f); } else { - DX8Wrapper::Set_Gamma(1.0,0.0f,1.0f); + WW3D::Set_Gamma(1.0,0.0f,1.0f); } } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp index 31e9b1a86f0..48976666450 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp @@ -57,6 +57,7 @@ #include "WW3D2/dx8renderer.h" #include "WW3D2/sortingrenderer.h" #include "WW3D2/dx8wrapper.h" +#include "WW3D2/IRenderBackend.h" #include "WW3D2/light.h" #include "WW3D2/matpass.h" #include "WW3D2/shader.h" @@ -967,7 +968,7 @@ void RTS3DScene::Render(RenderInfoClass & rinfo) //a projected alpha texture which will later be used to determine where //wireframe should be visible. ///@todo: Clearing to black may not be needed if the scene already did the clear. - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f),1.0f); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f),1.0f); // Clear color but not z DX8Wrapper::Set_DX8_Render_State(D3DRS_COLORWRITEENABLE,D3DCOLORWRITEENABLE_ALPHA); DX8Wrapper::Set_DX8_Render_State (D3DRS_ZBIAS, 0); @@ -1027,7 +1028,7 @@ void RTS3DScene::Render(RenderInfoClass & rinfo) Customized_Render(rinfo); break; case EXTRA_PASS_CLEAR_LINE: - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f), 0.0f); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f), 0.0f); // Clear color but not z WW3D::Enable_Texturing(false); WW3D::Enable_Coloring(0xff008000); DX8Wrapper::Set_DX8_Render_State(D3DRS_FILLMODE,D3DFILL_WIREFRAME); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp index 1293d5306c5..e13a3f76be0 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp @@ -73,6 +73,7 @@ #include "camera.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "WWMath/matrix4.h" #include "dx8wrapper.h" @@ -738,14 +739,14 @@ void CameraClass::Apply() bool windowed; WW3D::Get_Render_Target_Resolution(width,height,bits,windowed); - D3DVIEWPORT8 vp; - vp.X = (DWORD)(Viewport.Min.X * (float)width); - vp.Y = (DWORD)(Viewport.Min.Y * (float)height); - vp.Width = (DWORD)((Viewport.Max.X - Viewport.Min.X) * (float)width); - vp.Height = (DWORD)((Viewport.Max.Y - Viewport.Min.Y) * (float)height); - vp.MinZ = ZBufferMin; - vp.MaxZ = ZBufferMax; - DX8Wrapper::Set_Viewport(&vp); + RenderBackendViewport vp; + vp.x = (unsigned int)(Viewport.Min.X * (float)width); + vp.y = (unsigned int)(Viewport.Min.Y * (float)height); + vp.width = (unsigned int)((Viewport.Max.X - Viewport.Min.X) * (float)width); + vp.height = (unsigned int)((Viewport.Max.Y - Viewport.Min.Y) * (float)height); + vp.min_z = ZBufferMin; + vp.max_z = ZBufferMax; + WW3D::Get_Render_Backend().Set_Viewport(vp); Matrix4x4 d3dprojection; Get_D3D_Projection_Matrix(&d3dprojection); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp index 99e3aa57aa6..00bc5f1670d 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp @@ -35,6 +35,7 @@ #include "render2d.h" #include "WWLib/mutex.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "font3d.h" #include "WWMath/rect.h" #include "texture.h" @@ -541,14 +542,14 @@ void Render2DClass::Render() // // Configure the viewport for entire screen // - D3DVIEWPORT8 vp = { 0 }; - vp.X = (DWORD)ScreenResolution.Left; - vp.Y = (DWORD)ScreenResolution.Top; - vp.Width = (DWORD)ScreenResolution.Width (); - vp.Height = (DWORD)ScreenResolution.Height (); - vp.MinZ = 0; - vp.MaxZ = 1; - DX8Wrapper::Set_Viewport(&vp); + RenderBackendViewport vp; + vp.x = (unsigned int)ScreenResolution.Left; + vp.y = (unsigned int)ScreenResolution.Top; + vp.width = (unsigned int)ScreenResolution.Width (); + vp.height = (unsigned int)ScreenResolution.Height (); + vp.min_z = 0; + vp.max_z = 1; + WW3D::Get_Render_Backend().Set_Viewport(vp); DX8Wrapper::Set_Texture(0,Texture); diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp index 762a5a1beb9..6252283d1db 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp @@ -61,6 +61,7 @@ #include "WWMath/plane.h" #include "camera.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "rinfo.h" #include "WWLib/chunkio.h" #include "dx8renderer.h" @@ -226,7 +227,7 @@ void SceneClass::Render(RenderInfoClass & rinfo) Customized_Render(rinfo); break; case EXTRA_PASS_CLEAR_LINE: - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f)); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f)); // Clear color but not z WW3D::Enable_Texturing(false); DX8Wrapper::Set_DX8_Render_State(D3DRS_FILLMODE,D3DFILL_WIREFRAME); DX8Wrapper::Set_DX8_Render_State (D3DRS_ZBIAS, 7); diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp index aedda9bc0da..9204cfd82cc 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp @@ -57,6 +57,7 @@ #include "WW3D2/dx8renderer.h" #include "WW3D2/sortingrenderer.h" #include "WW3D2/dx8wrapper.h" +#include "WW3D2/IRenderBackend.h" #include "WW3D2/light.h" #include "WW3D2/matpass.h" #include "WW3D2/shader.h" @@ -1015,7 +1016,7 @@ void RTS3DScene::Render(RenderInfoClass & rinfo) //a projected alpha texture which will later be used to determine where //wireframe should be visible. ///@todo: Clearing to black may not be needed if the scene already did the clear. - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f),1.0f); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f),1.0f); // Clear color but not z DX8Wrapper::Set_DX8_Render_State(D3DRS_COLORWRITEENABLE,D3DCOLORWRITEENABLE_ALPHA); DX8Wrapper::Set_DX8_Render_State (D3DRS_ZBIAS, 0); @@ -1075,7 +1076,7 @@ void RTS3DScene::Render(RenderInfoClass & rinfo) Customized_Render(rinfo); break; case EXTRA_PASS_CLEAR_LINE: - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f), 0.0f); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f), 0.0f); // Clear color but not z WW3D::Enable_Texturing(false); WW3D::Enable_Coloring(0xff008000); DX8Wrapper::Set_DX8_Render_State(D3DRS_FILLMODE,D3DFILL_WIREFRAME); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp index 9666f20940b..e922e923a4f 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/camera.cpp @@ -73,6 +73,7 @@ #include "camera.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "WWMath/matrix4.h" #include "dx8wrapper.h" @@ -738,14 +739,14 @@ void CameraClass::Apply() bool windowed; WW3D::Get_Render_Target_Resolution(width,height,bits,windowed); - D3DVIEWPORT8 vp; - vp.X = (DWORD)(Viewport.Min.X * (float)width); - vp.Y = (DWORD)(Viewport.Min.Y * (float)height); - vp.Width = (DWORD)((Viewport.Max.X - Viewport.Min.X) * (float)width); - vp.Height = (DWORD)((Viewport.Max.Y - Viewport.Min.Y) * (float)height); - vp.MinZ = ZBufferMin; - vp.MaxZ = ZBufferMax; - DX8Wrapper::Set_Viewport(&vp); + RenderBackendViewport vp; + vp.x = (unsigned int)(Viewport.Min.X * (float)width); + vp.y = (unsigned int)(Viewport.Min.Y * (float)height); + vp.width = (unsigned int)((Viewport.Max.X - Viewport.Min.X) * (float)width); + vp.height = (unsigned int)((Viewport.Max.Y - Viewport.Min.Y) * (float)height); + vp.min_z = ZBufferMin; + vp.max_z = ZBufferMax; + WW3D::Get_Render_Backend().Set_Viewport(vp); Matrix4x4 d3dprojection; Get_D3D_Projection_Matrix(&d3dprojection); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp index 085a938fe72..c75b14da129 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/render2d.cpp @@ -42,6 +42,7 @@ #include "render2d.h" #include "WWLib/mutex.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "font3d.h" #include "WWMath/rect.h" #include "texture.h" @@ -617,14 +618,14 @@ void Render2DClass::Render() int width, height, bits; bool windowed; WW3D::Get_Device_Resolution( width, height, bits, windowed ); - D3DVIEWPORT8 vp = { 0 }; - vp.X = 0; - vp.Y = 0; - vp.Width = width; - vp.Height = height; - vp.MinZ = 0; - vp.MaxZ = 1; - DX8Wrapper::Set_Viewport(&vp); + RenderBackendViewport vp; + vp.x = 0; + vp.y = 0; + vp.width = width; + vp.height = height; + vp.min_z = 0; + vp.max_z = 1; + WW3D::Get_Render_Backend().Set_Viewport(vp); DX8Wrapper::Set_Texture(0,Texture); VertexMaterialClass *vm=VertexMaterialClass::Get_Preset(VertexMaterialClass::PRELIT_DIFFUSE); diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp index f7b975da694..b2ba862c1d6 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/scene.cpp @@ -65,6 +65,7 @@ #include "WWMath/plane.h" #include "camera.h" #include "ww3d.h" +#include "IRenderBackend.h" #include "rinfo.h" #include "WWLib/chunkio.h" #include "dx8renderer.h" @@ -233,7 +234,7 @@ void SceneClass::Render(RenderInfoClass & rinfo) Customized_Render(rinfo); break; case EXTRA_PASS_CLEAR_LINE: - DX8Wrapper::Clear(true, false, Vector3(0.0f,0.0f,0.0f)); // Clear color but not z + WW3D::Get_Render_Backend().Clear(true, false, Vector3(0.0f,0.0f,0.0f)); // Clear color but not z WW3D::Enable_Texturing(false); DX8Wrapper::Set_DX8_Render_State(D3DRS_FILLMODE,D3DFILL_WIREFRAME); DX8Wrapper::Set_DX8_Render_State (D3DRS_ZBIAS, 7);