gfx_vulkan.h
Level two typed access to a live vulkan device on windows. Never include it from a neutral header.
#include "isolenui/gfx/gfx_vulkan.h". The guide starts at Level 2, native handles.
Vulkan handles
Explained in Level 2, native handles.
gfx_vulkan_devicegfx_vulkan_framegfx_vulkan_device_ofgfx_vulkan_frame_ofgfx_vulkan_cmdgfx_vulkan_viewExample
main.cppverified by reading, needs the vulkan sdk
#include "isolenui/app/app.h"
#include "isolenui/gfx/gfx_vulkan.h"
// level two on windows, a native pass recorded after isolen_flush_ui lands
// on top of whatever the tree already painted this frame
static void draw(isolen_frame* f, void* user)
{
(void)user;
ui::ctx* u = f->ui;
ui_box(u, ui::col().grow().pad(24.0f))
{
ui::text(u, "native pass draws over this", ui::body(u));
}
isolen_flush_ui(f->app);
gfx_vulkan_frame vk = {};
if (!gfx_vulkan_frame_of(&f->native, &vk)) {
return;
}
// vk.cmd is already recording into vk.image, the same buffer
// gfx_vulkan_cmd(&f->native) returns, a native pass goes here
const VkCommandBuffer cmd = gfx_vulkan_cmd(&f->native);
(void)cmd;
// the pass animates on its own, so it asks for the next frame too
isolen_redraw(f->app);
}
int main(int argc, char** argv)
{
isolen_app_desc d = isolen_app_defaults();
d.title = "isolen ui, level two";
d.backend = gfx_backend_vulkan;
d.view = draw;
return isolen_run(&d, argc, argv);
}