VPP  0.7
A high-level modern C++ API for Vulkan
vppInstance.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 
48 class Instance
49 {
50 public:
54  enum EFlags
55  {
58  };
59 
103  explicit Instance ( unsigned int flags = 0 );
104 
106  ~Instance();
107 
109  VkInstance handle() const;
110 
112  bool valid() const;
113 
115  VkResult enumeratePhysicalDevices ( PhysicalDevices* pResult ) const;
116 
118  static VkResult enumerateExtensions ( ExtensionProperties* pResult );
119 
122 };
123 
124 // -----------------------------------------------------------------------------
125 } // namespace vpp
126 // -----------------------------------------------------------------------------
static VkResult enumerateExtensions(ExtensionProperties *pResult)
Gets a list of available Vulkan extensions.
~Instance()
Destructor.
Definition: vppInstance.hpp:56
The VPP namespace.
Definition: main.hpp:1
Base class for debug report generators.
Definition: vppDebugReporter.hpp:55
VkResult enumeratePhysicalDevices(PhysicalDevices *pResult) const
Gets a list of physical devices in the system.
static DebugReporter * getDebugReporter()
Gets currently registered debug reporter, or zero if there is no one.
EFlags
Flags for instance creation.
Definition: vppInstance.hpp:54
VkInstance handle() const
Retrieves Vulkan handle for the instance.
Definition: vppInstance.hpp:57
Represents the instance of Vulkan system.
Definition: vppInstance.hpp:48
bool valid() const
Checks whether instance creation has succeeded.
std::vector< PhysicalDevice > PhysicalDevices
Array of physical devices.
Definition: vppPhysicalDevice.hpp:196
Instance(unsigned int flags=0)
The constructor.