1 #ifndef NTA_WINDOW_H_INCLUDED
2 #define NTA_WINDOW_H_INCLUDED
8 #include "nta/MyEngine.h"
9 #include "nta/Wrapper.h"
32 static WindowID m_keyboard_focus;
33 static std::mutex m_keyboard_mutex;
34 static WindowID m_mouse_focus;
35 static std::mutex m_mouse_mutex;
38 void createWindow(crstring title,
int width,
int height,
int flags = 0);
61 bool hasKeyboardFocus()
const {
return getKeyboardFocus() ==
getID(); }
62 bool hasMouseFocus()
const {
return getMouseFocus() ==
getID(); }
64 void resize(
int width,
int height);
70 static WindowID getKeyboardFocus();
71 static WindowID getMouseFocus();
72 static void setKeyboardFocus(
const WindowID& win);
73 static void setMouseFocus(
const WindowID& win);
75 friend class WindowManager;
79 #endif // NTA_WINDOW_H_INCLUDED
void setDimensions(int width, int height)
updates the window's stored dimensions
std::string m_title
the title of the window
int getWidth() const
returns the width of the window
WindowFlags
Flags used for creating a window.
void resize(int width, int height)
resizes the window
Key for unlocking the GetSDLWindow() "private" function of class Window.
Window()
constructor and destructor
glm::vec2 getDimensions() const
returns the window's dimensions
WindowID getID() const
return the window's id
void swapBuffers() const
updates the screen
SDL_Window * getSDLWindow(GetSDLWindowKey key) const
returns the underlying window
std::string getTitle() const
returns the window's title
SDL_Window * m_window
the window
void createWindow(crstring title, int width, int height, int flags=0)
creates a window
int m_width
the dimensions of the window
int getHeight() const
returns the height of the window