CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
MacOSWindow.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
10#include "Forward.hpp"
11
14
15#if defined(__OBJC__)
16#include <AppKit/AppKit.h>
17#include <Metal/Metal.h>
18#endif
19
20namespace CeresEngine {
21
22 class MacOSWindow : public PlatformWindow {
23 public:
24 struct Pimpl;
25 friend struct Pimpl;
26
27 private:
30
33
34 public:
36 explicit MacOSWindow(const PlatformWindowDescriptor& descriptor);
37 ~MacOSWindow() override;
38
39 public:
42
45
46 public:
49
51 void setTitle(const String& title) final;
52
55
57 void resize(double width, double height) final;
58
60 void close() final;
61
64
66 void setFullscreen(bool fullscreen) final;
67
70
71 public:
74#if defined(__OBJC__)
75 using ViewType = NSView*;
76#else
77 using ViewType = void*;
78#endif
79
83
84 protected: // Input forwarding
91 };
92
93} // namespace CeresEngine
A type that describes any possible event type.
Definition InputEvent.hpp:142
Definition MacOSWindow.hpp:22
MacOSWindow()
Definition MacOSWindow.hpp:35
ViewType getView() const
Gets the Cocoa content view.
UPtr< Pimpl > m
The pointer-to-implementation.
Definition MacOSWindow.hpp:29
void resize(double width, double height) final
Vector2 getSize() const final
PlatformWindowProperties mProperties
Definition MacOSWindow.hpp:32
void setTitle(const String &title) final
MacOSWindow(const PlatformWindowDescriptor &descriptor)
double getScalingFactor() const final
friend struct Pimpl
Definition MacOSWindow.hpp:25
void setFullscreen(bool fullscreen) final
bool isFullscreen() const final
void forwardEvent(AnyInputEvent &&event)
Forwards an event received by the window to the attached input provider.
String getTitle() const final
void * ViewType
A type that represents the NSView* when compiled for Objective-C or a void* when compiled for pure C+...
Definition MacOSWindow.hpp:77
Definition PlatformWindow.hpp:44
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