JNGL
window.hpp
Go to the documentation of this file.
1 // Copyright 2012-2021 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
3 
6 
7 #pragma once
8 
9 #include "Pixels.hpp"
10 
11 #include <array>
12 #include <string>
13 
14 namespace jngl {
15 
17 void showWindow(const std::string& title, int width, int height, bool fullscreen = false,
18  std::pair<int, int> minAspectRatio = { 4, 3 },
19  std::pair<int, int> maxAspectRatio = { 16, 9 });
20 
22 void hideWindow();
23 
26 
29 
32 
35 
38 
41 
43 void setFullscreen(bool);
44 
46 void setTitle(const std::string& title);
47 
48 } // namespace jngl
Contains jngl::Pixels class.
JNGL's main namespace.
Definition: App.hpp:10
int getWindowHeight()
Returns the height of the window in actual pixels (i.e. ignoring jngl::getScaleFactor)
bool getFullscreen()
If the window is displayed fullscreen (always true on mobile devices)
void hideWindow()
Cleans up the window and unloads everything.
void setFullscreen(bool)
Toggle fullscreen window mode.
void showWindow(const std::string &title, int width, int height, bool fullscreen=false, std::pair< int, int > minAspectRatio={ 4, 3 }, std::pair< int, int > maxAspectRatio={ 16, 9 })
Creates the main window.
int getDesktopHeight()
Returns the height of the main display in actual pixels.
void setTitle(const std::string &title)
Sets the main window title.
std::array< Pixels, 2 > getWindowSize()
Returns {width, height} of the window in actual pixels.
int getDesktopWidth()
Returns the width of the main display in actual pixels.
int getWindowWidth()
Returns the width of the window in actual pixels (i.e. ignoring jngl::getScaleFactor)