Null implementation of the renderer for headless mode. More...
#include <null_renderer.h>


Public Member Functions | |
| NullRenderer ()=default | |
| ~NullRenderer () override=default | |
| bool | Initialize (SDL_Window *window) override |
| Initializes the renderer with a given window. | |
| void | Shutdown () override |
| Shuts down the renderer and releases all associated resources. | |
| TextureHandle | CreateTexture (int width, int height) override |
| Creates a new, empty texture. | |
| TextureHandle | CreateTextureWithFormat (int width, int height, uint32_t format, int access) override |
| Creates a new texture with a specific pixel format. | |
| void | UpdateTexture (TextureHandle texture, const Bitmap &bitmap) override |
| Updates a texture with the pixel data from a Bitmap. | |
| void | DestroyTexture (TextureHandle texture) override |
| Destroys a texture and frees its associated resources. | |
| bool | LockTexture (TextureHandle texture, SDL_Rect *rect, void **pixels, int *pitch) override |
| void | UnlockTexture (TextureHandle texture) override |
| void | Clear () override |
| Clears the entire render target with the current draw color. | |
| void | Present () override |
| Presents the back buffer to the screen, making the rendered content visible. | |
| void | RenderCopy (TextureHandle texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect) override |
| Copies a portion of a texture to the current render target. | |
| void | SetRenderTarget (TextureHandle texture) override |
| Sets the render target for subsequent drawing operations. | |
| void | SetDrawColor (SDL_Color color) override |
| Sets the color used for drawing operations (e.g., Clear). | |
| void * | GetBackendRenderer () override |
| Provides an escape hatch to get the underlying, concrete renderer object. | |
Public Member Functions inherited from yaze::gfx::IRenderer | |
| virtual | ~IRenderer ()=default |
Null implementation of the renderer for headless mode.
Definition at line 16 of file null_renderer.h.
|
default |
|
overridedefault |
|
inlineoverridevirtual |
Initializes the renderer with a given window.
| window | A pointer to the SDL_Window to render into. |
Implements yaze::gfx::IRenderer.
Definition at line 21 of file null_renderer.h.
References LOG_INFO.
|
inlineoverridevirtual |
Shuts down the renderer and releases all associated resources.
Implements yaze::gfx::IRenderer.
Definition at line 26 of file null_renderer.h.
References LOG_INFO.
|
inlineoverridevirtual |
Creates a new, empty texture.
| width | The width of the texture in pixels. |
| height | The height of the texture in pixels. |
Implements yaze::gfx::IRenderer.
Definition at line 30 of file null_renderer.h.
|
inlineoverridevirtual |
Creates a new texture with a specific pixel format.
| width | The width of the texture in pixels. |
| height | The height of the texture in pixels. |
| format | The SDL pixel format (e.g., SDL_PIXELFORMAT_ARGB8888). |
| access | The texture access pattern (e.g., SDL_TEXTUREACCESS_STREAMING). |
Implements yaze::gfx::IRenderer.
Definition at line 34 of file null_renderer.h.
|
inlineoverridevirtual |
Updates a texture with the pixel data from a Bitmap.
| texture | The handle of the texture to update. |
| bitmap | The Bitmap containing the new pixel data. |
Implements yaze::gfx::IRenderer.
Definition at line 40 of file null_renderer.h.
|
inlineoverridevirtual |
Destroys a texture and frees its associated resources.
| texture | The handle of the texture to destroy. |
Implements yaze::gfx::IRenderer.
Definition at line 44 of file null_renderer.h.
|
inlineoverridevirtual |
Implements yaze::gfx::IRenderer.
Definition at line 48 of file null_renderer.h.
|
inlineoverridevirtual |
Implements yaze::gfx::IRenderer.
Definition at line 53 of file null_renderer.h.
|
inlineoverridevirtual |
Clears the entire render target with the current draw color.
Implements yaze::gfx::IRenderer.
Definition at line 57 of file null_renderer.h.
|
inlineoverridevirtual |
Presents the back buffer to the screen, making the rendered content visible.
Implements yaze::gfx::IRenderer.
Definition at line 61 of file null_renderer.h.
|
inlineoverridevirtual |
Copies a portion of a texture to the current render target.
| texture | The source texture handle. |
| srcrect | A pointer to the source rectangle, or nullptr for the entire texture. |
| dstrect | A pointer to the destination rectangle, or nullptr for the entire render target. |
Implements yaze::gfx::IRenderer.
Definition at line 65 of file null_renderer.h.
|
inlineoverridevirtual |
Sets the render target for subsequent drawing operations.
| texture | The texture to set as the render target, or nullptr to set it back to the default (the window). |
Implements yaze::gfx::IRenderer.
Definition at line 70 of file null_renderer.h.
|
inlineoverridevirtual |
Sets the color used for drawing operations (e.g., Clear).
| color | The SDL_Color to use. |
Implements yaze::gfx::IRenderer.
Definition at line 74 of file null_renderer.h.
|
inlineoverridevirtual |
Provides an escape hatch to get the underlying, concrete renderer object.
This is necessary for integrating with third-party libraries like ImGui that are tied to a specific rendering backend (e.g., SDL_Renderer*, ID3D11Device*).
Implements yaze::gfx::IRenderer.
Definition at line 78 of file null_renderer.h.