Make all GLFWView attributes private

This commit is contained in:
Thiago Marcos P. Santos
2015-05-06 16:04:13 +03:00
committed by Konstantin Käfer
parent 168d7c4f17
commit 769364c117
3 changed files with 12 additions and 7 deletions

View File

@@ -29,22 +29,23 @@ public:
// The expected action is to set a new style, different to the current one.
void setChangeStyleCallback(std::function<void()> callback);
void setShouldClose();
void run();
void fps();
GLFWwindow *window = nullptr;
private:
bool fullscreen = false;
bool tracking = false;
bool rotating = false;
double lastX = 0, lastY = 0;
bool tracking = false;
bool rotating = false;
double lastClick = -1;
std::function<void()> changeStyleCallback;
GLFWwindow *window = nullptr;
};
#endif

View File

@@ -23,8 +23,7 @@ std::unique_ptr<GLFWView> view;
void quit_handler(int) {
if (view) {
mbgl::Log::Info(mbgl::Event::Setup, "waiting for quit...");
glfwSetWindowShouldClose(view->window, true);
glfwPostEmptyEvent();
view->setShouldClose();
} else {
exit(0);
}

View File

@@ -314,6 +314,11 @@ void GLFWView::setChangeStyleCallback(std::function<void()> callback) {
changeStyleCallback = callback;
}
void GLFWView::setShouldClose() {
glfwSetWindowShouldClose(window, true);
glfwPostEmptyEvent();
}
namespace mbgl {
namespace platform {