Qt_OpenGL:纹理映射小测
//.h
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QtOpenGL>
#include <QWidget>
class GLWidget : public QGLWidget
{
Q_OBJECT
public:
explicit GLWidget(QGLWidget *parent = 0);
~GLWidget();
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void keyPressEvent(QKeyEvent *e);
void loadTextures();
bool fullscreen;
GLuint texture[3];
private:
float triangle_rotate;
// float circle_rotate;
// float quads_rotate;
float rotate_angle;
};
#endif // GLWIDGET_H
//.cpp