yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
ios_window_backend.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5
6#include "absl/status/status.h"
8
9namespace yaze {
10namespace platform {
11
12class IOSWindowBackend final : public IWindowBackend {
13 public:
14 IOSWindowBackend() = default;
15 ~IOSWindowBackend() override = default;
16
17 absl::Status Initialize(const WindowConfig& config) override;
18 absl::Status Shutdown() override;
19 bool IsInitialized() const override;
20
21 bool PollEvent(WindowEvent& out_event) override;
22 void ProcessNativeEvent(void* native_event) override;
23
24 WindowStatus GetStatus() const override;
25 bool IsActive() const override;
26 void SetActive(bool active) override;
27 void GetSize(int* width, int* height) const override;
28 void SetSize(int width, int height) override;
29 std::string GetTitle() const override;
30 void SetTitle(const std::string& title) override;
31 void ShowWindow() override;
32 void HideWindow() override;
33
34 bool InitializeRenderer(gfx::IRenderer* renderer) override;
35 SDL_Window* GetNativeWindow() override;
36
37 absl::Status InitializeImGui(gfx::IRenderer* renderer) override;
38 void ShutdownImGui() override;
39 void NewImGuiFrame() override;
40 void RenderImGui(gfx::IRenderer* renderer) override;
41
42 uint32_t GetAudioDevice() const override;
43 std::shared_ptr<int16_t> GetAudioBuffer() const override;
44
45 std::string GetBackendName() const override;
46 int GetSDLVersion() const override;
47
48 private:
49 bool initialized_ = false;
50 bool imgui_initialized_ = false;
52 std::string title_;
53 void* metal_view_ = nullptr;
54 void* command_queue_ = nullptr;
55};
56
57} // namespace platform
58} // namespace yaze
Defines an abstract interface for all rendering operations.
Definition irenderer.h:60
bool IsInitialized() const override
Check if the backend is initialized.
void ProcessNativeEvent(void *native_event) override
Process a native SDL event (for ImGui integration)
std::shared_ptr< int16_t > GetAudioBuffer() const override
Get audio buffer (for legacy audio management)
absl::Status InitializeImGui(gfx::IRenderer *renderer) override
Initialize ImGui backends for this window/renderer combo.
std::string GetBackendName() const override
Get backend name for debugging/logging.
~IOSWindowBackend() override=default
bool PollEvent(WindowEvent &out_event) override
Poll and process pending events.
absl::Status Initialize(const WindowConfig &config) override
Initialize the window backend with configuration.
bool IsActive() const override
Check if window is still active (not closed)
void RenderImGui(gfx::IRenderer *renderer) override
Render ImGui draw data (and viewports if enabled)
bool InitializeRenderer(gfx::IRenderer *renderer) override
Initialize renderer for this window.
void SetTitle(const std::string &title) override
Set window title.
uint32_t GetAudioDevice() const override
Get audio device ID (for legacy audio buffer management)
SDL_Window * GetNativeWindow() override
Get the underlying SDL_Window pointer for ImGui integration.
std::string GetTitle() const override
Get window title.
void HideWindow() override
Hide the window.
absl::Status Shutdown() override
Shutdown the window backend and release resources.
void SetActive(bool active) override
Set window active state.
void GetSize(int *width, int *height) const override
Get window dimensions.
void ShutdownImGui() override
Shutdown ImGui backends.
void SetSize(int width, int height) override
Set window dimensions.
void NewImGuiFrame() override
Start a new ImGui frame.
int GetSDLVersion() const override
Get SDL version being used.
void ShowWindow() override
Show the window.
WindowStatus GetStatus() const override
Get current window status.
Abstract window backend interface.
Definition iwindow.h:116
Window configuration parameters.
Definition iwindow.h:24
Platform-agnostic window event data.
Definition iwindow.h:65
Window backend status information.
Definition iwindow.h:98