Foundation
Loading...
Searching...
No Matches
Classes | Functions | Variables
Examples.hpp File Reference
#include <Core/BuildInfo.hpp>
#include <Core/JobSystem.hpp>
#include <Core/Container.hpp>
#include <RHIVulkan/Application.hpp>
#include <RenderCore/Renderer.hpp>
#include <RenderCore/Presenter.hpp>
#include <RHICore/Surface.hpp>
#include <Renderer/GPUScene.hpp>
#include <Renderer/Renderer.hpp>
#include <Renderer/Texture.hpp>
#include <Renderer/Mesh.hpp>
#include <Math/Math.hpp>
#include <Math/ModelViewProjection.hpp>
#include <RenderUtils/CSDebugText.hpp>
#include <RenderUtils/PSFullscreen.hpp>
#include <SDL3/SDL_dialog.h>
#include <SDL3/SDL_main.h>

Go to the source code of this file.

Classes

struct  ExampleVulkanContext
 
struct  ExampleClickableRegion
 
struct  ExampleTouchState
 
struct  ExampleInputState
 
struct  FExampleOrbitCamera
 
struct  ExampleFpsCounter
 

Functions

void Examples_ReportFatalException ()
 
void Examples_UpdateCameraUBO (RendererUBO &ubo, Renderer *renderer, FExampleOrbitCamera &camera, RendererConfig const &config)
 
float Examples_MaxRenderScale (RHIExtent2D presentExtent)
 
RHIExtent2D Examples_RenderExtent (RHIExtent2D presentExtent, float scale=1.0f)
 
ExampleVulkanContext Examples_InitVulkan (SDL_Window *window, int argc, char **argv, RendererDesc desc={})
 
bool Examples_PollEvents (SDL_Window *window, ExampleVulkanContext &ctx, ExampleInputState &input, SDL_Event *outLastEvent=nullptr, void(*processEvent)(SDL_Event *)=nullptr)
 
bool Examples_ShouldClose (SDL_Window *window, ExampleVulkanContext &ctx, SDL_Event *outEvent=nullptr)
 
void Examples_BeginFrameInput (ExampleInputState &input)
 
void Examples_BeginControls (ExampleInputState &input, int x=16, int y=16)
 
void Examples_SameLine (ExampleInputState &input, int spacing=16)
 
void Examples_PushScale (ExampleInputState &input, int scale)
 
void Examples_PopScale (ExampleInputState &input)
 
void Examples_PushColor (ExampleInputState &input, int col32)
 
void Examples_PushColor (ExampleInputState &input, int r, int g, int b, int a=255)
 
void Examples_PopColor (ExampleInputState &input)
 
void Examples_Text (ExampleInputState &input, StringView text)
 
bool Examples_Button (ExampleInputState &input, StringView text)
 
bool Examples_Slider (ExampleInputState &input, StringView label, float &value, float minValue, float maxValue, float step=0.01f, const char *unit="x", bool draggable=true)
 
Span< const RenderUtils::CSDebugTextData > Examples_HudLines (ExampleInputState const &input)
 
void Examples_NewFrame (Renderer *renderer)
 
void Examples_NewFrame (SDL_Window *window, ExampleVulkanContext &ctx)
 
void Examples_ResetRenderer (ExampleVulkanContext &ctx, RendererDesc desc={})
 
void Examples_DestroyVulkan (SDL_Window *window, ExampleVulkanContext &ctx)
 
bool Examples_CreateSwapchain (SDL_Window *window, RHIDevice *device, RHIDeviceScopedHandle< RHISurface > &outSurface, RHIDeviceScopedHandle< RHISwapchain > &outSwapchain)
 
void Examples_DumpAndOpenImage (RHIApplication const &app, StringView path, RHIExtent2D extent, void const *data, int channels=4, int strideBytes=0)
 
String Examples_PromptForFile (SDL_DialogFileFilter filter, StringView localCopyStem="Picked", StringView(*extensionFromMagic)(Span< const unsigned char >)=nullptr)
 
float Examples_GetTime ()
 

Variables

constexpr int Examples_SDLWindowFlagsVulkan = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_VULKAN
 

Function Documentation

◆ Examples_BeginControls()

void Examples_BeginControls ( ExampleInputState input,
int  x = 16,
int  y = 16 
)

◆ Examples_BeginFrameInput()

void Examples_BeginFrameInput ( ExampleInputState input)

◆ Examples_Button()

bool Examples_Button ( ExampleInputState input,
StringView  text 
)

◆ Examples_CreateSwapchain()

bool Examples_CreateSwapchain ( SDL_Window *  window,
RHIDevice device,
RHIDeviceScopedHandle< RHISurface > &  outSurface,
RHIDeviceScopedHandle< RHISwapchain > &  outSwapchain 
)

◆ Examples_DestroyVulkan()

void Examples_DestroyVulkan ( SDL_Window *  window,
ExampleVulkanContext ctx 
)

◆ Examples_DumpAndOpenImage()

void Examples_DumpAndOpenImage ( RHIApplication const &  app,
StringView  path,
RHIExtent2D  extent,
void const *  data,
int  channels = 4,
int  strideBytes = 0 
)

◆ Examples_GetTime()

float Examples_GetTime ( )

◆ Examples_HudLines()

Span< const RenderUtils::CSDebugTextData > Examples_HudLines ( ExampleInputState const &  input)

◆ Examples_InitVulkan()

ExampleVulkanContext Examples_InitVulkan ( SDL_Window *  window,
int  argc,
char **  argv,
RendererDesc  desc = {} 
)

◆ Examples_MaxRenderScale()

float Examples_MaxRenderScale ( RHIExtent2D  presentExtent)

◆ Examples_NewFrame() [1/2]

void Examples_NewFrame ( Renderer renderer)

◆ Examples_NewFrame() [2/2]

void Examples_NewFrame ( SDL_Window *  window,
ExampleVulkanContext ctx 
)

◆ Examples_PollEvents()

bool Examples_PollEvents ( SDL_Window *  window,
ExampleVulkanContext ctx,
ExampleInputState input,
SDL_Event *  outLastEvent = nullptr,
void(*)(SDL_Event *)  processEvent = nullptr 
)

◆ Examples_PopColor()

void Examples_PopColor ( ExampleInputState input)

◆ Examples_PopScale()

void Examples_PopScale ( ExampleInputState input)

◆ Examples_PromptForFile()

String Examples_PromptForFile ( SDL_DialogFileFilter  filter,
StringView  localCopyStem = "Picked",
StringView(*)(Span< const unsigned char >)  extensionFromMagic = nullptr 
)

◆ Examples_PushColor() [1/2]

void Examples_PushColor ( ExampleInputState input,
int  col32 
)

◆ Examples_PushColor() [2/2]

void Examples_PushColor ( ExampleInputState input,
int  r,
int  g,
int  b,
int  a = 255 
)

◆ Examples_PushScale()

void Examples_PushScale ( ExampleInputState input,
int  scale 
)

◆ Examples_RenderExtent()

RHIExtent2D Examples_RenderExtent ( RHIExtent2D  presentExtent,
float  scale = 1.0f 
)

◆ Examples_ReportFatalException()

void Examples_ReportFatalException ( )

◆ Examples_ResetRenderer()

void Examples_ResetRenderer ( ExampleVulkanContext ctx,
RendererDesc  desc = {} 
)

◆ Examples_SameLine()

void Examples_SameLine ( ExampleInputState input,
int  spacing = 16 
)

◆ Examples_ShouldClose()

bool Examples_ShouldClose ( SDL_Window *  window,
ExampleVulkanContext ctx,
SDL_Event *  outEvent = nullptr 
)

◆ Examples_Slider()

bool Examples_Slider ( ExampleInputState input,
StringView  label,
float &  value,
float  minValue,
float  maxValue,
float  step = 0.01f,
const char *  unit = "x",
bool  draggable = true 
)

◆ Examples_Text()

void Examples_Text ( ExampleInputState input,
StringView  text 
)

◆ Examples_UpdateCameraUBO()

void Examples_UpdateCameraUBO ( RendererUBO ubo,
Renderer renderer,
FExampleOrbitCamera camera,
RendererConfig const &  config 
)

Variable Documentation

◆ Examples_SDLWindowFlagsVulkan

constexpr int Examples_SDLWindowFlagsVulkan = SDL_WINDOW_RESIZABLE | SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_VULKAN
constexpr