aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-glwidgets/gltest/main.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-27 11:51:40 -0400
committerKen Moore <ken@ixsystems.com>2017-09-27 11:51:40 -0400
commitff558814658470aaa24c5ca0f5cc8d687ffe7c74 (patch)
treef552061d406975233f94da688b19bb236e0bfc8a /src-qt5/src-glwidgets/gltest/main.cpp
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-ff558814658470aaa24c5ca0f5cc8d687ffe7c74.tar.gz
lumina-ff558814658470aaa24c5ca0f5cc8d687ffe7c74.tar.bz2
lumina-ff558814658470aaa24c5ca0f5cc8d687ffe7c74.zip
Commit some minor updates/tests to the GL widgets. need to avoid QPainter if we want GPU accelleration.
Diffstat (limited to 'src-qt5/src-glwidgets/gltest/main.cpp')
-rw-r--r--src-qt5/src-glwidgets/gltest/main.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src-qt5/src-glwidgets/gltest/main.cpp b/src-qt5/src-glwidgets/gltest/main.cpp
index 972c4225..b303cb6b 100644
--- a/src-qt5/src-glwidgets/gltest/main.cpp
+++ b/src-qt5/src-glwidgets/gltest/main.cpp
@@ -2,7 +2,6 @@
#include <QApplication>
#include <QTimer>
#include <QColor>
-#include <QPushButton>
#include <QPropertyAnimation>
#include "../glw-base.h"
#include "../glw-widget.h"
@@ -10,11 +9,18 @@
#include "colorchange.h"
int main(int argc, char** argv){
+
+ QSurfaceFormat fmt;
+ fmt.setRenderableType(QSurfaceFormat::OpenGL); //OpenGL, OpenGLES, OpenVG
+ fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
+ QSurfaceFormat::setDefaultFormat(fmt);
+
QApplication A(argc,argv);
+
qDebug() << "Creating base widget";
GLW_Base base;
qDebug() << "Resize base widget";
- base.resize(200,200);
+ base.resize(1024,768);
qDebug() << "Create Other widgets";
GLW_Widget wgt1(&base);
wgt1.setGLBase(&base);
@@ -28,11 +34,11 @@ int main(int argc, char** argv){
anim.setPropertyName("geometry");
//anim.setStartValue(QRect(-50,-50,50,50));
//anim.setEndValue(QRect(200,200,50,50));
- anim.setStartValue(QRect(100,100,0,0));
- anim.setEndValue(QRect(0,0,200,200));
+ anim.setStartValue(QRect(base.width()/2,base.height()/2,0,0));
+ anim.setEndValue(QRect(0,0,base.width(),base.height()));
anim.setDuration(1500);
anim.setLoopCount(-1);
- //anim.start();
+ anim.start();
/*QPushButton but(&base);
but.setText("button");
but.setGeometry(100,100,50,50);
bgstack15