SimpleGL  1.1.0
A framework for platform independent rendering
glfw_window.hpp
Go to the documentation of this file.
1 
8 #ifndef GLFW_WINDOW_HPP
9 #define GLFW_WINDOW_HPP
10 
11 #include "SimpleGL_Export.h"
12 
13 #include <string>
14 
15 #define GLFW_INCLUDE_NONE
16 #include <GLFW/glfw3.h>
17 
18 #include <glm/glm.hpp>
19 
20 #include "glfw_callback.hpp"
21 
22 namespace sgl {
23 
29  class SIMPLEGL_EXPORT Window {
30 
31  protected:
33  GLFWwindow* handle;
34 
36  glm::ivec2 size;
37 
39  std::string title;
40 
42  Window(void);
43 
44  public:
46  ~Window(void);
47 
53  GLFWwindow* getHandle();
54 
60  int getWidth();
61 
67  void setWidth(int width);
68 
74  int getHeight();
75 
81  void setHeight(int height);
82 
88  glm::ivec2 getSize();
89 
95  void setSize(glm::ivec2 size);
96 
102  std::string getTitle();
103 
109  void setTitle(std::string title);
110 
112  void showInfoTitle();
113 
115  void centerWindow();
116 
122  void setKeyCallback(KeyCallback* callback);
123 
129  void setMouseButtonCallback(MouseButtonCallback* callback);
130 
132  virtual void swapBuffers() = 0;
133 
135  void update();
136 
142  bool shouldClose();
143 
149  void sync(int fps);
150 
156  glm::dvec2 getCursorPos();
157 
163  double getCursorX();
164 
170  double getCursorY();
171  };
172 }
173 
174 #endif /* GLFW_WINDOW_HPP */
This class provides a basic GLFW window.
Definition: glfw_window.hpp:29
Generic namespace for the SimpleGL framework.
Definition: application.hpp:18
This class wraps a GLFW mouse button callback.
This class wraps a GLFW key callback.
GLFWwindow * handle
The handle for the GLFW window.
Definition: glfw_window.hpp:33
std::string title
The title for the GLFW window.
Definition: glfw_window.hpp:39
glm::ivec2 size
The size of the drawing area.
Definition: glfw_window.hpp:36