Foundation
Loading...
Searching...
No Matches
Application.hpp
Go to the documentation of this file.
1#pragma once
2#include "Device.hpp"
3#include <SDL3/SDL.h>
4namespace Foundation::RHI {
5 class RHIDevice;
6 class RHIApplication;
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}
The root object of everything RHI. Implementation of this class inherently defines the RHI backend.
Definition Application.hpp:11
virtual RHIApplicationScopedHandle< RHIDevice > CreateDevice(RHIDevice::DeviceDesc const &desc, SDL_Window *window)=0
RHIApplication(RHIApplication const &)=delete
virtual void DestroyDevice(Handle handle)=0
virtual Span< const RHIDevice::DeviceDesc > EnumerateDevices() const =0
virtual RHIDevice * GetDevice(Handle handle) const =0
Definition Device.hpp:188
Base class for all RHI objects.
Definition Details.hpp:16
Scoped move-only RAII handle wrapper for RHI Objects.
Definition Details.hpp:86
T * Construct(Allocator *resource, Args &&...args)
Convenience placement new with object of type T using a Foundation::Core::Allocator.
Definition Allocator.hpp:149
std::span< T > Span
Alias for std::span
Definition Container.hpp:60
Low-level Rendering Hardware Interface (RHI) abstractions.
Definition Application.hpp:4
uintptr_t Handle
Definition Details.hpp:8
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