Make all GLFWView attributes private
This commit is contained in:
committed by
Konstantin Käfer
parent
168d7c4f17
commit
769364c117
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -314,6 +314,11 @@ void GLFWView::setChangeStyleCallback(std::function<void()> callback) {
|
||||
changeStyleCallback = callback;
|
||||
}
|
||||
|
||||
void GLFWView::setShouldClose() {
|
||||
glfwSetWindowShouldClose(window, true);
|
||||
glfwPostEmptyEvent();
|
||||
}
|
||||
|
||||
namespace mbgl {
|
||||
namespace platform {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user