First version that actually draws a sphere
[agianapa.git] / qt / sphere-quadstrips / myglwidget.h
blob9825dcdc73667a423c3742f092a95e3aaef1bae3
1 #ifndef MYGLWIDGET_H
2 #define MYGLWIDGET_H
4 #include <QGLWidget>
5 #include <QKeyEvent>
7 class MyGLWidget : public QGLWidget
9 Q_OBJECT
11 public:
12 MyGLWidget(QWidget *parent = 0);
13 ~MyGLWidget();
15 public slots:
16 void setNumOfVertices(int dir);
17 void rotateX(GLfloat angle);
18 void rotateY(GLfloat angle);
19 void rotateZ(GLfloat angle);
21 protected:
22 void initializeGL();
23 void paintGL();
24 void resizeGL(int width, int height);
26 private:
27 void drawAxis(void);
28 void drawSphere(GLuint nStacks, GLuint nSlices, GLfloat radius);
29 unsigned int numVertices;
30 GLfloat xRot;
31 GLfloat yRot;
32 GLfloat zRot;
35 #endif // MYGLWIDGET