nuclear@11: #include nuclear@11: #include nuclear@11: #include nuclear@11: #include "volray.h" nuclear@11: nuclear@11: class GLView : public QGLWidget { nuclear@11: private: nuclear@11: Q_OBJECT; nuclear@11: nuclear@11: void initializeGL(); nuclear@11: void resizeGL(int xsz, int ysz); nuclear@11: void paintGL(); nuclear@11: nuclear@11: public: nuclear@11: GLView(QWidget *parent = 0); nuclear@11: }; nuclear@11: nuclear@11: nuclear@11: int main(int argc, char **argv) nuclear@11: { nuclear@11: QApplication app(argc, argv); nuclear@11: nuclear@11: QMainWindow win; nuclear@11: GLView glview(&win); nuclear@11: nuclear@11: win.show(); nuclear@11: app.exec(); nuclear@11: } nuclear@11: nuclear@11: nuclear@11: GLView::GLView(QWidget *parent) nuclear@11: : QGLWidget(parent) nuclear@11: { nuclear@11: } nuclear@11: nuclear@11: void GLView::initializeGL() nuclear@11: { nuclear@11: glClearColor(1, 0, 0, 1); nuclear@11: nuclear@11: volray_init(); nuclear@11: } nuclear@11: nuclear@11: void GLView::resizeGL(int xsz, int ysz) nuclear@11: { nuclear@11: volray_resize(xsz, ysz); nuclear@11: } nuclear@11: nuclear@11: void GLView::paintGL() nuclear@11: { nuclear@11: volray_draw(); nuclear@11: }