yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
ios_host.mm
Go to the documentation of this file.
2
3#if defined(__APPLE__)
4#include <TargetConditionals.h>
5#endif
6
7#if defined(__APPLE__) && (TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1)
8#import <MetalKit/MetalKit.h>
9#endif
10
12#include "util/log.h"
13
14namespace yaze::ios {
15
19
20absl::Status IOSHost::Initialize(const IOSHostConfig& config) {
21 config_ = config;
22
23#if defined(__APPLE__) && (TARGET_OS_IPHONE == 1 || TARGET_IPHONE_SIMULATOR == 1)
24 if (!metal_view_) {
25 return absl::FailedPreconditionError("Metal view not attached");
26 }
27
29 initialized_ = true;
30 LOG_INFO("IOSHost", "Initialized iOS host (stub)");
31 return absl::OkStatus();
32#else
33 return absl::FailedPreconditionError("IOSHost only available on iOS");
34#endif
35}
36
38 if (!initialized_) {
39 return;
40 }
42}
43
45 if (!initialized_) {
46 return;
47 }
49 initialized_ = false;
50}
51
52void IOSHost::SetMetalView(void* view) {
53 metal_view_ = view;
55}
56
57void* IOSHost::GetMetalView() const {
58 return metal_view_;
59}
60
61} // namespace yaze::ios
static Application & Instance()
void Initialize(const AppConfig &config)
absl::Status Initialize(const IOSHostConfig &config)
Definition ios_host.mm:20
void SetMetalView(void *view)
Definition ios_host.mm:52
IOSHostConfig config_
Definition ios_host.h:29
void * GetMetalView() const
Definition ios_host.mm:57
#define LOG_INFO(category, format,...)
Definition log.h:105
void SetMetalView(void *view)