imgui_impl_metal.h (1525B)
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: Support for large meshes (64k+ vertices) with 16-bit indices. 7 8 // You can copy and use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 9 // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 10 // Read online: https://github.com/ocornut/imgui/tree/master/docs 11 12 #include "imgui.h" // IMGUI_IMPL_API 13 14 @class MTLRenderPassDescriptor; 15 @protocol MTLDevice, MTLCommandBuffer, MTLRenderCommandEncoder; 16 17 IMGUI_IMPL_API bool ImGui_ImplMetal_Init(id<MTLDevice> device); 18 IMGUI_IMPL_API void ImGui_ImplMetal_Shutdown(); 19 IMGUI_IMPL_API void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor* renderPassDescriptor); 20 IMGUI_IMPL_API void ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, 21 id<MTLCommandBuffer> commandBuffer, 22 id<MTLRenderCommandEncoder> commandEncoder); 23 24 // Called by Init/NewFrame/Shutdown 25 IMGUI_IMPL_API bool ImGui_ImplMetal_CreateFontsTexture(id<MTLDevice> device); 26 IMGUI_IMPL_API void ImGui_ImplMetal_DestroyFontsTexture(); 27 IMGUI_IMPL_API bool ImGui_ImplMetal_CreateDeviceObjects(id<MTLDevice> device); 28 IMGUI_IMPL_API void ImGui_ImplMetal_DestroyDeviceObjects();