Mercurial > hg > Game > Cerium
view Renderer/Test/aquarium.cc @ 859:3f45bd7b910a draft
linda connection init
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 17 Jun 2010 04:46:25 +0900 |
parents | 9f6e29836095 |
children | 6c08c50c5f7a |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include "SceneGraphRoot.h" #include "lindaapi.h" #include "aquarium.h" linda_t aquarium::linda_addr = { "localhost", 10000 }; int aquarium::linda; const char *usr_help_str = "Usage: ./aquarium -linda LINDA_SERVER_NAME\n"; void TMend(TaskManager *manager); extern void task_initialize(); extern int init(TaskManager *manager, int argc, char *argv[]); extern Application * application() { return new aquarium(); } void init_network() { aquarium::linda_connect(); } MainLoopPtr aquarium::init(Viewer *sgroot, int screen_w, int screen_h) { init_network(); return sgroot; } void aquarium::linda_connect() { init_linda(); // セレクタの初期化 linda = open_linda_java(linda_addr.hostname, linda_addr.port); } int TMmain(TaskManager *manager, int argc, char *argv[]) { task_initialize(); manager->set_TMend(TMend); for (int i = 0; i < argc; i++) { if (strcmp(argv[i],"-linda") == 0 && i + 1 <= argc) { aquarium::linda_addr.hostname = argv[i+1]; } else if (strcmp(argv[i],"-port") == 0 && i + 1 <= argc) { aquarium::linda_addr.port = atoi(argv[i+1]); } } return init(manager, argc, argv); } void TMend(TaskManager *manager) { printf("aquarium end\n"); } /* end */