Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Configurar OpenGL Con Windows 7 Ultimate de 64 Bits
Configurar OpenGL Con Windows 7 Ultimate de 64 Bits
INSTALACIN:
Pueden arrastrar la carpeta freeglut contenida dentro de OPENGL.rar
#include <stdlib.h>
#include <stdio.h>
#include <GL/freeglut.h> //TAMBIN PUEDES PONER: #include <GL/glut.h>
FUNCIONA IGUAL
void reshape(int width, int height)
{
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1, 1, -1, 1, -1, 1);
glMatrixMode(GL_MODELVIEW);
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1,1,1);
glLoadIdentity();
glBegin(GL_TRIANGLES);
glVertex3f(-1,-1,0);
glVertex3f(1,-1,0);
glVertex3f(0,1,0);
glEnd();
glFlush();
}
void init(void)
{
glClearColor(0,0,0,0);
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition(50, 50);
glutInitWindowSize(500, 500);
glutCreateWindow("Hello OpenGL");
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutMainLoop();
return 0;
}
Salida en pantalla: