#include<GL/glu.h>
#include<GL/glut.h>
#include<GL/gl.h>
void display()
{
glClearColor(1.0,1.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glPointSize(15);
glBegin(GL_QUADS);
glVertex2f(90,100);
glVertex2f(180,100);
glVertex2f(200,150);
glColor3f(1.0,0.0,1.0);
glVertex2f(140,150);
//glVertex2f(140,200);
//glVertex2f(180,200);
glColor3f(1.0,1.0,0.0);
//glVertex2f(250,140);
glEnd();
glFlush();
}
void init(void)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,640.0,0.0,480.0);
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitWindowSize(640,480);
glutInitWindowPosition(100,150);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutCreateWindow("Going for a SMILEY :-)");
init();
glutDisplayFunc(display);
glutMainLoop();
}
#include<GL/glut.h>
#include<GL/gl.h>
void display()
{
glClearColor(1.0,1.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glPointSize(15);
glBegin(GL_QUADS);
glVertex2f(90,100);
glVertex2f(180,100);
glVertex2f(200,150);
glColor3f(1.0,0.0,1.0);
glVertex2f(140,150);
//glVertex2f(140,200);
//glVertex2f(180,200);
glColor3f(1.0,1.0,0.0);
//glVertex2f(250,140);
glEnd();
glFlush();
}
void init(void)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,640.0,0.0,480.0);
}
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitWindowSize(640,480);
glutInitWindowPosition(100,150);
glutInitDisplayMode(GLUT_RGB|GLUT_SINGLE);
glutCreateWindow("Going for a SMILEY :-)");
init();
glutDisplayFunc(display);
glutMainLoop();
}
No comments:
Post a Comment