summaryrefslogtreecommitdiffstats
path: root/examples/qtgl/main.cpp
blob: 308f349f3dc8b470731447450127c0422c5deac2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "myqgl.h"

#include <qapplication.h>
#include <qvbox.h>
#include <qpushbutton.h>

int main(int argc, char **argv)
{
    QApplication a(argc, argv);

    if(!QGLFormat::hasOpenGL())
    {
	tqWarning( "This system has no OpenGL support. Exiting." );
	return -1;
    }

    QVBox *v = new QVBox;
    QPushButton *b = new QPushButton("Show w3.bmp !", v);
    MyQGL *gl = new MyQGL(v);

    QVBox::connect(b, TQ_SIGNAL(clicked()), gl, TQ_SLOT(bind()));

    v->setStretchFactor(gl, 1);

    a.setMainWidget(v);
    v->resize(512, 256);
    v->show();

    return a.exec();
}