yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::platform::NullWindowBackend Class Reference

Null implementation of the window backend for headless mode. More...

#include <null_window_backend.h>

Inheritance diagram for yaze::platform::NullWindowBackend:
Collaboration diagram for yaze::platform::NullWindowBackend:

Public Member Functions

 NullWindowBackend ()=default
 
 ~NullWindowBackend () override=default
 
absl::Status Initialize (const WindowConfig &config) override
 Initialize the window backend with configuration.
 
absl::Status Shutdown () override
 Shutdown the window backend and release resources.
 
bool IsInitialized () const override
 Check if the backend is initialized.
 
bool PollEvent (WindowEvent &out_event) override
 Poll and process pending events.
 
void ProcessNativeEvent (void *native_event) override
 Process a native SDL event (for ImGui integration)
 
WindowStatus GetStatus () const override
 Get current window status.
 
bool IsActive () const override
 Check if window is still active (not closed)
 
void SetActive (bool active) override
 Set window active state.
 
void GetSize (int *width, int *height) const override
 Get window dimensions.
 
void SetSize (int width, int height) override
 Set window dimensions.
 
std::string GetTitle () const override
 Get window title.
 
void SetTitle (const std::string &title) override
 Set window title.
 
void ShowWindow () override
 Show the window.
 
void HideWindow () override
 Hide the window.
 
bool InitializeRenderer (gfx::IRenderer *renderer) override
 Initialize renderer for this window.
 
SDL_Window * GetNativeWindow () override
 Get the underlying SDL_Window pointer for ImGui integration.
 
absl::Status InitializeImGui (gfx::IRenderer *renderer) override
 Initialize ImGui backends for this window/renderer combo.
 
void ShutdownImGui () override
 Shutdown ImGui backends.
 
void NewImGuiFrame () override
 Start a new ImGui frame.
 
void RenderImGui (gfx::IRenderer *renderer) override
 Render ImGui draw data (and viewports if enabled)
 
uint32_t GetAudioDevice () const override
 Get audio device ID (for legacy audio buffer management)
 
std::shared_ptr< int16_t > GetAudioBuffer () const override
 Get audio buffer (for legacy audio management)
 
std::string GetBackendName () const override
 Get backend name for debugging/logging.
 
int GetSDLVersion () const override
 Get SDL version being used.
 
- Public Member Functions inherited from yaze::platform::IWindowBackend
virtual ~IWindowBackend ()=default
 

Private Attributes

bool initialized_ = false
 
bool active_ = true
 
bool imgui_initialized_ = false
 
int width_ = 1280
 
int height_ = 720
 

Detailed Description

Null implementation of the window backend for headless mode.

Implements IWindowBackend but does nothing or minimal work. Useful for CI, servers, and tests where no window/display is available.

Definition at line 22 of file null_window_backend.h.

Constructor & Destructor Documentation

◆ NullWindowBackend()

yaze::platform::NullWindowBackend::NullWindowBackend ( )
default

◆ ~NullWindowBackend()

yaze::platform::NullWindowBackend::~NullWindowBackend ( )
overridedefault

Member Function Documentation

◆ Initialize()

absl::Status yaze::platform::NullWindowBackend::Initialize ( const WindowConfig & config)
overridevirtual

Initialize the window backend with configuration.

Parameters
configWindow configuration parameters
Returns
Status indicating success or failure

Implements yaze::platform::IWindowBackend.

Definition at line 12 of file null_window_backend.cc.

References active_, yaze::platform::WindowConfig::height, height_, initialized_, LOG_INFO, yaze::platform::WindowConfig::width, and width_.

◆ Shutdown()

absl::Status yaze::platform::NullWindowBackend::Shutdown ( )
overridevirtual

Shutdown the window backend and release resources.

Returns
Status indicating success or failure

Implements yaze::platform::IWindowBackend.

Definition at line 21 of file null_window_backend.cc.

References yaze::gfx::Arena::Get(), imgui_initialized_, initialized_, LOG_INFO, yaze::gfx::Arena::Shutdown(), and ShutdownImGui().

Here is the call graph for this function:

◆ IsInitialized()

bool yaze::platform::NullWindowBackend::IsInitialized ( ) const
inlineoverridevirtual

Check if the backend is initialized.

Implements yaze::platform::IWindowBackend.

Definition at line 33 of file null_window_backend.h.

References initialized_.

◆ PollEvent()

bool yaze::platform::NullWindowBackend::PollEvent ( WindowEvent & out_event)
overridevirtual

Poll and process pending events.

Parameters
out_eventOutput parameter for the next event
Returns
True if an event was available, false otherwise

Implements yaze::platform::IWindowBackend.

Definition at line 36 of file null_window_backend.cc.

◆ ProcessNativeEvent()

void yaze::platform::NullWindowBackend::ProcessNativeEvent ( void * native_event)
overridevirtual

Process a native SDL event (for ImGui integration)

Parameters
native_eventPointer to native SDL_Event

Implements yaze::platform::IWindowBackend.

Definition at line 41 of file null_window_backend.cc.

◆ GetStatus()

WindowStatus yaze::platform::NullWindowBackend::GetStatus ( ) const
overridevirtual

◆ IsActive()

bool yaze::platform::NullWindowBackend::IsActive ( ) const
inlineoverridevirtual

Check if window is still active (not closed)

Implements yaze::platform::IWindowBackend.

Definition at line 39 of file null_window_backend.h.

References active_.

◆ SetActive()

void yaze::platform::NullWindowBackend::SetActive ( bool active)
inlineoverridevirtual

Set window active state.

Implements yaze::platform::IWindowBackend.

Definition at line 40 of file null_window_backend.h.

References active_.

◆ GetSize()

void yaze::platform::NullWindowBackend::GetSize ( int * width,
int * height ) const
overridevirtual

Get window dimensions.

Implements yaze::platform::IWindowBackend.

Definition at line 54 of file null_window_backend.cc.

References height_, and width_.

◆ SetSize()

void yaze::platform::NullWindowBackend::SetSize ( int width,
int height )
overridevirtual

Set window dimensions.

Implements yaze::platform::IWindowBackend.

Definition at line 59 of file null_window_backend.cc.

References height_, and width_.

◆ GetTitle()

std::string yaze::platform::NullWindowBackend::GetTitle ( ) const
inlineoverridevirtual

Get window title.

Implements yaze::platform::IWindowBackend.

Definition at line 44 of file null_window_backend.h.

◆ SetTitle()

void yaze::platform::NullWindowBackend::SetTitle ( const std::string & title)
inlineoverridevirtual

Set window title.

Implements yaze::platform::IWindowBackend.

Definition at line 45 of file null_window_backend.h.

◆ ShowWindow()

void yaze::platform::NullWindowBackend::ShowWindow ( )
inlineoverridevirtual

Show the window.

Implements yaze::platform::IWindowBackend.

Definition at line 47 of file null_window_backend.h.

◆ HideWindow()

void yaze::platform::NullWindowBackend::HideWindow ( )
inlineoverridevirtual

Hide the window.

Implements yaze::platform::IWindowBackend.

Definition at line 48 of file null_window_backend.h.

◆ InitializeRenderer()

bool yaze::platform::NullWindowBackend::InitializeRenderer ( gfx::IRenderer * renderer)
overridevirtual

Initialize renderer for this window.

Parameters
rendererThe renderer to initialize
Returns
True if successful

Implements yaze::platform::IWindowBackend.

Definition at line 64 of file null_window_backend.cc.

◆ GetNativeWindow()

SDL_Window * yaze::platform::NullWindowBackend::GetNativeWindow ( )
inlineoverridevirtual

Get the underlying SDL_Window pointer for ImGui integration.

Returns
Native window handle (SDL_Window*)

Implements yaze::platform::IWindowBackend.

Definition at line 51 of file null_window_backend.h.

◆ InitializeImGui()

absl::Status yaze::platform::NullWindowBackend::InitializeImGui ( gfx::IRenderer * renderer)
overridevirtual

Initialize ImGui backends for this window/renderer combo.

Parameters
rendererThe renderer (for backend-specific init)
Returns
Status indicating success or failure

Implements yaze::platform::IWindowBackend.

Definition at line 69 of file null_window_backend.cc.

References height_, imgui_initialized_, yaze::LoadPackageFonts(), LOG_WARN, and width_.

Here is the call graph for this function:

◆ ShutdownImGui()

void yaze::platform::NullWindowBackend::ShutdownImGui ( )
overridevirtual

Shutdown ImGui backends.

Implements yaze::platform::IWindowBackend.

Definition at line 98 of file null_window_backend.cc.

References imgui_initialized_.

Referenced by Shutdown().

◆ NewImGuiFrame()

void yaze::platform::NullWindowBackend::NewImGuiFrame ( )
overridevirtual

Start a new ImGui frame.

Implements yaze::platform::IWindowBackend.

Definition at line 105 of file null_window_backend.cc.

References height_, imgui_initialized_, and width_.

◆ RenderImGui()

void yaze::platform::NullWindowBackend::RenderImGui ( gfx::IRenderer * renderer)
overridevirtual

Render ImGui draw data (and viewports if enabled)

Parameters
rendererThe renderer to use for drawing (needed to get backend renderer)

Implements yaze::platform::IWindowBackend.

Definition at line 113 of file null_window_backend.cc.

References imgui_initialized_.

◆ GetAudioDevice()

uint32_t yaze::platform::NullWindowBackend::GetAudioDevice ( ) const
inlineoverridevirtual

Get audio device ID (for legacy audio buffer management)

Implements yaze::platform::IWindowBackend.

Definition at line 58 of file null_window_backend.h.

◆ GetAudioBuffer()

std::shared_ptr< int16_t > yaze::platform::NullWindowBackend::GetAudioBuffer ( ) const
inlineoverridevirtual

Get audio buffer (for legacy audio management)

Implements yaze::platform::IWindowBackend.

Definition at line 59 of file null_window_backend.h.

◆ GetBackendName()

std::string yaze::platform::NullWindowBackend::GetBackendName ( ) const
inlineoverridevirtual

Get backend name for debugging/logging.

Implements yaze::platform::IWindowBackend.

Definition at line 61 of file null_window_backend.h.

◆ GetSDLVersion()

int yaze::platform::NullWindowBackend::GetSDLVersion ( ) const
inlineoverridevirtual

Get SDL version being used.

Implements yaze::platform::IWindowBackend.

Definition at line 62 of file null_window_backend.h.

Member Data Documentation

◆ initialized_

bool yaze::platform::NullWindowBackend::initialized_ = false
private

Definition at line 65 of file null_window_backend.h.

Referenced by Initialize(), IsInitialized(), and Shutdown().

◆ active_

bool yaze::platform::NullWindowBackend::active_ = true
private

Definition at line 66 of file null_window_backend.h.

Referenced by GetStatus(), Initialize(), IsActive(), and SetActive().

◆ imgui_initialized_

bool yaze::platform::NullWindowBackend::imgui_initialized_ = false
private

◆ width_

int yaze::platform::NullWindowBackend::width_ = 1280
private

◆ height_

int yaze::platform::NullWindowBackend::height_ = 720
private

The documentation for this class was generated from the following files: