Optibits
Loading...
Searching...
No Matches
OptiWindow.hpp
1#pragma once
2
3
4#include <Optibits/Fwd.hpp>
5#include <Optibits/Input.hpp>
6#include <Optibits/Platform.hpp>
7#include <Optibits/Utility.hpp>
8#include <memory>
9#include <string>
10
11struct SDL_Window;
12
13namespace Optibits
14{
15
16 enum WindowFlags
17 {
18 WF_WINDOWED,
19 WF_FULLSCREEN = 1,
20 WF_RESIZABLE = 2,
21 WF_BORDERLES = 3
22 };
23
24
25 class OptiWindow : private Noncopyable
26 {
27
28 struct Impl;
29 std::unique_ptr<Impl> mImpl;
30
31 public:
32
33 OptiWindow(int width, int height, unsigned windowFlags = WF_WINDOWED,
34 double updateIntrv = 16.666666);
35
36 virtual ~OptiWindow();
37
38 int width() const;
39 int height() const;
40 bool fullscreen() const;
41 void resize(int width, int height, int fullscreen);
42
43 bool borderless() const;
44 void setBorderless(bool borderless);
45
46 bool resizable() const;
47 void setResizable(bool resizable);
48
49#ifndef OPTIBITS_IPHONE
50 SDL_Window* sdlWindow() const;
51#endif
52 };
53
54 /* Resolution */
55
56 // (in pixels)
57 int screenWidth(const OptiWindow* window = nullptr);
58 int screenHeight(const OptiWindow* window = nullptr);
59
60 // (in 'points')
61 int availableWidth(const OptiWindow* window = nullptr);
62 int availableHeight(const OptiWindow* window = nullptr);
63
64 /* End Resolution */
65
66}
Definition Utility.hpp:24
Definition OptiWindow.hpp:26
Definition OptiWindow.cpp:8