Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Ludmány Balázs
/
thin-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
48d85ad7
authored
Jul 20, 2016
by
Ludmány Balázs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resize framebuffer to screen size
parent
c7e27e43
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
31 deletions
+35
-31
dispatcher.cpp
+3
-3
dispatcher.h
+1
-1
draw_shader.fsh
+2
-2
draw_shader.vsh
+6
-7
main.qml
+4
-4
qvnc.cpp
+1
-1
qvnc.h
+1
-1
uploader.cpp
+5
-3
vncrenderer.cpp
+12
-9
No files found.
dispatcher.cpp
View file @
48d85ad7
...
...
@@ -87,7 +87,7 @@ Uploader *Dispatcher::uploader() const
return
m_uploader
;
}
void
Dispatcher
::
open
(
QString
host
,
int
por
t
)
void
Dispatcher
::
open
(
const
QString
host
,
const
int
port
,
const
int
width
,
const
int
heigh
t
)
{
QByteArray
tmp
=
host
.
toLocal8Bit
();
m_client
=
rfbGetClient
(
8
,
3
,
4
);
...
...
@@ -105,8 +105,8 @@ void Dispatcher::open(QString host, int port)
m_client
->
appData
.
useRemoteCursor
=
TRUE
;
// Set the format requested by the user
m_client
->
width
=
1024
;
m_client
->
height
=
768
;
m_client
->
width
=
width
;
m_client
->
height
=
height
;
m_client
->
appData
.
compressLevel
=
0
;
m_client
->
appData
.
qualityLevel
=
0
;
#ifdef __BIG_ENDIAN__
...
...
dispatcher.h
View file @
48d85ad7
...
...
@@ -56,7 +56,7 @@ signals:
void
error
();
public
slots
:
// manage VNC connection
void
open
(
QString
host
,
int
port
);
void
open
(
QString
host
,
int
port
,
const
int
width
,
const
int
height
);
void
refresh
();
void
terminate
();
};
...
...
draw_shader.fsh
View file @
48d85ad7
uniform sampler2D texture;
varying
high
p vec2 vartexcoord;
varying
high
p vec3 varcolor;
varying
low
p vec2 vartexcoord;
varying
low
p vec3 varcolor;
void main(void)
{
...
...
draw_shader.vsh
View file @
48d85ad7
uniform
high
p mat4 ortho;
uniform
low
p mat4 ortho;
uniform lowp vec3 colormax;
attribute
high
p vec2 position;
attribute
high
p vec3 color;
attribute
high
p vec2 texcoord;
varying
high
p vec3 varcolor;
varying
high
p vec2 vartexcoord;
attribute
low
p vec2 position;
attribute
low
p vec3 color;
attribute
low
p vec2 texcoord;
varying
low
p vec3 varcolor;
varying
low
p vec2 vartexcoord;
void main(void)
{
gl_Position = ortho * vec4(position, 0.0, 1.0);
varcolor = color / colormax;
// varcolor = vec3(1.0, 1.0, 0.0);
vartexcoord = texcoord;
}
main.qml
View file @
48d85ad7
...
...
@@ -4,8 +4,8 @@ import thinclient 1.3
ApplicationWindow
{
visible
:
true
width
:
vnc
.
width
;
height
:
tab
.
height
+
vnc
.
height
visibility
:
"Maximized"
id
:
window
header
:
TabBar
{
id
:
tab
...
...
@@ -27,7 +27,7 @@ ApplicationWindow {
id
:
vnc
host
:
"vm.ik.bme.hu"
port
:
10495
width
:
1024
height
:
768
width
:
window
.
width
height
:
window
.
height
-
tab
.
height
}
}
qvnc.cpp
View file @
48d85ad7
...
...
@@ -52,7 +52,7 @@ QVnc::~QVnc()
void
QVnc
::
open
()
{
emit
open_connection
(
this
->
m_host
,
this
->
m_port
);
emit
open_connection
(
this
->
m_host
,
this
->
m_port
,
(
int
)
this
->
width
(),
(
int
)
this
->
height
()
);
}
void
QVnc
::
terminate
()
...
...
qvnc.h
View file @
48d85ad7
...
...
@@ -50,7 +50,7 @@ private:
ulong
m_lastMouseEvent
;
signals
:
void
open_connection
(
QString
host
,
int
por
t
);
void
open_connection
(
const
QString
host
,
const
int
port
,
const
int
width
,
const
int
heigh
t
);
void
terminate_connection
();
void
hostChanged
(
QString
host
);
...
...
uploader.cpp
View file @
48d85ad7
...
...
@@ -225,10 +225,12 @@ int Uploader::gotJpeg(const quint32 x, const quint32 y, const quint32 width, con
m_functions
->
glBindTexture
(
GL_TEXTURE_2D
,
id
);
#ifdef GL_RGB8
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB8
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#elif GL_RGB8_OES
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB8_OES
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#else
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#ifdef GL_RGB8_OES
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB8_OES
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#else
m_functions
->
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
real_width
,
real_height
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
NULL
);
#endif
#endif
m_textures
->
append
(
id
);
...
...
vncrenderer.cpp
View file @
48d85ad7
...
...
@@ -20,9 +20,9 @@ VncRenderer::VncRenderer(QQuickWindow *window,
void
VncRenderer
::
render
()
{
static
QTime
frameTime
;
/*
static QTime frameTime;
qDebug() << qRound(1000.0 / frameTime.elapsed()) << m_textures->length();
frameTime
.
restart
();
frameTime.restart();
*/
m_program
.
bind
();
m_vertices
.
bind
();
...
...
@@ -50,6 +50,7 @@ void VncRenderer::render()
QOpenGLFramebufferObject
*
VncRenderer
::
createFramebufferObject
(
const
QSize
&
size
)
{
qDebug
()
<<
size
;
QMatrix4x4
ortho
;
ortho
.
ortho
(
QRect
(
QPoint
(
0
,
size
.
height
()),
QSize
(
size
.
width
(),
-
1
*
size
.
height
())));
m_program
.
bind
();
...
...
@@ -57,14 +58,16 @@ QOpenGLFramebufferObject *VncRenderer::createFramebufferObject(const QSize &size
m_program
.
release
();
QOpenGLFramebufferObjectFormat
format
;
/* format.setTextureTarget(GL_TEXTURE_2D);
#ifdef GL_RGB8
format.setInternalTextureFormat(GL_RGB8);
#ifdef GL_RGB8_OES
format.setInternalTextureFormat(GL_RGB8_OES);
format
.
setTextureTarget
(
GL_TEXTURE_2D
);
#ifdef GL_RGBA8
format
.
setInternalTextureFormat
(
GL_RGBA8
);
#else
format.setInternalTextureFormat(GL_RGBA);
#endif*/
#ifdef GL_RGBA8_OES
format
.
setInternalTextureFormat
(
GL_RGBA8_OES
);
#else
format
.
setInternalTextureFormat
(
GL_RGBA
);
#endif
#endif
QOpenGLFramebufferObject
*
framebufferObject
=
new
QOpenGLFramebufferObject
(
size
,
format
);
emit
FBOTextureChanged
(
framebufferObject
->
texture
(),
ortho
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment