Foundation
Loading...
Searching...
No Matches
SDF2D.cpp

2D Signed Distance Field (SDF) example.

#include "Examples.hpp"
namespace Examples {
class SDFDemoApp : public RenderApplication {
void OnRendererSetup() override {
createPSFullscreenPass(
mRenderer.get(), "SDF2D",
[=](PassHandle self, Renderer* r) {
r->BindShader(self, RHIShaderStageBits::Fragment, "fragMain", "data/shaders/SDF2D.spv");
r->BindPushConstant(self, RHIShaderStageBits::Fragment, 0, sizeof(float));
},
[=, this](PassHandle self, Renderer* r, RHICommandList* cmd) {
r->CmdSetPushConstant(self, cmd, RHIShaderStageBits::Fragment, 0, GetApplicationTime());
}
);
}
};
}
int main(int argc, char** argv) {
app.Initialize<VulkanApplication>({ .windowTitle = "SDF2D" });
app.RunForever();
}
int main(int argc, char **argv)
Definition ImGui.cpp:26
Definition SDF2D.cpp:9
void OnRendererSetup() override
Set up the renderer by creating passes, resources, and other configurations.
Definition SDF2D.cpp:10
void Initialize(ApplicationInitDesc const &desc={}, Args &&... args)
Initialize the application with the specified RHI backend.
Definition Application.hpp:205
UniquePtr< Renderer > mRenderer
Definition Application.hpp:102
void RunForever()
Start the Render thread and run the application loop indefinitely, until the window is closed or the ...
Definition Application.cpp:127
For a complete list of examples, see the Examples Page.
Definition Examples.hpp:12