#include "stdafx.h"
#include <GL/glew.h>
#include <GL/glut.h>
#include <iostream>
#pragma comment( lib, "glew32d.lib" )
using namespace std;
void Init()
{
glEnable(GL_CULL_FACE);
GLfloat lineWidth = 0.5f;
glLineWidth(lineWidth);
glPolygonMode(GL_LINE_STRIP, GL_FRONT_AND_BACK);
glFrontFace(GL_CW);
glCullFace(GL_FRONT);
}
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowPosition(100, 100);
glutInitWindowSize(400, 400);
glutCreateWindow("hello opengl");
if (glewInit())
{
cerr << "errot on glew" <<endl;
}
Init();
glutDisplayFunc(&myDisplay);
glutMainLoop();
return 0;
}
#include <GL/glew.h>
#include <GL/glut.h>
#include <iostream>
#pragma comment( lib, "glew32d.lib" )
using namespace std;
void Init()
{
glEnable(GL_CULL_FACE);
GLfloat lineWidth = 0.5f;
glLineWidth(lineWidth);
glPolygonMode(GL_LINE_STRIP, GL_FRONT_AND_BACK);
glFrontFace(GL_CW);
glCullFace(GL_FRONT);
}
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
glFlush();
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
glutInitWindowPosition(100, 100);
glutInitWindowSize(400, 400);
glutCreateWindow("hello opengl");
if (glewInit())
{
cerr << "errot on glew" <<endl;
}
Init();
glutDisplayFunc(&myDisplay);
glutMainLoop();
return 0;
}