$40 off Craftsman 5 Drawer Homeowner Tool Center with Riser and Parts Bins $99.99 on sale 10/2-10/8
Sears Deal of the Day: Thule Car Top Carrier, Quest

Figure 40
=========================
/*
//Author: Cheikh Drame
//To support, please do one of the following
//- Visit irap123.com many times a day
//- Join irap123.com
//- Buy my app irap123 (rhyming dictionary) available for android, and iphone. On windows phone, it is called iLyrics. If not, you can get the desktop version at www.irap123.com/apps/webstore/
//- Include irap123.com in your blogs, forums, facebook walls, email footers, comments
//- send a donation at my paypal address at cbdsigned.vevo@gmail.com
//- Buy a story at http://shop.pparzygnat.com
*/
// OpenGLtrial.cpp : Defines the entry point for the console application.
//
#include
#include
int width=400, height=400;
void display()
{
//glClear(GL_COLOR_BUFFER_BIT);
//glColor3f(0.0, 1.0, 0.0);
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
//glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glColor3f(1,0,0);//red
glBegin(GL_POLYGON);//rectangle
glVertex2i(10,200); glVertex2i(110,200); glVertex2i(110,100); glVertex2i(10,100);
glEnd();
glColor3f(0.0, 1,0);//green
glBegin(GL_POLYGON);//triangle
glVertex2i(100,100); glVertex2i(200,300); glVertex2i(100,300);
glEnd();
glFlush();
}
void main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB);
glutInitWindowSize(width, height);
glutCreateWindow("Buffer Test by irap123.com");
//glClearColor(0.0, 0.0, 0.0, 0.0);
gluOrtho2D(0, width, height, 0);
glutDisplayFunc(display);
glutMainLoop();
}
No comments:
Post a Comment