https://github.com/minegame159/imgui-vulkan-beef
Vulkan backend for Dear ImGui in Beef
https://github.com/minegame159/imgui-vulkan-beef
beef beef-language beef-programming-language imgui vulkan
Last synced: 4 months ago
JSON representation
Vulkan backend for Dear ImGui in Beef
- Host: GitHub
- URL: https://github.com/minegame159/imgui-vulkan-beef
- Owner: MineGame159
- Created: 2022-02-14T18:25:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-14T18:39:25.000Z (over 4 years ago)
- Last Synced: 2025-02-28T13:03:54.716Z (over 1 year ago)
- Topics: beef, beef-language, beef-programming-language, imgui, vulkan
- Language: Beef
- Homepage:
- Size: 18.6 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vulkan backend for Dear ImGui in Beef
Ported from the [official Vulkan backend](https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_vulkan.h) based on commit [5854da10e664312e51acec618267d06b1294ac0b](https://github.com/ocornut/imgui/tree/5854da10e664312e51acec618267d06b1294ac0b).
## Usage
Clone the project into BeefLibs, then in the IDE, right click your workspace and go Add From Installed > ImGuiImplVulkan.
Requires the [Bulkan](https://github.com/jayrulez/Bulkan) library.
Example:
```beef
using ImGui;
namespace Foo {
class Bar {
public static void Main() {
ImGuiImplVulkan.InitInfo info = .() {
// Fill with Vulkan data
};
ImGuiImplVulkan.Init(&info, renderPass);
// Upload fonts
{
// Begin command buffer
ImGuiImplVulkan.CreateFontsTexture(commandBuffer);
// End command buffer
VkSubmitInfo submitInfo = .() {
commandBufferCount = 1,
pCommandBuffers = commandBuffer
};
vkQueueSubmit(queue, 1, &submitInfo, .Null);
vkDeviceWaitIdle(device);
ImGuiImplVulkan.DestroyFontUploadObjects();
}
...
while (true) {
...
ImGuiImplVulkan.NewFrame();
...
ImGui.Render();
ImGuiImplVulkan.RenderDrawData(ImGui.GetDrawData(), commandBuffer);
...
}
...
ImGuiImplVulkan.Shutdown();
}
}
}
```