Dodo 0.1
Template for CPP projects
Loading...
Searching...
No Matches
dodo::core::DodoContext Class Reference

#include <DodoContext.hpp>

Collaboration diagram for dodo::core::DodoContext:

Public Member Functions

 ~DodoContext ()=default
 
 DodoContext (const DodoContext &other)=delete
 
DodoContextoperator= (const DodoContext &other)=delete
 
 DodoContext (DodoContext &&other) noexcept
 
DodoContextoperator= (DodoContext &&other) noexcept
 

Static Public Member Functions

template<typename... Features>
static auto createDodoContext (const VulkanContext::VulkanContextInfo< Features... > &ctxInfo) -> std::expected< DodoContext, std::string >
 

Private Member Functions

 DodoContext ()=default
 

Private Attributes

GLFWContext _glfwContext
 
VulkanContext _vulkanContext
 

Constructor & Destructor Documentation

◆ DodoContext() [1/3]

dodo::core::DodoContext::DodoContext ( )
privatedefault

◆ ~DodoContext()

dodo::core::DodoContext::~DodoContext ( )
default

◆ DodoContext() [2/3]

dodo::core::DodoContext::DodoContext ( const DodoContext & other)
delete

◆ DodoContext() [3/3]

dodo::core::DodoContext::DodoContext ( DodoContext && other)
noexcept
9 :
10_glfwContext(std::move(other._glfwContext)),
11_vulkanContext(std::move(other._vulkanContext))
12{
13}
VulkanContext _vulkanContext
Definition DodoContext.hpp:18
GLFWContext _glfwContext
Definition DodoContext.hpp:17

Member Function Documentation

◆ createDodoContext()

template<typename... Features>
auto dodo::core::DodoContext::createDodoContext ( const VulkanContext::VulkanContextInfo< Features... > & ctxInfo) -> std::expected<DodoContext, std::string>
static
40 {
41 auto glfwContext = GLFWContext::createContext();
42 if (!glfwContext)
43 return std::unexpected("Failed to create GLFW context: " + glfwContext.error());
44 auto vulkanContext = VulkanContext::createContext(ctxInfo);
45 if (!vulkanContext)
46 return std::unexpected("Failed to create Vulkan context: " + vulkanContext.error());
47 DodoContext dodoContext;
48 dodoContext._glfwContext = std::move(*glfwContext);
49 dodoContext._vulkanContext = std::move(*vulkanContext);
50 return dodoContext;
51}
static auto createContext() -> std::expected< GLFWContext, std::string >
Definition GLFWContext.cpp:11
static auto createContext(const VulkanContextInfo< Features... > &ctxInfo) -> std::expected< VulkanContext, std::string >
Definition VulkanContext.hpp:82

References _glfwContext, _vulkanContext, dodo::core::GLFWContext::createContext(), and dodo::core::VulkanContext::createContext().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

DodoContext & dodo::core::DodoContext::operator= ( const DodoContext & other)
delete

◆ operator=() [2/2]

DodoContext & dodo::core::DodoContext::operator= ( DodoContext && other)
noexcept
15 {
16 if (this != &other) {
17 _glfwContext = std::move(other._glfwContext);
18 _vulkanContext = std::move(other._vulkanContext);
19 }
20 return *this;
21}

Member Data Documentation

◆ _glfwContext

GLFWContext dodo::core::DodoContext::_glfwContext
private

Referenced by createDodoContext().

◆ _vulkanContext

VulkanContext dodo::core::DodoContext::_vulkanContext
private

Referenced by createDodoContext().


The documentation for this class was generated from the following files: