File include/brisk/graphics/Renderer.hpp¶
RendererBackend enum¶
enum class RendererBackend : int
RendererBackendSpecifies the rendering backends available for the platform.
rendererBackends variable¶
constexpr inline std::initializer_list<
RendererBackend> rendererBackends
A list of available renderer backends based on platform compilation settings.
defaultNames variable¶
template <>
inline constexpr std::initializer_list<
NameValuePair<RendererBackend>>
defaultNames<RendererBackend>
Default names for available renderer backends.
VisualSettings class¶
VisualSettings
VisualSettingsContains settings for visual adjustments during rendering.
blueLightFilter variable (VisualSettings::blueLightFilter)¶
float blueLightFilter = 0
Adjusts blue light filtering. Default is 0.
gamma variable (VisualSettings::gamma)¶
float gamma = 1
Controls the gamma correction. Default is 1.
subPixelText variable (VisualSettings::subPixelText)¶
bool subPixelText = BRISK_SUBPIXEL_DEFAULT
Enables or disables subpixel text rendering.
RendererDeviceSelection enum¶
enum class RendererDeviceSelection
RendererDeviceSelectionSpecifies the performance level when selecting a rendering device.
HighPerformance enumerator (RendererDeviceSelection::HighPerformance)¶
Selects a high-performance rendering device.
LowPower enumerator (RendererDeviceSelection::LowPower)¶
Selects a low-power rendering device.
Default enumerator (RendererDeviceSelection::Default)¶
Selects the default device.
RenderDeviceInfo class¶
RenderDeviceInfo
RenderDeviceInfoHolds information about the rendering device being used.
api variable (RenderDeviceInfo::api)¶
std::string api
The name of the rendering API.
apiVersion variable (RenderDeviceInfo::apiVersion)¶
int apiVersion
The version of the rendering API.
vendor variable (RenderDeviceInfo::vendor)¶
std::string vendor
The vendor of the rendering device.
device variable (RenderDeviceInfo::device)¶
std::string device
The specific device name.
RenderTarget class¶
RenderTarget
RenderTargetAbstract base class representing a render target.
size function (RenderTarget::size)¶
virtual Size size() const = 0
Returns the size of the render target.
Returns The size of the render target.
SpriteAtlas class¶
SpriteAtlas
GradientAtlas class¶
GradientAtlas
RenderResources class¶
RenderResources
RenderResourcesManages resources used during rendering.
RenderLimits class¶
RenderLimits
RenderLimitsDefines limits on rendering resources.
maxDataSize variable (RenderLimits::maxDataSize)¶
size_t maxDataSize
Maximum buffer size for rendering data (in floats).
maxAtlasSize variable (RenderLimits::maxAtlasSize)¶
size_t maxAtlasSize
Maximum size of texture atlases (in bytes).
maxGradients variable (RenderLimits::maxGradients)¶
size_t maxGradients
Maximum number of gradients allowed.
RenderDevice class¶
RenderDevice
RenderDeviceAbstract base class for a rendering device.
RenderEncoder class¶
RenderEncoder
RenderEncoderAbstract base class representing a rendering encoder.
device function (RenderEncoder::device)¶
virtual RenderDevice *device() const = 0
Returns the rendering device associated with this encoder.
Returns Pointer to the RenderDevice.
visualSettings function (RenderEncoder::visualSettings)¶
virtual VisualSettings visualSettings() const = 0
Gets the visual settings for the encoder.
Returns The visual settings.
setVisualSettings function (RenderEncoder::setVisualSettings)¶
virtual void
setVisualSettings(const VisualSettings &visualSettings) = 0
Sets the visual settings for the encoder.
Param visualSettings The visual settings to apply.
begin function (RenderEncoder::begin)¶
virtual void begin(
Rc<RenderTarget> target,
std::optional<ColorF> clear = Palette::transparent) = 0
Begins the rendering operation.
Param target The render target.
Param clear The clear color. std::nullopt means no clear command is issued.
batch function (RenderEncoder::batch)¶
virtual void batch(std::span<const RenderState> commands,
std::span<const uint32_t> data) = 0
Batches rendering commands.
Param commands The rendering commands.
Param data Associated data.
end function (RenderEncoder::end)¶
virtual void end() = 0
Ends the rendering operation.
wait function (RenderEncoder::wait)¶
virtual void wait() = 0
Waits for the rendering to finish.
currentTarget function (RenderEncoder::currentTarget)¶
virtual Rc<RenderTarget> currentTarget() const = 0
Gets current bound target (the target passed to begin function).
Returns Pointer to the current RenderTarget, or nullptr if begin has not been called or end has
been called.
RenderPipeline class¶
RenderPipeline
RenderPipelineRepresents the rendering pipeline responsible for managing and executing rendering operations.
RenderPipeline function (RenderPipeline::RenderPipeline)¶
RenderPipeline(
Rc<RenderEncoder> encoder, Rc<RenderTarget> target,
std::optional<ColorF> clear = Palette::transparent,
Rectangle clipRect = noClipRect)
Constructs a RenderPipeline with an encoder and target.
Param encoder The render encoder.
Param target The render target.
Param clear Optional clear color for the render target (defaults to transparent); if
std::nullopt is passed, the target is not cleared, enabling blending with previous content.
Param clipRect The clipping rectangle in screen coordinates; use noClipRect to disable clipping.
blit function (RenderPipeline::blit)¶
void blit(Rc<Image> image)
Blits an image to the render target.
Param image The image to blit; its size must match the target size.
~RenderPipeline function (RenderPipeline::~RenderPipeline)¶
~RenderPipeline()
Destroys the RenderPipeline instance.
globalScissor function (RenderPipeline::globalScissor)¶
Rectangle globalScissor() const
Retrieves the current clipping rectangle.
Returns The current clipping rectangle in screen coordinates.
setGlobalScissor function (RenderPipeline::setGlobalScissor)¶
void setGlobalScissor(Rectangle scissorRect) final
Sets the clipping rectangle for rendering operations.
Param scissorRect The new clipping rectangle in screen coordinates (origin at top-left).
command function (RenderPipeline::command)¶
void command(RenderStateEx&& cmd, std::span<const uint32_t> data =
Issues a rendering command.
Param cmd The render state command.
Param data Optional associated data.
numBatches function (RenderPipeline::numBatches)¶
int numBatches() const final
Retrieves the number of batches processed.
Returns The number of batches.
encoder function (RenderPipeline::encoder)¶
Rc<RenderEncoder> encoder() const
Retrieves the render encoder associated with this pipeline.
Returns A reference-counted pointer to the render encoder.
flush function (RenderPipeline::flush)¶
bool flush()
Flushes the pipeline to issue the batched commands.
Returns True if some commands were sent to underlying device.
m_encoder variable (RenderPipeline::m_encoder)¶
Rc<RenderEncoder> m_encoder
The current rendering encoder.
m_limits variable (RenderPipeline::m_limits)¶
RenderLimits m_limits
Resource limits for the pipeline.
m_resources variable (RenderPipeline::m_resources)¶
RenderResources &m_resources
Rendering resources.
m_commands variable (RenderPipeline::m_commands)¶
std::vector<RenderState> m_commands
List of rendering commands queued for execution.
m_data variable (RenderPipeline::m_data)¶
std::vector<uint32_t> m_data
Buffer for associated rendering data.
m_textures variable (RenderPipeline::m_textures)¶
std::vector<Rc<Image>> m_textures
List of textures used in rendering.
m_numBatches variable (RenderPipeline::m_numBatches)¶
int m_numBatches = 0
Number of rendering batches.
m_globalScissor variable (RenderPipeline::m_globalScissor)¶
Rectangle m_globalScissor
The current clipping rectangle.
WindowRenderTarget class¶
WindowRenderTarget
WindowRenderTargetRepresents a render target for window-based rendering.
resizeBackbuffer function (WindowRenderTarget::resizeBackbuffer)¶
virtual void resizeBackbuffer(Size size) = 0
Resizes the backbuffer.
Param size The new size of the backbuffer.
present function (WindowRenderTarget::present)¶
virtual void present() = 0
Presents the rendered frame to the window.
vsyncInterval function (WindowRenderTarget::vsyncInterval)¶
virtual int vsyncInterval() const = 0
Gets the VSync interval.
Returns The VSync interval (0 means no VSync).
setVSyncInterval function (WindowRenderTarget::setVSyncInterval)¶
virtual void setVSyncInterval(int interval) = 0
Sets the VSync interval.
Param interval The VSync interval to set (0 means no VSync).
ImageRenderTarget class¶
ImageRenderTarget
ImageRenderTargetRepresents a render target for image-based rendering.
setSize function (ImageRenderTarget::setSize)¶
virtual void setSize(Size newSize) = 0
Sets the size of the render target.
Param newSize The new size.
image function (ImageRenderTarget::image)¶
virtual Rc<Image> image(bool reset = false) const = 0
Returns the rendered image.
Param reset If true, creates a new image for the target.
Returns The rendered image.
DepthStencilType enum¶
enum class DepthStencilType
DepthStencilTypeDescribes the available depth-stencil buffer formats.
None enumerator (DepthStencilType::None)¶
No depth-stencil buffer.
D24S8 enumerator (DepthStencilType::D24S8)¶
24-bit depth, 8-bit stencil buffer.
D32 enumerator (DepthStencilType::D32)¶
32-bit depth buffer.
NativeWindow class¶
NativeWindow
NativeWindowRepresents a platform-specific window handle.
framebufferSize function (NativeWindow::framebufferSize)¶
virtual Size framebufferSize() const = 0
Returns the size of the framebuffer.
Returns The framebuffer size.
getHandle function (NativeWindow::getHandle)¶
virtual NativeWindowHandle getHandle() const = 0
Gets the native OS window handle.
RenderDeviceError enum¶
enum class RenderDeviceError
RenderDeviceErrorSpecifies the possible errors that can occur in a rendering device.
ShaderError enumerator (RenderDeviceError::ShaderError)¶
Error related to shader compilation.
Unsupported enumerator (RenderDeviceError::Unsupported)¶
The requested operation or feature is unsupported.
InternalError enumerator (RenderDeviceError::InternalError)¶
An internal error occurred in the rendering device.
defaultNames variable¶
template <>
inline constexpr std::initializer_list<
NameValuePair<RenderDeviceError>>
defaultNames<RenderDeviceError>
Default names for rendering device errors.
RenderDevice class¶
RenderDevice
RenderDeviceAbstract base class for a rendering device.
info function (RenderDevice::info)¶
virtual RenderDeviceInfo info() const = 0
Returns information about the rendering device.
Returns RenderDeviceInfo object.
createWindowTarget function (RenderDevice::createWindowTarget)¶
virtual Rc<WindowRenderTarget> createWindowTarget(
const NativeWindow *window,
PixelType type = PixelType::U8Gamma,
DepthStencilType depth = DepthStencilType::None,
int samples = 1) = 0
Creates a render target for a window.
Param window The window to render to.
Param type Pixel type.
Param depth Depth-stencil format.
Param samples Number of samples for multisampling.
Returns The window render target.
createImageTarget function (RenderDevice::createImageTarget)¶
virtual Rc<ImageRenderTarget> createImageTarget(
Size frameSize, PixelType type = PixelType::U8Gamma,
DepthStencilType depth = DepthStencilType::None,
int samples = 1) = 0
Creates a render target for off-screen image rendering.
Param frameSize The size of the image.
Param type Pixel type.
Param depth Depth-stencil format.
Param samples Number of samples for multisampling.
Returns The image render target.
createEncoder function (RenderDevice::createEncoder)¶
virtual Rc<RenderEncoder> createEncoder() = 0
Creates a new render encoder.
Returns The render encoder.
resources function (RenderDevice::resources)¶
virtual RenderResources &resources() = 0
Returns the resources used for rendering.
Returns Reference to RenderResources.
limits function (RenderDevice::limits)¶
virtual RenderLimits limits() const = 0
Returns the rendering limits for the device.
Returns RenderLimits object.
createImageBackend function (RenderDevice::createImageBackend)¶
virtual void createImageBackend(Rc<Image> image) = 0
Creates a backend representation of an image.
Param image The image to create a backend for.
setRenderDeviceSelection function¶
void setRenderDeviceSelection(
RendererBackend backend,
RendererDeviceSelection deviceSelection)
Sets the rendering device selection based on backend and device selection options.
Param backend The rendering backend to use.
Param deviceSelection The device selection criteria.
getRenderDevice function¶
expected<Rc<RenderDevice>, RenderDeviceError> getRenderDevice(NativeDisplayHandle display =
Gets the current rendering device, if available.
Returns Expected object containing the rendering device or an error.
freeRenderDevice function¶
void freeRenderDevice()
Frees the currently allocated rendering device.
createRenderDevice function¶
expected<Rc<RenderDevice>, RenderDeviceError> createRenderDevice(RendererBackend backend,
RendererDeviceSelection deviceSelection,
NativeDisplayHandle display =
Creates a new rendering device with specified backend and device selection criteria.
Param backend The rendering backend to use.
Param deviceSelection The device selection criteria.
Returns Expected object containing the rendering device or an error.
Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/