Foundation
Loading...
Searching...
No Matches
Context.hpp
Go to the documentation of this file.
1#pragma once
3#include <Core/JobSystem.hpp>
5#include <RHICore/Surface.hpp>
6#include <SDL3/SDL.h>
7
8using namespace Foundation;
9using namespace RHI;
10using namespace RenderCore;
11using namespace Core;
12class GPUScene;
14{
15class Presenter;
16}
17static constexpr size_t kEditorFrameScratchSize = 4 << 20;
18
63
64extern FContext* GContext;
65
66extern bool UpdateWindowHDRState(FContext* context);
67extern void UpdateSwapchain(FContext* context);
68extern void ResetEditorFrameScratch(FContext* context);
69extern void DestroyEditorRenderer(FContext* context = nullptr);
70extern FContext* CreateContext(SDL_Window* window, Allocator* allocator = GLOBAL_ALLOC, RHIDevice::DeviceDesc const& deviceDesc = {});
71extern void DestroyContext(FContext* context = nullptr /* global */);
#define GLOBAL_ALLOC
Definition Allocator.hpp:240
void DestroyEditorRenderer(FContext *context=nullptr)
Definition EditorState.cpp:118
FContext * CreateContext(SDL_Window *window, Allocator *allocator=GLOBAL_ALLOC, RHIDevice::DeviceDesc const &deviceDesc={})
Definition Context.cpp:192
void ResetEditorFrameScratch(FContext *context)
Definition Context.cpp:132
void DestroyContext(FContext *context=nullptr)
Definition Context.cpp:251
static constexpr size_t kEditorFrameScratchSize
Definition Context.hpp:17
bool UpdateWindowHDRState(FContext *context)
Definition Context.cpp:88
void UpdateSwapchain(FContext *context)
Definition Context.cpp:140
FContext * GContext
Definition Context.cpp:9
Allocator interface (noexcept)
Definition Allocator.hpp:29
The root object of everything RHI. Implementation of this class inherently defines the RHI backend.
Definition Application.hpp:24
Scoped move-only RAII handle wrapper for RHI Objects.
Definition Details.hpp:85
Definition GPUScene.hpp:187
std::basic_string< char, std::char_traits< char >, StlDefaultAllocator< char > > String
Alias for std::basic_string<char>, without an explicit allocator constructor.
Definition Container.hpp:120
std::unique_ptr< T, Deleter > UniquePtr
std::unique_ptr with custom deleter that uses a Foundation::Core::Allocator to deallocate memory.
Definition Allocator.hpp:180
std::span< T > Span
Alias for std::span
Definition Container.hpp:62
Core functionalities for rendering, including the Frame Graph implementation.
Definition Bindless.cpp:2
Definition Allocator.hpp:6
Definition Context.hpp:57
float energyClampOverride
Definition Context.hpp:59
int defaultRenderer
Definition Context.hpp:58
float renderScale
Definition Context.hpp:60
Definition Context.hpp:29
float peakNits
Definition Context.hpp:35
bool enabled
Definition Context.hpp:31
bool propertiesAvailable
Definition Context.hpp:30
float headroom
Definition Context.hpp:34
float sdrWhiteNits
Definition Context.hpp:33
float sdrWhiteLevel
Definition Context.hpp:32
Definition Context.hpp:20
RHIDeviceScopedHandle< RHIPipelineStateCache > psoCache
Definition Context.hpp:42
bool enableHDR
Definition Context.hpp:53
struct FContext::RendererSettings rendererSettings
UniquePtr< JobSystem > jobs
Definition Context.hpp:49
RHIDeviceScopedHandle< RHISwapchain > swapchain
Definition Context.hpp:41
Renderer * renderer
Definition Context.hpp:46
SDL_Event event
Definition Context.hpp:51
RHIDeviceScopedHandle< RHISurface > surface
Definition Context.hpp:40
GPUScene * gpuScene
Definition Context.hpp:45
SDL_Window * window
Definition Context.hpp:27
Allocator * allocator
Definition Context.hpp:23
UniquePtr< AllocatorStack > editorFrameScratch
Definition Context.hpp:25
UniquePtr< ScopedArena > editorFrameArena
Definition Context.hpp:24
RHIApplication * application
Definition Context.hpp:38
Presenter * presenter
Definition Context.hpp:47
String psoCachePath
Definition Context.hpp:43
struct FContext::WindowHDRState windowHDR
Span< const char * > files
Definition Context.hpp:21
RHIApplicationScopedHandle< RHIDevice > device
Definition Context.hpp:39