VPP  0.7
A high-level modern C++ API for Vulkan
vppRenderManager.hpp
1 /*
2  Copyright 2016-2018 SOFT-ERG, Przemek Kuczmierczyk (www.softerg.com)
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification,
6  are permitted provided that the following conditions are met:
7 
8  1. Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 // -----------------------------------------------------------------------------
28 namespace vpp {
29 // -----------------------------------------------------------------------------
30 
65 {
66 public:
68  RenderManager();
69 
73  RenderManager ( const SwapChain& hSwapChain );
74 
86  Device hDevice,
87  Surface hSurface,
88  std::uint32_t imageCount = 0,
89  VkPresentModeKHR imageQueuingMode = VK_PRESENT_MODE_MAILBOX_KHR );
90 
99  void beginFrame();
100 
109  void endFrame();
110 
115  {
118  };
119 
128  void render ( const RenderPass& hRenderPass, ECommandsCaching caching = CACHE_CMDS );
129 
133  const Device& device() const;
134 
138  const Surface& surface() const;
139 
145  const Queue& queue() const;
146 };
147 
148 // -----------------------------------------------------------------------------
149 } // namespace vpp
150 // -----------------------------------------------------------------------------
Represents logical rendering device.
Definition: vppDevice.hpp:49
void render(const RenderPass &hRenderPass, ECommandsCaching caching=CACHE_CMDS)
Renders current frame.
const Queue & queue() const
Retrieves the command queue into which the commands are sent.
Rebuild the buffer.
Definition: vppRenderManager.hpp:117
Represents a set of swappable on-screen images.
Definition: vppSwapChain.hpp:44
The VPP namespace.
Definition: main.hpp:1
Represents a surface visible on the screen.
Definition: vppSurface.hpp:59
Retrieve buffer from cache if possible.
Definition: vppRenderManager.hpp:116
const Surface & surface() const
Retrieves the target surface.
const Device & device() const
Retrieves the device.
ECommandsCaching
Selects the caching behavior for command buffers.
Definition: vppRenderManager.hpp:114
RenderManager()
Constructs a null reference.
Represents Vulkan render pass.
Definition: vppRenderPass.hpp:40
Simple rendering manager.
Definition: vppRenderManager.hpp:64
void endFrame()
Finalizes rendering of current frame.
void beginFrame()
Initializes rendering of current frame.
Command queue for execution of commands.
Definition: vppQueue.hpp:65