annotate Renderer/Test/print_string.cc @ 1767:1a68c05eeadf draft

minor fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 23 Nov 2013 01:28:59 +0900
parents b8adf4e95e96
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1205
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include <math.h>
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include <stdlib.h>
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 #include <string.h>
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 #include "SceneGraphRoot.h"
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 #include "MainLoop.h"
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 #include "print_string.h"
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 MainLoopPtr
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 print_string::init(Viewer *sgroot, int screen_w, int screen_h)
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 {
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 SceneGraphPtr root;
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 //SceneGraphPtr test[10];
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 char *print_message = "aあ区";
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 SceneGraphPtr light = sgroot->getLight(0);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 sgroot->OnLightSwitch(0);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 light->xyz[0] = screen_w / 2;
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 light->xyz[1] = screen_h / 2;
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 light->xyz[2] = -100;
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 root = sgroot->createSceneGraph();
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 //display_string(sgroot,root,print_message,80,screen_w,screen_h,0x00ff00ff);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 sgroot->createStringFont(root,print_message,80,700,300,0x00ff00ff);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 sgroot->setSceneData(root);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 return sgroot;
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 }
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 extern Application *
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 application() {
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 return new print_string();
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 }
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 extern int init(TaskManager *manager, int argc, char *argv[]);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 extern void task_initialize();
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 static void TMend(TaskManager *manager);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 int
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 TMmain(TaskManager *manager, int argc, char *argv[])
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 {
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 task_initialize();
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 manager->set_TMend(TMend);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 return init(manager, argc, argv);
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 }
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 void
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 TMend(TaskManager *manager)
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 {
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 printf("test_nogl end\n");
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 }
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56
b8adf4e95e96 add createStringFont()
Takao YONAMINE <e095763@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 /* end */