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
30 initialized_ = true;
31 LOG_INFO("IOSHost", "Initialized iOS host");
32 return absl::OkStatus();
33#else
34 return absl::FailedPreconditionError("IOSHost only available on iOS");
35#endif
36}
37
39 if (!initialized_) {
40 return;
41 }
43}
44
46 if (!initialized_) {
47 return;
48 }
50 initialized_ = false;
51}
52
53void IOSHost::SetMetalView(void* view) {
54 metal_view_ = view;
56}
57
58void* IOSHost::GetMetalView() const {
59 return metal_view_;
60}
61
62} // 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:53
IOSHostConfig config_
Definition ios_host.h:29
void * GetMetalView() const
Definition ios_host.mm:58
#define LOG_INFO(category, format,...)
Definition log.h:105
void SetMetalView(void *view)