vOOlkan
An object oriented approach to Vulkan
|
A Drawer is a class which holds all of the resources to draw frames on screen, such as the synchronization primitives, the framebuffers, the swapchain, ... and the function to actually draw a frame. More...
#include <Drawer.h>
Public Member Functions | |
Drawer (const LogicalDevice &virtualGpu, const PhysicalDevice &realGpu, const Window &window, const WindowSurface &windowSurface, Swapchain &swapchain, DepthImage &depthBuffer, const CommandBufferPool &commandBufferPool, const PipelineOptions::RenderPass &renderPass, std::vector< Pipeline * > pipelines, const std::vector< std::reference_wrapper< StaticSet > > &globalSets, const std::vector< std::reference_wrapper< DynamicSet > > &perObjectSets, unsigned int framesInFlight=2) | |
Creates all the resources needed to draw something on screen. More... | |
template<template< typename, typename >class... P> requires (std::same_as<P<int, int>, std::pair<int, int>> && ...) | |
void | draw (const P< std::reference_wrapper< Buffers::VertexBuffer >, std::reference_wrapper< Buffers::IndexBuffer > > &... buffers) |
Draws the vertexBuffer by running the specified commands. More... | |
A Drawer is a class which holds all of the resources to draw frames on screen, such as the synchronization primitives, the framebuffers, the swapchain, ... and the function to actually draw a frame.
|
inline |
Creates all the resources needed to draw something on screen.
These resources more specifically are: Swapchain, Framebuffer(s), CommandBufferPool, COmmandBuffer(s), Fence(s), Semaphore(s).
virtualGpu | The LogicalDevice. |
realGpu | The PhysiscalDevice. |
window | The Window ehre to draw. |
windowSurface | The WindowSurface of the window (also serves to poll for window resizes and such). |
renderPass | How to draw a frame. |
pipeline | The stages to draw a frame. |
framesInFlight | How many frames can be rendered concurrently. |
|
inline |
Draws the vertexBuffer by running the specified commands.
vertexBuffer | Vertices to draw. |
...commands | Vulkan Functions to execute on the vertices. |
...Args | The types of the arguments to pass to each Vulkan function. |
...Command | The tuples, each containing the Vulkan function and its arguments (of type ...Args). |
Draws the vertexBuffer.
This function will simply bind the vertex buffer (vertexBuffer) and then draw it.
vertexBuffer | Vertices to draw. |
indexBuffer | Indeces of the vertices to draw (for indexed drawing). |