You are on page 1of 7

CMETO-2KELO-T39DN-A32EW-FTX2L-FZEZU

CMH2P-QXHY6-7HGX9-AFKPM-G2QBX-CZG64
CM36Z-CYTBB-OB4XR-QSHVG-26RWV-6FTGU
CMWKQ-B4JNG-YABPT-QN4VF-XKRZF-KEQAU
CMH2P-QXHY6-7HGX9-AFKPM-G2QBX-CZG64
CMDCI-ZNTSZ-ABABO-AS9QO-DCOAQ-TMFXV
CMOTB-W3MAR-NRWOV-APRGE-PTTKG-9GV2F
CMI4A-VHFH9-6JQQP-AH6XE-J4L9A-3J6NH
CM3G6-DR2R3-QOWZW-ATUEF-2GHSE-IQF2X
CMOTB-W3MAR-NRWOV-AP4BN-PTJJX-6JLYB
CMBK3-6EKE6-ZC22B-AQ6ED-AKSET-JW9EU
CMC62-BU6GF-HHRXJ-AKZBR-D6J6R-JH3P7
CMGHG-3O24M-BHECP-QP3E4-HHGHR-OOLWW
Content Source : http://www.piratecity.net/avg-pc-tuneup-crack/#ixzz4BfiK6qxS
Follow us: @PirateCityNET on Twitter | PirateCity.NET on Facebook
#include <glut.h>
#include <string.h>
#include <math.h>
void
void
void
void
void
void
void

*font0
*font1
*font2
*font3
*font4
*font5
*font6

=
=
=
=
=
=
=

GLUT_BITMAP_8_BY_13;
GLUT_BITMAP_9_BY_15;
GLUT_BITMAP_TIMES_ROMAN_10;
GLUT_BITMAP_TIMES_ROMAN_24;
GLUT_BITMAP_HELVETICA_10;
GLUT_BITMAP_HELVETICA_12;
GLUT_BITMAP_HELVETICA_18;

typedef struct {
float x;
float y;
} point2D_t;
typedef struct {
float r;
float g;
float b;
} color_t;
color_t
color_t
color_t
color_t
color_t
color_t
color_t
color_t
color_t

hitam = {0.0,0.0,0.0};
biru = {0.0,0.0,1.0};
hijau = {0.0,1.0,0.0};
cyan = {0.0,1.0,1.0};
merah = {1.0,0.0,0.0};
magenta = {1.0,0.0,1.0};
kuning = {1.0,1.0,0.0};
putih = {1.0,1.0,1.0};
abu2 = {0.5,0.5,0.5};

void setColor(color_t col)


{
glColor3f(col.r,col.g,col.b);
}
void displayTeks(char teks[],void *font,float warna[],float x,float y)

{
glColor3f(warna[0],warna[1],warna[2]);
glRasterPos2f(x,y);
int pj=strlen(teks);
for (int i=0; i<pj; i++)
glutBitmapCharacter (font, teks[i]);
}
void drawPoint(float x,float y,color_t color,float size)
{
setColor(color);
glPointSize(size);
glBegin(GL_POINTS);
glVertex2f(x,y);
glEnd();
}
void drawPolyline(point2D_t pnt[],int n,color_t color,float width)
{
setColor(color);
glLineWidth(width);
glBegin(GL_LINE_STRIP);
for (int i=0;i<n;i++)
{
glVertex2f(pnt[i].x,pnt[i].y);
}
glEnd();
}
void drawPolygon(point2D_t pnt[],int n,color_t color,float width)
{
setColor(color);
glLineWidth(width);
glBegin(GL_LINE_LOOP);
for (int i=0;i<n;i++)
{
glVertex2f(pnt[i].x,pnt[i].y);
}
glEnd();
}
void fillPolygon(point2D_t pnt[],int n,color_t color,float width)
{
setColor(color);
glLineWidth(width);
glBegin(GL_POLYGON);
for (int i=0;i<n;i++)
{
glVertex2f(pnt[i].x,pnt[i].y);
}
glEnd();
}
void drawCircle(float xc,float yc,float r,int sdt,color_t color,float width)
{

int s,i;
point2D_t p[365];
s=0;
for(i=0;i<=abs(sdt);i++)
{
float srad = s*3.14/180;
p[i].x=(float)((r*cos(srad))+xc);
p[i].y=(float)((r*sin(srad))+yc);
if(sdt>0)s++;
else s--;
}
drawPolygon(p,abs(sdt),color,width);
}
void fillCircle(int xc, int yc,float r, int sdt,color_t color, float width)
{
int s,i;
point2D_t p[365];
s=0;
for(i=0;i<=abs(sdt);i++)
{
float srad = s*3.14/180;
p[i].x=(float)((r*cos(srad))+xc);
p[i].y=(float)((r*sin(srad))+yc);
if(sdt>0)s++;
else s--;
}
fillPolygon(p,abs(sdt),color,width);
}

void drawEllipse(float xc,float yc,float r1,float r2,int sdt,color_t color,float


width)
{
int s,i;
point2D_t p[365];
s=0;
for(i=0;i<=abs(sdt);i++)
{
float srad = s*3.14/180;
p[i].x=(float)((r1*cos(srad))+xc);
p[i].y=(float)((r2*sin(srad))+yc);
if(sdt>0)s++;
else s--;
}
drawPolyline(p,abs(sdt),color,width);
}

void fillEllipse(int xc, int yc,float r1,float r2, int sdt,color_t color, float
width)
{
int s,i;
point2D_t p[365];
s=0;
for(i=0;i<=abs(sdt);i++)
{
float srad = s*3.14/180;
p[i].x=(float)((r1*cos(srad))+xc);//mendatar
p[i].y=(float)((r2*sin(srad))+yc);//kebawah
if(sdt>0)s++;
else s--;
}
fillPolygon(p,abs(sdt),color,width);
}

void drawPolar(float xc,float yc, float w, int n, color_t color,int width)


{
int s,sdt,i;
float srad,r;
point2D_t p[1085];
sdt = 360;
s=0;
for(i=0;i<abs(sdt);i++)
{
srad = s*3.14/180;
r=sin(n*srad);
p[i].x=(float)(r*cos(srad)*w)+xc;
p[i].y=(float)(r*sin(srad)*w)+yc;
if(sdt>0) s++;
else s--;
}
drawPolyline(p,abs(sdt),color,width);
}
void fillPolar(int xc, int yc,float w,int n,color_t color, float width)
{
int s,sdt,i;
float srad,r;
point2D_t p[365];
sdt=360;
s=0;
for(i=0;i<=abs(sdt);i++)
{
srad = s*3.14/180;
r=sin(n*srad);
p[i].x=(float)((r*cos(srad))+xc);
p[i].y=(float)((r*sin(srad))+yc);
if(sdt>0)s++;
else s--;

}
fillPolygon(p,abs(sdt),color,width);
}

void drawSpiral(float xc,float yc, float w, int n, color_t color,int width)


{
int s,sdt,i;
float srad,r;
point2D_t p[10000];
sdt = 360*n;
s=0;
for(i=0;i<abs(sdt);i++)
{
srad = s*3.14/180;
r=srad;
p[i].x=(float)(r*cos(srad)*w)+xc;
p[i].y=(float)(r*sin(srad)*w)+yc;
if(sdt>0) s++;
else s--;
}
drawPolyline(p,abs(sdt),color,width);
}

void userdraw()
{
point2D_t sumbu_x[2]={{-600.,0.},{600.,0.}};
point2D_t sumbu_y[2]={{0.,350.},{0.,-350.}};
drawPolyline(sumbu_x,2,hitam,1);
drawPolyline(sumbu_y,2,hitam,1);
point2D_t sumbu_x_bawah[2]={{-600.,-340.},{600.,-340.}};
drawPolyline(sumbu_x_bawah ,2,hitam,5);
point2D_t t1[4]={{-200.,-340.},{-200.,-330.},{200.,-330.},{200.,-340.}};
drawPolyline(t1 ,4,hitam,1);
point2D_t t2[4]={{-190.,-330.},{-190.,-325.},{190.,-325.},{190.,-330.}};
drawPolyline(t2 ,4,hitam,1);
point2D_t t3[4]={{-180.,-325.},{-180.,-320.},{180.,-320.},{180.,-325.}};
drawPolyline(t3 ,4,hitam,1);
point2D_t t4[4]={{-170.,-320.},{-170.,-315.},{170.,-315.},{170.,-320.}};
drawPolyline(t4 ,4,hitam,1);

point2D_t t5[4]={{-160.,-315.},{-160.,-310.},{160.,-310.},{160.,-315.}};
drawPolyline(t5 ,4,hitam,1);

point2D_t dk[4]={{-160.,-310.},{-160.,-305.},{-250.,-305.},{-250.,-310.}};
drawPolygon(dk ,4,hitam,1);
point2D_t dk1[2]={{-245.,-310.},{-245.,-340.}};
drawPolyline(dk1 ,2,hitam,1);
point2D_t cg[4]={{-245.,-305.},{-245.,-140.},{-165.,-140.},{-165.,-305.}};
drawPolygon(cg ,4,hitam,1);

point2D_t at1[4]={{-255.,-135.},{-255.,-130.},{-155.,-130.},{-155.,-135.}};
drawPolygon(at1 ,4,hitam,1);
point2D_t at2[4]={{-240.,-130.},{-240.,-120.},{-170.,-120.},{-170.,-130.}};
drawPolygon(at2 ,4,hitam,1);
point2D_t at3[4]={{-235.,-120.},{-235.,-115.},{-175.,-115.},{-175.,-120.}};
drawPolygon(at3 ,4,hitam,1);
point2D_t at4[4]={{-230.,-70.},{-230.,-60.},{-180.,-60.},{-180.,-70.}};
drawPolygon(at4 ,4,hitam,1);
point2D_t p1kr[2]={{-230.,-115.},{-220.,-10.}};
drawPolyline(p1kr ,2,hitam,1);
point2D_t p2kn[2]={{-180.,-115.},{-190.,-10.}};
drawPolyline(p2kn ,2,hitam,1);
point2D_t at5[4]={{-227.,-20.},{-227.,-15.},{-182.,-15.},{-182.,-20.}};
fillPolygon(at5 ,4,hitam,1);
point2D_t at6[4]={{-225.,-10.},{-225.,-5.},{-185.,-5.},{-185.,-10.}};
fillPolygon(at6 ,4,hitam,1);
//drawCircle(-205.,10.,20.,-90,biru,2);
fillEllipse(-205,6,20,14,360,hitam,2);
point2D_t pc[3]={{-225.,6.},{-205.,40.},{-185.,6.}};
fillPolygon(pc ,3,hitam,1);
point2D_t l[2]={{-205.,40.},{-205.,90.}};
drawPolyline(l ,2,hitam,1);

//drawSpiral(0,0,180,5,hitam,2);
//drawPolar(0.,0.,100.,3,hijau,2);
//point2D_t L1[363],L2[363],L3[363];
//drawCircle(0.,0.,100.,360,merah,2);
//drawCircle(0.,0.,200.,60,biru,2);
//drawCircle(0.,0.,400.,360,hijau,2);
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
userdraw();
glutSwapBuffers();
}

int main(int argc, char **argv)


{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
glutInitWindowPosition(50,30); //canvas posisi mana
glutInitWindowSize(1200, 700); //canvas ukuran tinggi lebar pixel
glutCreateWindow("PRIMITIVE DRAWING"); //title bar
glClearColor( 1.0 , 1.0 ,1.0, 0.0 ); // warna background
//glClearColor( kuning[0], kuning[1] ,kuning[2],
gluOrtho2D( -600. , 600.,
glutIdleFunc(display);
glutDisplayFunc(display);
glutMainLoop();
return 0;
}

0.0 );

-350. , 350. ); // koosdinat posisi canvas