qvolray
view src/main.cc @ 11:8990b5d2c7fe
moving to qt
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 09 Apr 2012 23:42:57 +0300 |
parents | |
children | 17d9dc2edc91 |
line source
1 #include <QApplication>
2 #include <QMainWindow>
3 #include <QGLWidget>
4 #include "volray.h"
6 class GLView : public QGLWidget {
7 private:
8 Q_OBJECT;
10 void initializeGL();
11 void resizeGL(int xsz, int ysz);
12 void paintGL();
14 public:
15 GLView(QWidget *parent = 0);
16 };
19 int main(int argc, char **argv)
20 {
21 QApplication app(argc, argv);
23 QMainWindow win;
24 GLView glview(&win);
26 win.show();
27 app.exec();
28 }
31 GLView::GLView(QWidget *parent)
32 : QGLWidget(parent)
33 {
34 }
36 void GLView::initializeGL()
37 {
38 glClearColor(1, 0, 0, 1);
40 volray_init();
41 }
43 void GLView::resizeGL(int xsz, int ysz)
44 {
45 volray_resize(xsz, ysz);
46 }
48 void GLView::paintGL()
49 {
50 volray_draw();
51 }