Port lance manual test to qopengl
Task-number: QTBUG-74408 Change-Id: I5e112a2024aebee4be740e770ea0fb4e5b2a9daa Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
e3f2e7afbb
commit
e0fb295aad
@ -171,4 +171,5 @@ add_qt_resource(lance "images"
|
||||
extend_target(lance CONDITION TARGET Qt::OpenGL
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::OpenGL
|
||||
Qt::OpenGLWidgets
|
||||
)
|
||||
|
@ -2,7 +2,7 @@ LANCELOT_DIR = $$PWD/../../auto/other/lancelot
|
||||
CONFIG += cmdline moc
|
||||
TEMPLATE = app
|
||||
INCLUDEPATH += . $$LANCELOT_DIR
|
||||
QT += core-private gui-private widgets printsupport
|
||||
QT += core-private gui-private widgets printsupport openglwidgets
|
||||
|
||||
HEADERS += widgets.h \
|
||||
interactivewidget.h \
|
||||
|
@ -42,8 +42,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
#include <qgl.h>
|
||||
#include <QGLPixelBuffer>
|
||||
#include <QtOpenGL/QOpenGLFramebufferObjectFormat>
|
||||
#include <QtOpenGL/QOpenGLPaintDevice>
|
||||
#include <QtOpenGLWidgets/QOpenGLWidget>
|
||||
#endif
|
||||
|
||||
// #define DO_QWS_DEBUGGING
|
||||
@ -89,7 +90,7 @@ static void printHelp()
|
||||
" -imagemono Paints the files to a monochrome image\n"
|
||||
" -imagewidget same as image, but with interacion...\n"
|
||||
#ifndef QT_NO_OPENGL
|
||||
" -opengl Paints the files to a QGLWidget (Qt4 style) on screen\n"
|
||||
" -opengl Paints the files to a QOpenGLWidget on screen\n"
|
||||
" -glbuffer Paints the files to a QOpenGLFrameBufferObject (Qt5 style) \n"
|
||||
" -coreglbuffer Paints the files to a Core Profile context QOpenGLFrameBufferObject\n"
|
||||
#endif
|
||||
@ -233,12 +234,11 @@ int main(int argc, char **argv)
|
||||
bool verboseMode = false;
|
||||
|
||||
#ifndef QT_NO_OPENGL
|
||||
QGLFormat f = QGLFormat::defaultFormat();
|
||||
f.setSampleBuffers(true);
|
||||
f.setStencil(true);
|
||||
f.setAlpha(true);
|
||||
QSurfaceFormat f = QSurfaceFormat::defaultFormat();
|
||||
f.setSamples(1);
|
||||
f.setStencilBufferSize(8);
|
||||
f.setAlphaBufferSize(8);
|
||||
QGLFormat::setDefaultFormat(f);
|
||||
QSurfaceFormat::setDefaultFormat(f);
|
||||
#endif
|
||||
|
||||
char *arg;
|
||||
@ -447,14 +447,14 @@ int main(int argc, char **argv)
|
||||
}
|
||||
case OpenGLType:
|
||||
{
|
||||
OnScreenWidget<QGLWidget> *qGLWidget = new OnScreenWidget<QGLWidget>(files.at(j));
|
||||
qGLWidget->setVerboseMode(verboseMode);
|
||||
qGLWidget->setType(type);
|
||||
qGLWidget->setCheckersBackground(checkers_background);
|
||||
qGLWidget->m_commands = content;
|
||||
qGLWidget->resize(width, height);
|
||||
qGLWidget->show();
|
||||
activeWidget = qGLWidget;
|
||||
OnScreenWidget<QOpenGLWidget> *qOpenGLWidget = new OnScreenWidget<QOpenGLWidget>(files.at(j));
|
||||
qOpenGLWidget->setVerboseMode(verboseMode);
|
||||
qOpenGLWidget->setType(type);
|
||||
qOpenGLWidget->setCheckersBackground(checkers_background);
|
||||
qOpenGLWidget->m_commands = content;
|
||||
qOpenGLWidget->resize(width, height);
|
||||
qOpenGLWidget->show();
|
||||
activeWidget = qOpenGLWidget;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user