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
32 bool InitializeRenderer(gfx::IRenderer* renderer) override;
33 SDL_Window* GetNativeWindow() override;
34
35 absl::Status InitializeImGui(gfx::IRenderer* renderer) override;
36 void ShutdownImGui() override;
37 void NewImGuiFrame() override;
38 void RenderImGui(gfx::IRenderer* renderer) override;
39
40 uint32_t GetAudioDevice() const override;
41 std::shared_ptr<int16_t> GetAudioBuffer() const override;
42
43 std::string GetBackendName() const override;
44 int GetSDLVersion() const override;
45
46 private:
47 bool initialized_ = false;
48 bool imgui_initialized_ = false;
50 std::string title_;
51 void* metal_view_ = nullptr;
52 void* command_queue_ = nullptr;
53};
54
55} // namespace platform
56} // namespace yaze
Defines an abstract interface for all rendering operations.
Definition irenderer.h:40
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.
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.
WindowStatus GetStatus() const override
Get current window status.
Abstract window backend interface.
Definition iwindow.h:114
Window configuration parameters.
Definition iwindow.h:24
Platform-agnostic window event data.
Definition iwindow.h:63
Window backend status information.
Definition iwindow.h:96