3 #define GLFW_EXPOSE_NATIVE_WIN32 5 #include "util/string.h" 6 #include "util/tuple.h" 8 #include <GLFW/glfw3.h> 9 #include <GLFW/glfw3native.h> 11 #include "win32/key_code.h" 12 #include "win32/keyboard_state.h" 13 #include "win32/mouse_state.h" 14 #include "util/resolution.h" 16 #include <DirectXMath.h> 119 static void GlfwKeyCallback(GLFWwindow* window,
int key,
int scancode,
int action,
int modifiers);
126 static void GlfwCharCallback(GLFWwindow* window,
unsigned int unicode_character);
Resolution max_resolution_
The maximum resolution of the window.
Definition: window.h:172
bool GetWindowFocused() const
Definition: window.cc:129
Image * window_icon_
The currently bound icon.
Definition: window.h:169
void SetWindowTitle(const String &window_title)
Sets the title of the window.
Definition: window.cc:55
static void GlfwKeyCallback(GLFWwindow *window, int key, int scancode, int action, int modifiers)
This is the callback function that is used for key input.
Definition: window.cc:165
static void GlfwFocusCallback(GLFWwindow *window, int focused)
This is the callback function that is used for when the mouse enters/leaves the window.
Definition: window.cc:228
void SetWindowPosition(const DirectX::XMINT2 &window_position)
Sets the position of the window.
Definition: window.cc:70
static void GlfwMouseEnterCallback(GLFWwindow *window, int entered)
This is the callback function that is used for when the mouse enters/leaves the window.
Definition: window.cc:220
bool GetWindowShouldClose()
Definition: window.cc:159
Image * GetWindowIcon() const
Definition: window.cc:123
Class for creating windows.
Definition: window.h:30
KeyboardState & GetKeyboardState()
Definition: window.cc:147
DirectX::XMINT2 GetWindowPosition() const
Definition: window.cc:115
GLFWwindow * window_
The underlying window that GLFW uses.
Definition: window.h:168
Resolution min_resolution_
The minimum resolution of the window.
Definition: window.h:171
String window_title_
The title of window.
Definition: window.h:170
Tuple< Resolution, Resolution > GetWindowSizeLimits() const
Definition: window.cc:109
eastl::tuple< Ts... > Tuple
Typedef for wrapping the EASTL tuple.
Definition: tuple.h:14
static void GlfwCursorPosCallback(GLFWwindow *window, double x, double y)
This is the callback function that is used for mouse movement input.
Definition: window.cc:189
static void GlfwCharCallback(GLFWwindow *window, unsigned int unicode_character)
This is the callback function that is used for character input.
Definition: window.cc:181
static void GlfwScrollCallback(GLFWwindow *window, double x, double y)
This is the callback function that is used for mouse scroll input.
Definition: window.cc:212
Keeps track of the state of the keyboard.
Definition: keyboard_state.h:18
void SetWindowResolution(const Resolution &resolution)
Sets the resolution of the window.
Definition: window.cc:49
eastl::string String
Typedef for wrapping the EASTL string.
Definition: string.h:13
Stores resolution information in pixels.
Definition: resolution.h:12
Resolution GetWindowResolution() const
Definition: window.cc:95
HWND GetWindowHandle() const
Definition: window.cc:135
void Create(const Resolution &resolution, const String &window_title, Image *window_icon=nullptr)
Creates the window. Resolution and window title are required. Window icon is optional.
Definition: window.cc:26
The main Blowbox namespace.
Definition: image.cc:8
String GetWindowTitle() const
Definition: window.cc:103
bool focused_
Whether the window is currently in input focus or not.
Definition: window.h:177
MouseState & GetMouseState()
Definition: window.cc:153
Load and access image files with the use of blowbox::Image.
Definition: image.h:36
void SetWindowSizeLimits(const Resolution &min_resolution, const Resolution &max_resolution)
Sets the size limits of the window.
Definition: window.cc:62
GLFWwindow * GetGLFWWindow()
Definition: window.cc:141
Keeps track of the state of the mouse.
Definition: mouse_state.h:18
void SetWindowIcon(Image *window_icon)
Sets the icon of the window.
Definition: window.cc:76
MouseState mouse_state_
The state of the mouse for this window.
Definition: window.h:175
void Focus()
Makes the window the focus of the input.
Definition: window.cc:89
static void GlfwMouseButtonCallback(GLFWwindow *window, int button, int action, int modifiers)
This is the callback function that is used for mouse movement input.
Definition: window.cc:196
KeyboardState keyboard_state_
The state of the keyboard for this window.
Definition: window.h:174