00001 #ifndef GLWIDGET_H 00002 #define GLWIDGET_H 00003 00004 #include <QtOpenGL/QGLWidget> 00005 #include <GL/gl.h> 00006 00007 class GLwidget : public QGLWidget 00008 { 00009 protected: 00010 void initializeGL(); 00011 void paintGL(); 00012 void resizeGL(int w, int h); 00013 public: 00014 GLwidget(const QGLFormat &format, QWidget *parent = 0); 00015 ~GLwidget(); 00016 void loadTexture(int w, int h, unsigned char *texture_data); 00017 private: 00018 GLuint tex; 00019 }; 00020 00021 #endif // GLWIDGET_H