source: GTP/trunk/Lib/Vis/QtRenderer/QtGlRendererDll.cpp @ 1156

Revision 1156, 1.2 KB checked in by mattausch, 18 years ago (diff)
Line 
1#include "QtGlRenderer.h"
2#include "Preprocessor.h"
3
4namespace GtpVisibilityPreprocessor {
5
6QApplication *app = NULL;
7//QtGlRendererWidget *rendererWidget = NULL;
8//QtGlDebuggerWidget *debuggerWidget = NULL;
9
10//-----------------------------------------------------------------------
11extern "C"  __declspec(dllexport) GlRendererWidget *LoadRenderWidget(Preprocessor *p)
12{
13        int argc = 0;
14        // create a qt application first (must be created before any opengl widget ...)
15        app = new QApplication(argc, NULL);
16
17        if (!QGLFormat::hasOpenGL() || !QGLPixelBuffer::hasOpenGLPbuffers()) {
18                QMessageBox::information(0, "OpenGL pbuffers",
19                        "This system does not support OpenGL/pbuffers.",
20                        QMessageBox::Ok);
21                return NULL;
22        }
23       
24        // note matt: capsulate qt dependent code as good as possible
25        QtGlRendererWidget *rendererWidget =
26                new QtGlRendererWidget(p->mSceneGraph, p->mViewCellsManager, p->mKdTree);
27
28        rendererWidget->resize(640, 480);
29        rendererWidget->Show();
30        app->exec();
31
32        return rendererWidget;
33}
34
35//-----------------------------------------------------------------------
36extern "C" void __declspec(dllexport) dllStopPlugin()
37{
38        delete app;
39}
40
41
42
43}
Note: See TracBrowser for help on using the repository browser.