Commit bd050424 by Ludmány Balázs

Set swap behavior

parent 36bd0aa2
...@@ -144,12 +144,12 @@ void Dispatcher::open(QString host, int port) ...@@ -144,12 +144,12 @@ void Dispatcher::open(QString host, int port)
// 32 bit: RGB888 // 32 bit: RGB888
// 16 bit: RGB444, RGB555, RGB565 // 16 bit: RGB444, RGB555, RGB565
/*int message = WaitForMessage(m_client, 1000); int message = WaitForMessage(m_client, 1000);
if(message < 0) { if(message < 0) {
terminate(); terminate();
emit error(); emit error();
return; return;
}*/ }
refresh(); refresh();
} }
void Dispatcher::refresh() void Dispatcher::refresh()
...@@ -167,12 +167,9 @@ void Dispatcher::refresh() ...@@ -167,12 +167,9 @@ void Dispatcher::refresh()
return; return;
} }
// Don't block uploading!
// Wait until we get something // Wait until we get something
while(message == 0) { while(message == 0) {
QCoreApplication::processEvents(); message = WaitForMessage(m_client, 10000);
message = WaitForMessage(m_client, 1000);
if(message < 0) { if(message < 0) {
terminate(); terminate();
emit error(); emit error();
......
#define QT_OPENGL_ES_2 1
#include <QGuiApplication> #include <QGuiApplication>
#include <QtQml> #include <QtQml>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
...@@ -8,6 +6,19 @@ ...@@ -8,6 +6,19 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QSurfaceFormat format;
format.setAlphaBufferSize(0);
format.setRedBufferSize(8);
format.setGreenBufferSize(8);
format.setBlueBufferSize(8);
format.setDepthBufferSize(0);
format.setStencilBufferSize(0);
format.setMajorVersion(2);
format.setMinorVersion(0);
format.setRenderableType(QSurfaceFormat::OpenGLES);
format.setSwapBehavior(QSurfaceFormat::SingleBuffer);
format.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(format);
QGuiApplication::setAttribute(Qt::AA_UseOpenGLES, true); QGuiApplication::setAttribute(Qt::AA_UseOpenGLES, true);
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
......
...@@ -21,7 +21,7 @@ VncRenderer::VncRenderer(QQuickWindow *window, ...@@ -21,7 +21,7 @@ VncRenderer::VncRenderer(QQuickWindow *window,
void VncRenderer::render() void VncRenderer::render()
{ {
static QTime frameTime; static QTime frameTime;
qDebug() << qRound(1000.0 / frameTime.elapsed()); qDebug() << qRound(1000.0 / frameTime.elapsed()) << m_textures->length();
frameTime.restart(); frameTime.restart();
m_program.bind(); m_program.bind();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment