Qt 5.10 Book Examples
OGLPyramid.h
Go to the documentation of this file.
1 // ======================================================================
2 // OGLPyramid.h
3 // ======================================================================
4 // This file is a part of the book
5 // "Qt 5.10 Professional programming with C++"
6 // http://qt-book.com
7 // ======================================================================
8 // Copyright (c) 2017 by Max Schlee
9 // ======================================================================
10 
11 #pragma once
12 
13 #include <QOpenGLWidget>
14 
15 // ======================================================================
16 class OGLPyramid : public QOpenGLWidget {
17 private:
18  GLuint m_nPyramid;
19  GLfloat m_xRotate;
20  GLfloat m_yRotate;
21  QPoint m_ptPosition;
22 
23 protected:
24  virtual void initializeGL ( );
25  virtual void resizeGL (int nWidth, int nHeight);
26  virtual void paintGL ( );
27  virtual void mousePressEvent(QMouseEvent* pe );
28  virtual void mouseMoveEvent (QMouseEvent* pe );
29  GLuint createPyramid (GLfloat fSize = 1.0f );
30 
31 public:
32  OGLPyramid(QWidget* pwgt = 0);
33 };
34 
OGLPyramid(QWidget *pwgt=0)
Definition: OGLPyramid.cpp:16
virtual void mousePressEvent(QMouseEvent *pe)
Definition: OGLPyramid.cpp:59
virtual void mouseMoveEvent(QMouseEvent *pe)
Definition: OGLPyramid.cpp:65
virtual void initializeGL()
Definition: OGLPyramid.cpp:23
GLuint createPyramid(GLfloat fSize=1.0f)
Definition: OGLPyramid.cpp:75
virtual void resizeGL(int nWidth, int nHeight)
Definition: OGLPyramid.cpp:35
virtual void paintGL()
Definition: OGLPyramid.cpp:44