summaryrefslogtreecommitdiffstats
path: root/test/test-client.c
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-11-20 17:37:55 +0100
committerTimo Dritschler <timo.dritschler@kit.edu>2014-11-20 17:53:19 +0100
commit65c2326592b7b1496c468459689904843e443b26 (patch)
tree7dc907bc82227851bc8e13827ae25cbabcf9ba1f /test/test-client.c
parente71b75575658c435bc77c01ef098336c563af740 (diff)
downloadkiro-65c2326592b7b1496c468459689904843e443b26.tar.gz
kiro-65c2326592b7b1496c468459689904843e443b26.tar.bz2
kiro-65c2326592b7b1496c468459689904843e443b26.tar.xz
kiro-65c2326592b7b1496c468459689904843e443b26.zip
Release KIRO to GitHub under LGPL v2.1
Added kiro_*_free methods to all three units Added installation guide Added readme Added licence file
Diffstat (limited to 'test/test-client.c')
-rw-r--r--test/test-client.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/test-client.c b/test/test-client.c
index a7bbc16..4cfc842 100644
--- a/test/test-client.c
+++ b/test/test-client.c
@@ -40,20 +40,22 @@ int
main ( int argc, char *argv[] )
{
if (argc < 3) {
- printf ("Not enough aruments. Usage: ./client <address> <port>\n");
+ printf ("Not enough aruments. Usage: 'kiro-client-sdl <address> <port>'\n");
return -1;
}
KiroClient *client = kiro_client_new ();
+ KiroTrb *trb = kiro_trb_new ();
if (-1 == kiro_client_connect (client, argv[1], argv[2])) {
- g_object_unref (client);
+ kiro_client_free (client);
return -1;
}
kiro_client_sync (client);
- KiroTrb *trb = kiro_trb_new ();
kiro_trb_adopt (trb, kiro_client_get_memory (client));
+
+
_Bool ok =
init_app ("UCA Images", NULL, SDL_INIT_VIDEO) &&
SDL_SetVideoMode (512, 512, 8, SDL_HWSURFACE);
@@ -62,20 +64,19 @@ main ( int argc, char *argv[] )
SDL_Surface *data_sf = SDL_CreateRGBSurfaceFrom (
kiro_trb_get_element (trb, 0), 512, 512, 8, 512,
mask, mask, mask, 0);
- SDL_Color colors[256];
+
+ SDL_Color colors[256];
for (int i = 0; i < 256; i++) {
colors[i].r = i;
colors[i].g = i;
colors[i].b = i;
}
-
SDL_SetPalette (data_sf, SDL_LOGPAL | SDL_PHYSPAL, colors, 0, 256);
SDL_SetEventFilter (filter);
+
+
int cont = 1;
-
- //struct KiroTrbInfo *header = (struct KiroTrbInfo *)kiro_trb_get_raw_buffer(trb);
-
while (cont) {
for (SDL_Event event; SDL_PollEvent (&event);)
if (event.type == SDL_QUIT) cont = 0;
@@ -88,7 +89,8 @@ main ( int argc, char *argv[] )
render (data_sf);
}
- g_object_unref (client);
+ kiro_client_free (client);
+ kiro_trb_free (trb);
return 0;
}