Steppable 0.0.1
A CAS project written from scratch in C++
Loading...
Searching...
No Matches
imgui_impl_metal.h
1// dear imgui: Renderer Backend for Metal
2// This needs to be used along with a Platform Backend (e.g. OSX)
3
4// Implemented features:
5// [X] Renderer: User texture binding. Use 'MTLTexture' as ImTextureID. Read the FAQ about ImTextureID!
6// [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
7// [X] Renderer: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'.
8
9// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
10// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
11// Learn about Dear ImGui:
12// - FAQ https://dearimgui.com/faq
13// - Getting Started https://dearimgui.com/getting-started
14// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
15// - Introduction, links and more at the top of imgui.cpp
16
17#include "imgui.h" // IMGUI_IMPL_API
18#ifndef IMGUI_DISABLE
19
20//-----------------------------------------------------------------------------
21// ObjC API
22//-----------------------------------------------------------------------------
23
24#ifdef __OBJC__
25
26@class MTLRenderPassDescriptor;
27@protocol MTLDevice, MTLCommandBuffer, MTLRenderCommandEncoder;
28
29IMGUI_IMPL_API bool ImGui_ImplMetal_Init(id<MTLDevice> device);
30IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown();
31IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor);
32IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* drawData,
33 id<MTLCommandBuffer> commandBuffer,
34 id<MTLRenderCommandEncoder> commandEncoder);
35
36// Called by Init/NewFrame/Shutdown
37IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(id<MTLDevice> device);
38IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture();
39IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(id<MTLDevice> device);
40IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects();
41
42#endif
43
44//-----------------------------------------------------------------------------
45// C++ API
46//-----------------------------------------------------------------------------
47
48// Enable Metal C++ binding support with '#define IMGUI_IMPL_METAL_CPP' in your imconfig.h file
49// More info about using Metal from C++: https://developer.apple.com/metal/cpp/
50
51#ifdef IMGUI_IMPL_METAL_CPP
52#include <Metal/Metal.hpp>
53#ifndef __OBJC__
54
55IMGUI_IMPL_API bool ImGui_ImplMetal_Init(MTL::Device* device);
56IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown();
57IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTL::RenderPassDescriptor* renderPassDescriptor);
58IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data,
59 MTL::CommandBuffer* commandBuffer,
60 MTL::RenderCommandEncoder* commandEncoder);
61
62// Called by Init/NewFrame/Shutdown
63IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(MTL::Device* device);
64IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture();
65IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(MTL::Device* device);
66IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects();
67
68#endif
69#endif
70
71//-----------------------------------------------------------------------------
72
73#endif // #ifndef IMGUI_DISABLE
Definition imgui.h:3269
Untitled