[2.3] ImGui with Metal
Posted: Sun Oct 11, 2020 10:46 am
Hi!
I'm trying to add ImGui to Ogre. I've seen a few people on this forum implement this on 2.2 with D3D11 but haven't been able to find any examples for Metal.
Basically, I'm trying to use the example imgui implementation for metal. I've created a compositor manager as suggested in one of the links I've provided below.
Initialising seems simple like so:
However, unlike the D3D11 implementation provided by ImGui, I need to pass a 'MTLRenderPassDescriptor' to ImGui. Where I can get a MTLRenderPassDescriptor from Ogre?
Additionally, I also need to access to a 'id<MTLCommandBuffer>' and 'id<MTLRenderCommandEncoder>'.
Some reading I've done so far, both of these examples are for d3d11:
viewtopic.php?t=95975
viewtopic.php?t=94494
I'm trying to add ImGui to Ogre. I've seen a few people on this forum implement this on 2.2 with D3D11 but haven't been able to find any examples for Metal.
Basically, I'm trying to use the example imgui implementation for metal. I've created a compositor manager as suggested in one of the links I've provided below.
Initialising seems simple like so:
Code: Select all
renderWindow->getCustomAttribute("MetalDevice", &device);
ImGui_ImplMetal_Init(device->mDevice);
Code: Select all
void ImGui_ImplMetal_NewFrame(MTLRenderPassDescriptor *renderPassDescriptor)Code: Select all
ImGui_ImplMetal_RenderDrawData(ImDrawData* draw_data, id<MTLCommandBuffer> commandBuffer, id<MTLRenderCommandEncoder> commandEncoder)
Some reading I've done so far, both of these examples are for d3d11:
viewtopic.php?t=95975
viewtopic.php?t=94494
