X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=test4%2FTestPage.html;h=891226170d1972752bd742a29bf92e0c6a184967;hb=a1aee2b11bf1d315eaf4a2bbd8a96464d3848202;hp=44f4d11bb876f982146ad6a9c5d70210bca57116;hpb=0aaced545d70ae3bd6cdd440e0ce676f6a602761;p=psychlops%2Fsilverlight.git diff --git a/test4/TestPage.html b/test4/TestPage.html index 44f4d11..8912261 100644 --- a/test4/TestPage.html +++ b/test4/TestPage.html @@ -7,247 +7,209 @@ - + - - - - + - - - - - + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - @@ -257,99 +219,87 @@
-///+ Prefix linkto BasicCode1 +///+ Prefix //// Lines for set up Psychlops environment #include <psychlops.h> using namespace Psychlops; -///- Prefix linkto BasicCode1 - - +///- Prefix + ///+ Main Routine //// Psychlops runs at the first line of this function psychlops_main(). void psychlops_main() { + ///+ 1 + //// Set a window for drawing stimulus + Canvas window(Canvas::window); //Create a window. Here, window variables are preset mode. + // You can write this statement as" Canvas window(Canvas::fullscreen); " for fullscreen mode + // or as " Canvas window(1024, 768, 32, 60.0); " This statement changes screenmode to 1024 x 768, 32bit color, 60 Hz refresh. + ///- 1 + + ///+ 2 + //// Set a figure size, position and color. + Psychlops::Rectangle/*ID:FIGURE selector Rectangle Ellipse*/ figure; //Create a figure (Rectangle or Ellipse) variable. - ///+ 0 SetGlobal - ////Prepare global parameters - const int maxrectnum = 200; - int rectnum = 100/*ID:rectnumber 25.0 200.0 25.0*/; - double rectsize = 3.0/*ID:dotsize 1.0 10.0 1.0*/; - Psychlops::Rectangle rect[maxrectnum]; - double rectcolorR[maxrectnum]; - double rectcolorG[maxrectnum]; - double rectcolorB[maxrectnum]; - ///- 0 SetGlobal - - Canvas window(Canvas::window); - - ///+ 1 Initialize - ////Initialize - for(int i=0; i < rectnum; i++){ - ///+ 1.1 - ////set positions and sizes - rect[i].set(rectsize, rectsize); //Set a size of rectangles. - rect[i].centering(); //Move Rectangles to the center. - rect[i].shift((i - 0.5 * rectnum) * rectsize * 1.5/*ID:RectHGap 1.0 3.0 0.5*/, - (i - 0.5 * rectnum) * rectsize * 1.5/*ID:RectVGap 1.0 3.0 0.5*/); //Move Rectangles to initial positions - ///- 1.1 - - ///+ 1.2 - ////set colors - rectcolorR[i]=(double)i * 0.5/*ID:RGain 0.0 1.0 0.5*//(double)rectnum; //Set R values. Note that "i" and "rectnum" is converted to double-type. - rectcolorG[i]=(double)i * 0.5/*ID:GGain 0.0 1.0 0.5*//(double)rectnum; //Set G values. Note that "i" and "rectnum" is converted to double-type. - rectcolorB[i]=(double)i * 0.5/*ID:BGain 0.0 1.0 0.5*//(double)rectnum; //Set B values. Note that "i" and "rectnum" is converted to double-type. - ///- 1.2 - } - ///- 1 Initialize + figure.set( 100/*ID:SIZE_X 1 200 10*/, 100/*ID:SIZE_Y 1 200 10*/ ); // Set the size of figure. + figure.centering(); // Centering the figure in the window + figure.shift( 10/*ID:SHIFT_X -100 100 10*/, 10/*ID:SHIFT_Y -100 100 10*/ ); // Displacing the figure by designated vector. + figure.draw( Color( 1.0/*ID:COLOR_R 0 1.0 0.1*/, 0.0/*ID:COLOR_G 0.0 1.0 0.1*/, 0.0/*ID:COLOR_B 0 1.0 0.1*/) ); // Drawing the rectangle with a designated color. - ///+ 2 drawing - ////drawing objects - while(!Keyboard::esc.pushed()){ - window.clear(Color::black); //Clear window with black - for(int i=0; i < rectnum; i++){ - rect[i].draw(Color(rectcolorR[i], rectcolorG[i], rectcolorB[i])); //draw objects by designated colors. - } - window.flip(); - } - ///- 2 drawing - + window.flip(); // Reflect the drawing for the display by flipping frame buffers. + // Till this point, you will not see drawn figures. + ///- 2 + + ///+ 3 + //// Detect a Keyboard input + while(!Keyboard::esc.pushed()) {} //exit a program when the escape key is pressed down. + ///- 3 + } ///- Main Routine -+