OSDN Git Service

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