C
Program C de generare a efectului grafic-plasma-prin utilizarea unor functii ale modului grafic// Program C de generare a efectului grafic-plasma-prin utilizarea unor functii ale modului grafic #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <math.h> #include <dos.h> int MX,MY; int p1,p2,p3,p4,r1,r2,r3,r4; void plasma(int x1,int x2,int y1,int y2) int gdriver = VGA, gmode = VGAHI, errorcode,i; double red=20,green=30,blue=40; struct palettetype pal; void main(void) /* grab a copy of the palette */ getpalette(&pal); for (i=0; i<pal.size; i++) setrgbpalette(pal.colors[i], red+i, green+i, blue+i); randomize(); MX=getmaxx();MY=getmaxy(); putpixel(0,0,MAXCOLORS/2); putpixel(0,MY,MAXCOLORS/2); putpixel(MX,0,MAXCOLORS/2); putpixel(MX,MY,MAXCOLORS/2); plasma(0,MX,0,MY); // rotate palette while(!kbhit()) closegraph();
|