Foundation
Loading...
Searching...
No Matches
Application.hpp
Go to the documentation of this file.
1#pragma once
3#include "Device.hpp"
4
5namespace Foundation::RHI {
6 class RHIDevice;
11 class RHIApplication : public RHIObject {
12 public:
13 RHIApplication() = default;
15
17
19 [[nodiscard]] virtual RHIDevice* GetDevice(Handle handle) const = 0;
20 virtual void DestroyDevice(Handle handle) = 0;
21 };
23 static RHIDevice* Get(RHIApplication const* app, Handle handle) {
24 return app->GetDevice(handle);
25 }
26 static void Destroy(RHIApplication* app, Handle handle) {
27 app->DestroyDevice(handle);
28 }
29 };
30}
Class representing a window for the platform.
Definition Application.hpp:15
The root object of everything RHI. Implementation of this class inherently defines the RHI backend.
Definition Application.hpp:11
virtual RHIApplicationScopedObjectHandle< RHIDevice > CreateDevice(RHIDevice::DeviceDesc const &desc, Native::NativeWindow *window=nullptr)=0
RHIApplication(RHIApplication const &)=delete
virtual void DestroyDevice(Handle handle)=0
virtual Core::Span< const RHIDevice::DeviceDesc > EnumerateDevices() const =0
virtual RHIDevice * GetDevice(Handle handle) const =0
Definition Device.hpp:131
Base class for all RHI objects.
Definition Details.hpp:16
std::unique_ptr< T, StlDeleter< T > > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:161
Low-level Rendering Hardware Interface (RHI) abstractions.
Definition Application.hpp:5
uint64_t Handle
Definition Details.hpp:9
static void Destroy(RHIApplication *app, Handle handle)
Definition Application.hpp:26
static RHIDevice * Get(RHIApplication const *app, Handle handle)
Definition Application.hpp:23
Provides type traits for types derived from RHIObject.
Definition Details.hpp:30