UgContext

Top-level Vulkan context holding all core rendering state

It

Aggregate of all core Vulkan handles needed for rendering

struct It {
  UgWindow.It window;
  VkInstance instance;
  VkDebugUtilsMessengerEXT logger;
  VkSurfaceKHR surface;
  VkPhysicalDevice physicalDevice;
  UgDevice.It device;
  VkDescriptorPool descriptorPool;
  VkCommandPool cmdPool;
};

create

Create and initialize the full Vulkan context

UgContext.It create(UgWindow.It& window, U8 debug);

Parameters

  • window — GLFW window to attach the surface to
  • debug — Non-zero to enable validation layers

Returns — Fully initialized Vulkan context


destroy

Destroy the Vulkan context and free all associated resources

U0 destroy(UgContext.It& ctx);

Parameters

  • ctx — Vulkan context to destroy