comparison Renderer/Test/print_string.cc @ 1205:b8adf4e95e96 draft

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