2019-04-14 23:29:17 +08:00
|
|
|
// dear imgui: Renderer for Kiwano
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2019-12-31 10:37:29 +08:00
|
|
|
#ifndef KGE_DOXYGEN_DO_NOT_INCLUDE
|
|
|
|
|
|
2019-04-14 23:29:17 +08:00
|
|
|
#if !defined(KGE_USE_DIRECTX10)
|
|
|
|
|
|
2020-02-11 17:04:37 +08:00
|
|
|
#include <kiwano-imgui/imgui_impl/imgui_impl_dx11.h>
|
2020-02-09 18:41:59 +08:00
|
|
|
#include <kiwano/render/DirectX/RendererImpl.h>
|
2019-04-14 23:29:17 +08:00
|
|
|
|
2020-02-09 18:41:59 +08:00
|
|
|
inline bool ImGui_Impl_Init()
|
2020-01-21 10:09:55 +08:00
|
|
|
{
|
2020-02-09 18:41:59 +08:00
|
|
|
::kiwano::RendererImpl& renderer = ::kiwano::RendererImpl::GetInstance();
|
2020-01-21 10:09:55 +08:00
|
|
|
return ImGui_ImplDX11_Init(renderer.GetD3DDeviceResources()->GetDevice(),
|
|
|
|
|
renderer.GetD3DDeviceResources()->GetDeviceContext());
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_Shutdown()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX11_Shutdown();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_NewFrame()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX11_NewFrame();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_RenderDrawData(ImDrawData* draw_data)
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX11_RenderDrawData(draw_data);
|
|
|
|
|
}
|
2019-04-14 23:29:17 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_InvalidateDeviceObjects()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX11_InvalidateDeviceObjects();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline bool ImGui_Impl_CreateDeviceObjects()
|
|
|
|
|
{
|
|
|
|
|
return ImGui_ImplDX11_CreateDeviceObjects();
|
|
|
|
|
}
|
2019-04-14 23:29:17 +08:00
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
2020-02-11 17:04:37 +08:00
|
|
|
#include <kiwano-imgui/imgui_impl/imgui_impl_dx10.h>
|
2019-04-14 23:29:17 +08:00
|
|
|
|
2020-02-09 18:41:59 +08:00
|
|
|
inline bool ImGui_Impl_Init()
|
2020-01-21 10:09:55 +08:00
|
|
|
{
|
2020-02-09 18:41:59 +08:00
|
|
|
::kiwano::RendererImpl& renderer = ::kiwano::RendererImpl::GetInstance();
|
2020-01-21 10:09:55 +08:00
|
|
|
return ImGui_ImplDX10_Init(renderer.GetD3DDeviceResources()->GetDevice());
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_Shutdown()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX10_Shutdown();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_NewFrame()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX10_NewFrame();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_RenderDrawData(ImDrawData* draw_data)
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX10_RenderDrawData(draw_data);
|
|
|
|
|
}
|
2019-04-14 23:29:17 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline void ImGui_Impl_InvalidateDeviceObjects()
|
|
|
|
|
{
|
|
|
|
|
ImGui_ImplDX10_InvalidateDeviceObjects();
|
|
|
|
|
}
|
2020-02-09 18:41:59 +08:00
|
|
|
|
2020-01-21 10:09:55 +08:00
|
|
|
inline bool ImGui_Impl_CreateDeviceObjects()
|
|
|
|
|
{
|
|
|
|
|
return ImGui_ImplDX10_CreateDeviceObjects();
|
|
|
|
|
}
|
2019-04-14 23:29:17 +08:00
|
|
|
|
|
|
|
|
#endif
|
2019-12-31 10:37:29 +08:00
|
|
|
|
|
|
|
|
#endif
|