TeaPacket v0.0.1
Multiplatform Game Engine
Loading...
Searching...
No Matches
Display.hpp
Go to the documentation of this file.
1#pragma once
2#include <string>
3#include <vector>
4#include "Platform/Graphics/PlatformDisplay.hpp"
6
7
9{
11
15 class Display
16 {
17 public:
18 unsigned short width;
19 unsigned short height;
20 std::string name;
21
24
25 PlatformDisplay platformDisplay;
26
27 bool Resize(unsigned short newWidth, unsigned short newHeight);
28
31
34
35 private:
37
38 Display(unsigned short width, unsigned short height, const std::string& name);
39
40 bool Pl_Resize(unsigned short newWidth, unsigned short newHeight);
41 void Pl_PresentDisplay();
42
44 void Pl_DeInitialize();
45 public:
47 inline static std::vector<Display> Displays = std::vector<Display>();
48
50
60 static Display* RegisterDisplay(unsigned short width = 0, unsigned short height = 0, const std::string& name = "Window");
61
62 private:
64 static Display Pl_RegisterDisplay(unsigned short width, unsigned short height, const std::string& name, bool* success);
65 };
66}
bool Resize(unsigned short newWidth, unsigned short newHeight)
Viewport viewport
The contained viewport of the Display. Render to the viewport to render to the Display.
Definition Display.hpp:23
void PresentDisplay()
Present and update all changes made to the contained Viewport (via rendering).
void DeInitialize()
De-initializes the Display and its graphics.
static Display * RegisterDisplay(unsigned short width=0, unsigned short height=0, const std::string &name="Window")
Registers a new display.
unsigned short height
Height of the Display in pixels.
Definition Display.hpp:19
PlatformDisplay platformDisplay
Private platform-dependent data.
Definition Display.hpp:25
unsigned short width
Width of the Display in pixels.
Definition Display.hpp:18
std::string name
Name of the display. Will be shown to the user on platforms that allow.
Definition Display.hpp:20
static std::vector< Display > Displays
A list of all displays in existence. Displays MUST be registered to this list upon creation.
Definition Display.hpp:47
Represents a singular renderable area. These can be used as textures, or blit to Displays to present ...
Definition Viewport.hpp:13
Functionality relating to drawing graphics to the screen.
Definition Display.hpp:9