AYA.C   

<

^

>


                                               /**/
                                          #include<stdio.h>
                                       #include<sys/./time.h>
                                    #include<stdlib.h>/*TOUHOU*/
                                    #include<GL/glut.h>/*.BUNKA*/
                                   #define z(u,n)gl##n##u/*CHOU*/
                                  typedef double x;typedef int _;_ A,y,a,_w,w;
                               T(){glutInitDisplayMode(GLUT_RGBA|GLUT_DOUBLE);z(ow
                           ,utSetWind)(glutCreateWindow("Aya"));a=GL_SRC_ALPHA;z(ble
                       ,Ena)(GL_BLEND);glBlendFunc(a,GL_ONE_MINUS_SRC_ALPHA);glEnable(
                    GL_TEXTURE_2D);}W(_ O){glTexParameteri(GL_TEXTURE_2D,O,GL_NEAREST);
                 }V(x O,x P,x Q,x R){glTexCoord2d(O,P);glVertex2d(Q,R);}unsigned char*p,b
              [0x4000];B(_ O){glMatrixMode(O);glLoadIdentity();}C(){glDrawBuffer(GL_BACK);
            glClear(GL_COLOR_BUFFER_BIT);glViewport(0,0,a=glutGet(GLUT_WINDOW_WIDTH),y=z(et
          ,utG)(GLUT_WINDOW_HEIGHT));B(GL_PROJECTION);if(a>y)gluOrtho2D(-a/(x)y,a/(x)y,-1,1);
         else{gluOrtho2D(-1,1,-y/(x)a,y/(x)a);}B(GL_MODELVIEW); }x X(x O){return O*(x)(rand()&
        0x3fff)/8191.-O;}x BUN[]={.9,.98,1,0,-1},KA[]={.32,.98   ,.36,.12,.54,.12,.58,.98,.9,.98
        ,1 ,0,-1},CHOU[]={.56,.99,.58,.7,.9,0,-1},t,u,v;Z(){     struct timeval U;gettimeofday(&U
       ,  NULL);u=U.tv_sec+U.tv_usec/1e6;}x c,d,r,s,i,j,k,l      ,m,n;I(){Z();srand(u);C();s=(u-l)/
          1.5;for(a=0;a<23;a++){if(     (j=s-a/23.)>=0){r       =j*2.1;for(y=0;y<32;y++){m=i+y*d/16.
         ;k=j*((c+y*d/16.0)-m)+m;    if(a&  1  )k+=             d/32.;glPushMatrix();glTranslated(r*
        cos(k) +n, r*sin(k)+t,0)              ;z          (st  ,/*  ,*/ CallLi)(w);glPopMatrix();}}}
       if(2.2  <s) {l=u;c=i=X(d) ;if(        !        (rand()&3))c+=X( d/3);n=X(.5);t=X(.5);}z(fers
      ,/*AYA   */  utSwapBuf)();z(   h                            ,Flus)();}F(){Z();glGenTextures
     (1,&_w        );z(ndTexture                                 ,   Bi)(  GL_TEXTURE_2D,_w);/*;)
     {*/w=         GL_TEXTURE_2D   ;z(                        Image2D     ,Tex)(w,0,GL_RGBA,64,64,
     0,/*(          ;*/GL_RGBA,   /* 06                     10    22*/    GL_UNSIGNED_BYTE,b);w=z(
     Lists         ,Gen)(01);t=   0.07;                     /*   ,*/A=    GL_TEXTURE_MAG_FILTER ;a
      =(0+         GL_COMPILE);   z(ist                     ,NewL)(w,a  );;a=GL_TRIANGLE_FAN;z( n,
      Begi        )(a);V(0,0,-t   ,-t);                     V(1,0,t,-t);y=GL_TEXTURE_MIN_FILTER  ;
       V(       1,1,t,t);V(0,1,    -t,                      t);glEnd( );glEndList();W(A);W(y);{
         ;     }l=u;n=a=t=i=c;{                               ;}z(   DisplayFunc,ut)(I);I();}N
              (){z(stRedisplay                                       ,utPo)();}M(_ Y,_ O){N();
             ;}f(unsigned char                                        Z,_ U,_ N){glFlush();z(s
            ,DeleteList)(w,01);                                      glDeleteTextures(1,&_w);
            {;} exit(0);}D(){z(            oardFunc                  ,utKeyb)(f);z(tIdleFunc
           ,u) (N);z(tDisplayFunc          ,u)(F);z                   (ReshapeFunc,ut)( M);z
           (p  ,utMainLoo)();}x o(          x*q){s=                  *q++;v=*(q++);if( r>s)
           {  for(;(j=*q++)>s;){k=(*          q++)                 ;if(r<j){v=(k-v)   *(r-
             s)/(j-s)+v;break;}s=j;v=k                            ;}}return(255*     v);}
            main(_ H,char**G){;glutInit(&                         H,G   ); d=     atan2(
            c=0,-1);for(a=0;a<16384;b[a++]=0                      )               ;p=b
           ;for(a=0;a<64;a++){m=a/32.-1;for(y=0;y                 <              64;
            y++){r=y/32.-1;r=sqrt(m*m+r*r);if    (                 (
            A=o(BUN))>255)A=255;*p++=A;if((A      =
             o(KA))>255)A=255;*p++=A;*p++=A;A=
            o(CHOU);if(       A>255)A= 255;
              *p++=A;      }}T();
                D()
                  ;}

  NFO RAR ZIP DETAILS SAMPLE /
2016-11-24