CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Platform.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
15namespace CeresEngine {
16
17 class Engine;
18 class FilePath;
19
20 class Platform {
21 public:
24
27
28 public: // Main Run Loop
30 virtual void run() = 0;
31
33 virtual void stop() = 0;
34
35 public:
41
42 public: // Queues
45
46 public: // File system
57
68 };
69
70} // namespace CeresEngine
An object that manages the execution of tasks serially or concurrently on your app's main thread or o...
Definition DispatchQueue.hpp:36
Definition Engine.hpp:38
Handle for a file or directory.
Definition FileHandle.hpp:46
Path to file or directory.
Definition FilePath.hpp:37
Interface for accessing file systems.
Definition FileSystem.hpp:28
Definition Platform.hpp:20
virtual FileHandle openFile(const FilePath &path) const
Opens a file on the local file system.
virtual ~Platform() noexcept
virtual UPtr< PlatformWindow > createWindow(const PlatformWindowDescriptor &descriptor)=0
Creates a new platform window.
Platform(Engine &engine)
virtual void run()=0
Starts running the main application run loop.
virtual UPtr< DispatchQueue > createDispatchQueue(DispatchQueueType type, StringView name="")=0
Creates a new queue to which you can submit blocks.
static Platform & get() noexcept
Gets the current platform. Assets if no platform was initialized.
virtual IFileSystem * getLocalFileSystem() const
Gets the underlying platform local file system implementation.
virtual void stop()=0
Requests the application to stop running.
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
DispatchQueueType
Specifies the type of the queue.
Definition DispatchQueue.hpp:17
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