\8fÍ/3.2_\83\89\83\93\83_\83\80\83h\83b\83g3.cpp - RSS feed" href="/view?p=psychlops/cpp_document.git;a=rss;f=Psychlops.manual/sample_cpp_file/3%C2%8F%C3%8D/3.2_%C2%83%C2%89%C2%83%C2%93%C2%83_%C2%83%C2%80%C2%83h%C2%83b%C2%83g3.cpp" type="application/rss+xml" /> \8fÍ/3.2_\83\89\83\93\83_\83\80\83h\83b\83g3.cpp - RSS feed (no merges)" href="/view?p=psychlops/cpp_document.git;a=rss;f=Psychlops.manual/sample_cpp_file/3%C2%8F%C3%8D/3.2_%C2%83%C2%89%C2%83%C2%93%C2%83_%C2%83%C2%80%C2%83h%C2%83b%C2%83g3.cpp;opt=--no-merges" type="application/rss+xml" /> \8fÍ/3.2_\83\89\83\93\83_\83\80\83h\83b\83g3.cpp - Atom feed" href="/view?p=psychlops/cpp_document.git;a=atom;f=Psychlops.manual/sample_cpp_file/3%C2%8F%C3%8D/3.2_%C2%83%C2%89%C2%83%C2%93%C2%83_%C2%83%C2%80%C2%83h%C2%83b%C2%83g3.cpp" type="application/atom+xml" /> \8fÍ/3.2_\83\89\83\93\83_\83\80\83h\83b\83g3.cpp - Atom feed (no merges)" href="/view?p=psychlops/cpp_document.git;a=atom;f=Psychlops.manual/sample_cpp_file/3%C2%8F%C3%8D/3.2_%C2%83%C2%89%C2%83%C2%93%C2%83_%C2%83%C2%80%C2%83h%C2%83b%C2%83g3.cpp;opt=--no-merges" type="application/atom+xml" />

OSDN Git Service

hk
[psychlops/cpp_document.git] / Psychlops.manual / sample_cpp_file / 3\8fÍ / 3.2_\83\89\83\93\83_\83\80\83h\83b\83g3.cpp
1 #include <psychlops.h>
2 using namespace Psychlops;
3
4 const int dotsize=4;
5 const int width=100;
6 double height=50;
7 double temp1;
8 Psychlops::Rectangle rect1[width];
9 Psychlops::Color col;
10 Psychlops::Image Noise1[width];
11
12 void psychlops_main() {
13
14         Canvas sampleA(Canvas::fullscreen);
15         
16         for(int x=0; x<width; x++){
17                 Noise1[x].set(dotsize,height*dotsize);
18                 rect1[x].set(dotsize, dotsize);
19                 for(int y=0; y<height; y++){
20                         temp1=Psychlops::random();
21                         col.set(temp1);
22                         Noise1[x].rect(rect1[x],col);
23                         //\83h\83b\83g\83T\83C\83Y\95ª\89º\82É\88Ú\93®\82·\82é                    
24                         rect1[x].shift(0, dotsize);
25                 }       
26                 Noise1[x].centering().shift((double)-1/2*(width*dotsize)+x*dotsize,0);
27                 Noise1[x].draw();
28         }
29         sampleA.flip();
30         while(!Input::get(Keyboard::spc));
31 }