The Renderer
interface looks like this:
class Renderer
{static RendererData& data() noexcept;
static void saveSettings() noexcept;
static const FString& getVendorString() noexcept;
static const FString& getAPIVersion() noexcept;
static const FString& getGPUName() noexcept;
static const FString& getDriverVersion() noexcept;
};
The first function returns a reference to the RendererData
struct that looks like this:
struct RendererData
{bool bVulkan = false; // Enables the vulkan submodule
bool bUsingVSync = true; // Enables V-Sync, defaults to true
uint32_t msaaSamples = 8; // The number of samples for MSAA, supersampling
bool bSampleRateShading = false; // A boolean that if set to true enables sample rate shading, simply MSAA on shaders
float sampleRateShadingMult = 0.0f; // Multiplier for sample rate shading, the higher = less performance but more quality
};
You can see descriptions in the code comments above. It is defined as part of the C API under C/Internal/RendererData.h
.
The saveSettings
function saves the settings in this struct to the Renderer config file under Config/Core/Renderer.yaml
.
All functions after that, return information fetched from the Graphics API about your GPU, like the driver version or API version.
Settings
The settings for the renderer are stored at Config/Core/Renderer.yaml
, which looks like this:
vulkan: false
v-sync: false
msaa-samples: 8
sample-rate-shading: false
sample-rate-shading-mult: 0.1
And corresponds directly to the RendererData
struct documented above.
Event safety
The following members of the Renderer
interface are marked as Any time
:
data()
saveSettings()
The rest are marked as Begin
.
C API
The C API is the same as the C++ one, but using standard C API semantics such as prefixing each function with UImGui_Renderer_
, as defined here. The API looks like this:
// Event Safety - Any time
UImGui_RendererData* UImGui_Renderer_data();// Event Safety - Any time
void UImGui_Renderer_saveSettings();
// Event Safety - begin, post-begin
UImGui_String UImGui_Renderer_getVendorString();// Event Safety - begin, post-begin
UImGui_String UImGui_Renderer_getAPIVersion();// Event Safety - begin, post-begin
UImGui_String UImGui_Renderer_getGPUName();// Event Safety - begin, post-begin
UImGui_String UImGui_Renderer_getDriverVersion();
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Additional features
- Custom type definitions
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Modules system
- I18N
- Plotting
- Knobs
- Spinners
- Toggles
- Text Utils
- Undo/Redo
- CLI Parser
- Theming
- OS
- Opening URLs and using file pickers
- Exec integration
- Fonts
- Unix
- DBus utilities
- XDG integration
- Collaborating with others
- Advanced content
- Loading dynamic libraries at runtime
- Understanding the library layout
- Compilation mode modifiers
- Adding plugin support to your application
- Production export and deployment
- Developer and contributor resources
- Misc