Factory class for creating IRenderer instances. More...
#include <renderer_factory.h>
Static Public Member Functions | |
| static std::unique_ptr< IRenderer > | Create (RendererBackendType type=RendererBackendType::kDefault) |
| Create a renderer instance with the specified backend type. | |
| static bool | IsBackendAvailable (RendererBackendType type) |
| Check if a specific backend type is available in this build. | |
| static const char * | GetBackendName (RendererBackendType type) |
| Get a string name for a backend type. | |
| static RendererBackendType | GetDefaultBackendType () |
| Get the default backend type for this build. | |
Factory class for creating IRenderer instances.
This factory provides a centralized way to create renderer instances based on the desired backend type. It abstracts away the concrete renderer implementations, allowing the application to be configured for different SDL versions at compile time or runtime.
Usage:
Definition at line 45 of file renderer_factory.h.
|
inlinestatic |
Create a renderer instance with the specified backend type.
| type | The desired backend type. If kDefault or kAutoDetect, the factory will use the backend based on build configuration (SDL3 if YAZE_USE_SDL3 is defined, SDL2 otherwise). |
Definition at line 56 of file renderer_factory.h.
References yaze::gfx::kAutoDetect, yaze::gfx::kDefault, yaze::gfx::SDL2, and yaze::gfx::SDL3.
Referenced by main(), and yaze::Controller::OnEntry().
|
inlinestatic |
Check if a specific backend type is available in this build.
| type | The backend type to check. |
Definition at line 92 of file renderer_factory.h.
References yaze::gfx::kAutoDetect, yaze::gfx::kDefault, yaze::gfx::SDL2, and yaze::gfx::SDL3.
|
inlinestatic |
Get a string name for a backend type.
| type | The backend type. |
Definition at line 121 of file renderer_factory.h.
References yaze::gfx::kAutoDetect, yaze::gfx::kDefault, yaze::gfx::SDL2, and yaze::gfx::SDL3.
|
inlinestatic |
Get the default backend type for this build.
Definition at line 141 of file renderer_factory.h.
References yaze::gfx::SDL2, and yaze::gfx::SDL3.