JNGL
window.hpp
Go to the documentation of this file.
1 // Copyright 2012-2020 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 <string>
10 
11 namespace jngl {
12 
14 void showWindow(const std::string& title, int width, int height, bool fullscreen = false,
15  std::pair<int, int> minAspectRatio = { 4, 3 },
16  std::pair<int, int> maxAspectRatio = { 16, 9 });
17 
19 void hideWindow();
20 
23 
26 
29 
32 
35 
37 void setFullscreen(bool);
38 
40 void setTitle(const std::string& title);
41 
42 } // namespace jngl
std::string
std::pair
jngl::getFullscreen
bool getFullscreen()
If the window is displayed fullscreen (always true on mobile devices)
jngl::getWindowWidth
int getWindowWidth()
Returns the width of the window in actual pixels (i.e. ignoring jngl::getScaleFactor)
jngl::setTitle
void setTitle(const std::string &title)
Sets the main window title.
jngl
JNGL's main namespace.
Definition: App.hpp:9
jngl::getDesktopHeight
int getDesktopHeight()
Returns the height of the main display in actual pixels.
jngl::setFullscreen
void setFullscreen(bool)
Toggle fullscreen window mode.
jngl::showWindow
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.
jngl::getWindowHeight
int getWindowHeight()
Returns the height of the window in actual pixels (i.e. ignoring jngl::getScaleFactor)
jngl::getDesktopWidth
int getDesktopWidth()
Returns the width of the main display in actual pixels.
string
jngl::hideWindow
void hideWindow()
Cleans up the window and unloads everything.