The small3d library
Tiny C++ 3D game development library for Win/MacOS/Linux/FreeBSD
Loading...
Searching...
No Matches
Windowing.hpp
Go to the documentation of this file.
1
10#pragma once
11
12#include <GLFW/glfw3.h>
13#ifdef _WIN32
14#define GLFW_EXPOSE_NATIVE_WIN32
15#include <GLFW/glfw3native.h>
16#endif
17
18#include <string>
19
20namespace small3d {
21
27 class Windowing {
28 private:
29 GLFWwindow* window = nullptr;
30
31 static void framebufferSizeCallback(GLFWwindow* window, int width,
32 int height);
33
34 public:
35
40 static int realWindowWidth;
41
46 static int realWindowHeight;
47
54 void initWindow(int& width, int& height,
55 const std::string& windowTitle = "");
56
60 void swapBuffers();
61
65 void terminate();
66
71 GLFWwindow* getWindow();
72
73#ifdef _WIN32
74 HWND getWin32Window();
75#endif
76
77
78 };
79}
Window management class.
Definition Windowing.hpp:27
void initWindow(int &width, int &height, const std::string &windowTitle="")
Initialise the application window.
Definition Windowing.cpp:58
void terminate()
Perform any necessary cleanup actions.
Definition Windowing.cpp:27
static int realWindowHeight
Real window height. It is exposed as public for speed, but it should be treated as read-only.
Definition Windowing.hpp:46
void swapBuffers()
Swap buffers.
Definition Windowing.cpp:22
GLFWwindow * getWindow()
Get the GLFW window used.
Definition Windowing.cpp:33
static int realWindowWidth
Real window width. It is exposed as public for speed, but it should be treated as read-only.
Definition Windowing.hpp:40
Definition BinaryFile.hpp:15