qmlfrontend/game_view.h
changeset 14717 57293f34ce59
parent 14295 92e5682810d4
child 14718 cc6ab1e3f7d5
--- a/qmlfrontend/game_view.h	Fri Mar 22 22:26:41 2019 +0300
+++ b/qmlfrontend/game_view.h	Fri Mar 22 21:06:12 2019 +0100
@@ -13,15 +13,15 @@
 class GameViewRenderer : public QObject, protected QOpenGLFunctions {
   Q_OBJECT
  public:
-  GameViewRenderer();
-  ~GameViewRenderer();
+  explicit GameViewRenderer();
+  ~GameViewRenderer() override;
 
   void tick(quint32 delta);
-  void setViewportSize(const QSize& size);
   void setEngineInstance(EngineInstance* engineInstance);
 
  public slots:
   void paint();
+  void onViewportSizeChanged(QQuickWindow* window);
 
  private:
   quint32 m_delta;
@@ -35,7 +35,7 @@
                  setEngineInstance NOTIFY engineInstanceChanged)
 
  public:
-  GameView();
+  explicit GameView();
 
   Q_INVOKABLE void tick(quint32 delta);
 
@@ -56,9 +56,8 @@
   quint32 m_delta;
   QScopedPointer<GameViewRenderer> m_renderer;
   bool m_windowChanged;
-  qint32 m_centerX;
-  qint32 m_centerY;
   QPointer<EngineInstance> m_engineInstance;
+  QSize m_viewportSize;
 };
 
 #endif  // GAMEVIEW_H