48 lines
3.6 KiB
Plaintext
48 lines
3.6 KiB
Plaintext
// Backend and DockBuilder declarations.
|
|
// These call into extern "C" wrappers in imgui_backend_c.cpp, compiled into ImGui.lib.
|
|
|
|
#scope_export
|
|
|
|
d3d12 :: #import "d3d12";
|
|
dxgi :: #import "dxgi";
|
|
Windows :: #import "Windows";
|
|
|
|
// ImGui_ImplDX12_InitInfo — mirrors the C++ struct layout.
|
|
ImplDX12_InitInfo :: struct {
|
|
Device: *d3d12.ID3D12Device;
|
|
CommandQueue: *d3d12.ID3D12CommandQueue;
|
|
NumFramesInFlight: s32;
|
|
RTVFormat: dxgi.DXGI_FORMAT;
|
|
DSVFormat: dxgi.DXGI_FORMAT;
|
|
UserData: *void;
|
|
SrvDescriptorHeap: *d3d12.ID3D12DescriptorHeap;
|
|
SrvDescriptorAllocFn: #type (info: *ImplDX12_InitInfo, out_cpu: *d3d12.D3D12_CPU_DESCRIPTOR_HANDLE, out_gpu: *d3d12.D3D12_GPU_DESCRIPTOR_HANDLE) #c_call;
|
|
SrvDescriptorFreeFn: #type (info: *ImplDX12_InitInfo, cpu: d3d12.D3D12_CPU_DESCRIPTOR_HANDLE, gpu: d3d12.D3D12_GPU_DESCRIPTOR_HANDLE) #c_call;
|
|
// Legacy single-descriptor fields (IMGUI_DISABLE_OBSOLETE_FUNCTIONS not set)
|
|
LegacySingleSrvCpuDescriptor: d3d12.D3D12_CPU_DESCRIPTOR_HANDLE;
|
|
LegacySingleSrvGpuDescriptor: d3d12.D3D12_GPU_DESCRIPTOR_HANDLE;
|
|
}
|
|
|
|
// Win32 backend
|
|
ImplWin32_Init :: (hwnd: *void) -> bool #foreign imgui "jai_ImGui_ImplWin32_Init";
|
|
ImplWin32_Shutdown :: () #foreign imgui "jai_ImGui_ImplWin32_Shutdown";
|
|
ImplWin32_NewFrame :: () #foreign imgui "jai_ImGui_ImplWin32_NewFrame";
|
|
ImplWin32_WndProcHandler :: (hWnd: Windows.HWND, msg: u32, wParam: Windows.WPARAM, lParam: Windows.LPARAM) -> Windows.LRESULT #foreign imgui "jai_ImGui_ImplWin32_WndProcHandler";
|
|
|
|
// DX12 backend
|
|
ImplDX12_Init :: (info: *ImplDX12_InitInfo) -> bool #foreign imgui "jai_ImGui_ImplDX12_Init";
|
|
ImplDX12_Shutdown :: () #foreign imgui "jai_ImGui_ImplDX12_Shutdown";
|
|
ImplDX12_NewFrame :: () #foreign imgui "jai_ImGui_ImplDX12_NewFrame";
|
|
ImplDX12_RenderDrawData :: (draw_data: *ImDrawData, cmd_list: *d3d12.ID3D12GraphicsCommandList) #foreign imgui "jai_ImGui_ImplDX12_RenderDrawData";
|
|
|
|
// DockBuilder (from imgui_internal.h)
|
|
DockBuilderRemoveNode :: (node_id: ID) #foreign imgui "jai_DockBuilderRemoveNode";
|
|
DockBuilderAddNode :: (node_id: ID, flags: s32) #foreign imgui "jai_DockBuilderAddNode";
|
|
DockBuilderSetNodeSize :: (node_id: ID, size: ImVec2) #foreign imgui "jai_DockBuilderSetNodeSize";
|
|
DockBuilderSplitNode :: (node_id: ID, split_dir: s32, size_ratio: float32, out_id_at_dir: *ID, out_id_at_opposite_dir: *ID) -> ID #foreign imgui "jai_DockBuilderSplitNode";
|
|
DockBuilderDockWindow :: (window_name: *u8, node_id: ID) #foreign imgui "jai_DockBuilderDockWindow";
|
|
DockBuilderFinish :: (node_id: ID) #foreign imgui "jai_DockBuilderFinish";
|
|
|
|
// Font loading
|
|
AddFontFromFileTTF :: (filename: *u8, size_pixels: float32) -> *void #foreign imgui "jai_AddFontFromFileTTF";
|