Commit bd050424 by Ludmány Balázs

Set swap behavior

parent 36bd0aa2
......@@ -144,12 +144,12 @@ void Dispatcher::open(QString host, int port)
// 32 bit: RGB888
// 16 bit: RGB444, RGB555, RGB565
/*int message = WaitForMessage(m_client, 1000);
int message = WaitForMessage(m_client, 1000);
if(message < 0) {
terminate();
emit error();
return;
}*/
}
refresh();
}
void Dispatcher::refresh()
......@@ -167,12 +167,9 @@ void Dispatcher::refresh()
return;
}
// Don't block uploading!
// Wait until we get something
while(message == 0) {
QCoreApplication::processEvents();
message = WaitForMessage(m_client, 1000);
message = WaitForMessage(m_client, 10000);
if(message < 0) {
terminate();
emit error();
......
#define QT_OPENGL_ES_2 1
#include <QGuiApplication>
#include <QtQml>
#include <QQmlApplicationEngine>
......@@ -8,6 +6,19 @@
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 app(argc, argv);
......
......@@ -21,7 +21,7 @@ VncRenderer::VncRenderer(QQuickWindow *window,
void VncRenderer::render()
{
static QTime frameTime;
qDebug() << qRound(1000.0 / frameTime.elapsed());
qDebug() << qRound(1000.0 / frameTime.elapsed()) << m_textures->length();
frameTime.restart();
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