2.7 KB、50行 生 Blame 履歴
1// dear imgui: Renderer Backend for DirectX10
2// This needs to be used along with a Platform Backend (e.g. Win32)
3
4// Implemented features:
5// [X] Renderer: User texture binding. Use 'ID3D10ShaderResourceView*' as texture identifier. Read the FAQ about ImTextureID/ImTextureRef!
6// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
7// [X] Renderer: Texture updates support for dynamic font atlas (ImGuiBackendFlags_RendererHasTextures).
8// [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
9
10// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
11// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
12// Learn about Dear ImGui:
13// - FAQ https://dearimgui.com/faq
14// - Getting Started https://dearimgui.com/getting-started
15// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
16// - Introduction, links and more at the top of imgui.cpp
17
18#pragma once
19#include "imgui.h" // IMGUI_IMPL_API
20#ifndef IMGUI_DISABLE
21
22struct ID3D10Device;
23struct ID3D10SamplerState;
24struct ID3D10Buffer;
25
26// Follow "Getting Started" link and check examples/ folder to learn about using backends!
27IMGUI_IMPL_API bool ImGui_ImplDX10_Init(ID3D10Device* device);
28IMGUI_IMPL_API void ImGui_ImplDX10_Shutdown();
29IMGUI_IMPL_API void ImGui_ImplDX10_NewFrame();
30IMGUI_IMPL_API void ImGui_ImplDX10_RenderDrawData(ImDrawData* draw_data);
31
32// Use if you want to reset your rendering device without losing Dear ImGui state.
33IMGUI_IMPL_API bool ImGui_ImplDX10_CreateDeviceObjects();
34IMGUI_IMPL_API void ImGui_ImplDX10_InvalidateDeviceObjects();
35
36// (Advanced) Use e.g. if you need to precisely control the timing of texture updates (e.g. for staged rendering), by setting ImDrawData::Textures = nullptr to handle this manually.
37IMGUI_IMPL_API void ImGui_ImplDX10_UpdateTexture(ImTextureData* tex);
38
39// [BETA] Selected render state data shared with callbacks.
40// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplDX10_RenderDrawData() call.
41// (Please open an issue if you feel you need access to more data)
42struct ImGui_ImplDX10_RenderState
43{
44 ID3D10Device* Device;
45 ID3D10Buffer* VertexConstantBuffer;
46 //ID3D10SamplerState* SamplerLinear; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerLinear)
47 //ID3D10SamplerState* SamplerNearest; // Use ImDrawList::AddCallback(ImGui::GetPlatform().DrawCallback_SetSamplerNearest)
48};
49
50#endif // #ifndef IMGUI_DISABLE