CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
iOSWindow.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
12
13#if defined(__OBJC__)
14#include <UIKit/UIKit.h>
15#include <Metal/Metal.h>
16#endif
17
18namespace CeresEngine {
19
20 class iOSWindow : public PlatformWindow {
21 public:
22 struct Pimpl;
23 friend struct Pimpl;
24
25 private:
28
31
32 public:
34 explicit iOSWindow(const PlatformWindowDescriptor& descriptor);
35 ~iOSWindow() override;
36
37 public:
40
43
44 public:
47
49 void setTitle(const String& title) final;
50
53
55 void resize(double width, double height) final;
56
58 void close() final;
59
62
64 void setFullscreen(bool fullscreen) final;
65
68
69 public:
72#if defined(__OBJC__)
73 using ViewType = UIView*;
74#else
75 using ViewType = void*;
76#endif
77
81
82 protected: // Input forwarding
89 };
90
91} // namespace CeresEngine
A type that describes any possible event type.
Definition InputEvent.hpp:142
Definition PlatformWindow.hpp:44
The infrastructure for drawing and handling events in a UI.
Definition UIView.hpp:153
Definition iOSWindow.hpp:20
void deactivate() final
iOSWindow(const PlatformWindowDescriptor &descriptor)
void forwardEvent(AnyInputEvent &&event)
Forwards an event received by the window to the attached input provider.
void setTitle(const String &title) final
Vector2 getSize() const final
PlatformWindowProperties mProperties
Definition iOSWindow.hpp:30
UPtr< Pimpl > m
The pointer-to-implementation.
Definition iOSWindow.hpp:27
bool isFullscreen() const final
String getTitle() const final
ViewType getView() const
Gets the Cocoa content view.
friend struct Pimpl
Definition iOSWindow.hpp:23
void * ViewType
A type that represents the NSView* when compiled for Objective-C or a void* when compiled for pure C+...
Definition iOSWindow.hpp:75
void setFullscreen(bool fullscreen) final
double getScalingFactor() const final
iOSWindow()
Definition iOSWindow.hpp:33
void resize(double width, double height) final
Definition Application.hpp:19
std::unique_ptr< T, Deleter > UPtr
UPtr is a smart pointer that owns and manages another object through a pointer and disposes of that o...
Definition SmartPtr.hpp:28
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
A structure that describes how to create a new window.
Definition PlatformWindow.hpp:24
A structure that contains the state and settings for the window.
Definition PlatformWindow.hpp:33