Skip to content

Commit

Permalink
(chore): Remove redundant parameter for BeginFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
hyblocker committed Oct 6, 2024
1 parent 1b8655a commit d9a7ca3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Backends/RmlUi_Backend_Win32_DX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ void Backend::BeginFrame()
CreateRenderTarget();
}

data->render_interface.BeginFrame(data->d3d_resources.pSwapChain, data->d3d_resources.pMainRenderTargetView);
data->render_interface.BeginFrame(data->d3d_resources.pMainRenderTargetView);
}

void Backend::PresentFrame()
Expand Down
5 changes: 1 addition & 4 deletions Backends/RmlUi_Renderer_DX11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1150,11 +1150,10 @@ void RenderInterface_DX11::Cleanup()
DX_CLEANUP_RESOURCE_IF_CREATED(m_d3d_device);
}

void RenderInterface_DX11::BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderTargetView* p_render_target_view)
void RenderInterface_DX11::BeginFrame(ID3D11RenderTargetView* p_render_target_view)
{
RMLUI_ASSERT(m_viewport_width >= 1 && m_viewport_height >= 1);

RMLUI_ASSERTMSG(p_swapchain, "p_swapchain cannot be nullptr!");
RMLUI_ASSERTMSG(p_render_target_view, "p_render_target_view cannot be nullptr!");
RMLUI_ASSERTMSG(m_d3d_context, "d3d_context cannot be nullptr!");
RMLUI_ASSERTMSG(m_d3d_device, "d3d_device cannot be nullptr!");
Expand Down Expand Up @@ -1188,7 +1187,6 @@ void RenderInterface_DX11::BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderT
}

m_bound_render_target = p_render_target_view;
m_bound_swapchain = p_swapchain;

// Initialise DX11 state for RmlUi
D3D11_VIEWPORT d3dviewport;
Expand Down Expand Up @@ -1243,7 +1241,6 @@ void RenderInterface_DX11::EndFrame()
m_render_layers.EndFrame();

// Reset internal state
m_bound_swapchain = nullptr;
m_bound_render_target = nullptr;
m_current_blend_state = nullptr;

Expand Down
3 changes: 1 addition & 2 deletions Backends/RmlUi_Renderer_DX11.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class RenderInterface_DX11 : public Rml::RenderInterface {
void Cleanup ();

// Sets up DirectX11 states for taking rendering commands from RmlUi.
void BeginFrame(IDXGISwapChain* p_swapchain, ID3D11RenderTargetView* p_render_target_view);
void BeginFrame(ID3D11RenderTargetView* p_render_target_view);
void EndFrame();

void SetViewport(const int width, const int height);
Expand Down Expand Up @@ -168,7 +168,6 @@ class RenderInterface_DX11 : public Rml::RenderInterface {
ID3D11Device* m_d3d_device = nullptr;
ID3D11Device1* m_d3d_device_1 = nullptr;
ID3D11DeviceContext1* m_d3d_context = nullptr;
IDXGISwapChain* m_bound_swapchain = nullptr;
ID3D11RenderTargetView* m_bound_render_target = nullptr;
bool m_scissor_enabled = false;
ID3D11RasterizerState* m_rasterizer_state_scissor_enabled = nullptr;
Expand Down

0 comments on commit d9a7ca3

Please sign in to comment.