Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
libvncserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
libvncserver
Commits
c0c5aace
Commit
c0c5aace
authored
Jan 21, 2004
by
dscho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a simple example how to use rfbDoCopyRect
parent
d58d3af1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
2 deletions
+55
-2
Makefile.am
examples/Makefile.am
+5
-2
copyrecttest.c
examples/copyrecttest.c
+50
-0
No files found.
examples/Makefile.am
View file @
c0c5aace
CFLAGS
=
-I
..
-g
-Wall
LDADD
=
../libvncserver.a
if
HAVE_LIBPTHREAD
BACKGROUND_TEST
=
blooptest
...
...
@@ -9,10 +10,12 @@ MAC=mac
mac_LDFLAGS
=
-framework
ApplicationServices
-framework
Carbon
-framework
IOKit
endif
copyrecttest_LDADD
=
$(LDADD)
-lm
noinst_HEADERS
=
radon.h
noinst_PROGRAMS
=
example pnmshow regiontest pnmshow24 fontsel
\
vncev storepasswd colourmaptest simple simple15
$(BACKGROUND_TEST)
$(MAC)
vncev storepasswd colourmaptest simple simple15 copyrecttest
\
$(BACKGROUND_TEST)
$(MAC)
LDADD
=
../libvncserver.a
examples/copyrecttest.c
0 → 100644
View file @
c0c5aace
#include <rfb/rfb.h>
#include <math.h>
void
initBackground
(
rfbScreenInfoPtr
server
)
{
unsigned
int
i
,
j
;
for
(
i
=
0
;
i
<
server
->
width
;
i
++
)
for
(
j
=
0
;
j
<
server
->
height
;
j
++
)
{
server
->
frameBuffer
[(
j
*
server
->
width
+
i
)
*
4
+
0
]
=
i
&
0xff
;
server
->
frameBuffer
[(
j
*
server
->
width
+
i
)
*
4
+
1
]
=
j
&
0xff
;
server
->
frameBuffer
[(
j
*
server
->
width
+
i
)
*
4
+
2
]
=
(
i
*
j
)
&
0xff
;
}
}
int
main
(
int
argc
,
char
**
argv
)
{
int
width
=
400
,
height
=
300
,
w
=
20
,
x
,
y
;
double
r
,
phi
;
rfbScreenInfoPtr
server
=
rfbGetScreen
(
&
argc
,
argv
,
width
,
height
,
8
,
3
,
4
);
server
->
frameBuffer
=
malloc
(
width
*
height
*
4
);
initBackground
(
server
);
server
->
rfbDeferUpdateTime
=
0
;
rfbInitServer
(
server
);
r
=
0
;
while
(
1
)
{
if
(
r
<=
0
)
{
initBackground
(
server
);
rfbMarkRectAsModified
(
server
,
0
,
0
,
width
,
height
);
r
=
0
.
43
;
phi
=
0
;
}
else
{
r
-=
0
.
0001
;
phi
+=
0
.
02
;
if
(
phi
>
2
*
M_PI
)
phi
-=
2
*
M_PI
;
}
x
=
width
*
(
0
.
5
+
cos
(
phi
)
*
r
);
y
=
height
*
(
0
.
5
+
sin
(
phi
)
*
r
);
if
(
x
>=
0
&&
y
>=
0
&&
x
+
w
<=
width
&&
y
+
w
<=
height
)
{
unsigned
int
dx
=
width
*
0
.
5
*
(
1
-
cos
(
phi
)
*
r
)
-
x
,
dy
=
height
*
0
.
5
*
(
1
-
sin
(
phi
)
*
r
)
-
y
;
rfbDoCopyRect
(
server
,
x
,
y
,
x
+
w
,
y
+
w
,
-
dx
,
-
dy
);
}
rfbProcessEvents
(
server
,
50000
);
}
return
(
0
);
}
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