OSDN Git Service

first
[psychlops/cpp.git] / win32gl / package / trunk / CB13.12 / Program Files / Codeblocks / share / CodeBlocks / templates / wizard / PsychlopsGL / files / main.cpp
1 //Psychlops Code Template\r
2 //    Please visit following web site to get sample codes.\r
3 //    http://psychlops.sourceforge.jp/ja/?StartCode\r
4 //    CodeDresser at following address is also available to view the code.\r
5 //    http://visitope.org/Tools/codedresser.html\r
6 \r
7 ///+ 0 Setup Psychlops Circumstances\r
8 //// 0 Setup Psychlops Circumstances\r
9 #include <psychlops.h>\r
10 using namespace Psychlops;\r
11 // Psychlops Win32 1.7.0 / 20150205\r
12 ///- 0 Setup Psychlops Circumstances\r
13 \r
14 void psychlops_main() {\r
15 \r
16 \r
17         ///+ 1 Declaration /////////////////////////////////////////////////////////////\r
18         //// 1 Declaration\r
19                 // declare default window and variables for its parameters\r
20                 Canvas cnvs(Canvas::window, Display::secondary);\r
21                 double CANVAS_FRAMENUM;\r
22                 int CANVAS_REFRESHRATE;\r
23                 Psychlops::Color DEFAULT_BG_COLOR;\r
24 \r
25                 //declare local variables around here\r
26         \r
27         ///- 1 Declaration /////////////////////////////////////////////////////////////\r
28         \r
29         ///+ 2 Initialization //////////////////////////////////////////////////////////\r
30         //// 2 Initialization\r
31         \r
32                 // Set initial values for local variables\r
33                 CANVAS_REFRESHRATE = cnvs.getRefreshRate();\r
34                 CANVAS_FRAMENUM = 0;\r
35                 DEFAULT_BG_COLOR.set(127.0/255.0,127.0/255.0,127.0/255.0,1.0); // default background color is 127/255 mid-gray\r
36         \r
37                 // Draw Offline images around here\r
38         \r
39                 // Offline Movie calculation using Image array around here\r
40         \r
41         ///- 2 Initialization //////////////////////////////////////////////////////////\r
42         \r
43         ///+ 3 Drawing /////////////////////////////////////////////////////////////////\r
44         //// 3 Drawing\r
45         while(!Input::get(Keyboard::esc)) {\r
46                 cnvs.clear(DEFAULT_BG_COLOR);\r
47         \r
48                 //Write draw commands for realtime figure calculation and drawing around here\r
49                 \r
50                 //Write copy (Draw) commands for rendered movies in section 2 around here\r
51                 \r
52                 cnvs.flip();\r
53                 CANVAS_FRAMENUM++;\r
54         }\r
55         ///- 3 Drawing /////////////////////////////////////////////////////////////////\r
56 \r
57 }\r