Created
November 13, 2017 03:39
-
-
Save JSiapo/8336cc91ea2e8f4048b031eeed32035c to your computer and use it in GitHub Desktop.
Inicializar OpenGL en C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Libreria usada solo en Windows - debe ir antes que la libreria GL/glut.h */ | |
#include<windows.h> | |
/*Libreria del OpenGL*/ | |
#include<GL/glut.h> | |
void draw(void) | |
{ | |
glClear(GL_COLOR_BUFFER_BIT); | |
/*todo lo que se quiera pintar*/ | |
glFlush(); | |
} | |
int main(int argc, char**argv) | |
{ | |
glutInit(&argc,argv); | |
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); | |
glutInitWindowSize(760,600); | |
glutInitWindowPosition(300,100); | |
glutCreateWindow("OpenGL"); | |
glClearColor(1.0,1.0,1.0,0.0); | |
glMatrixMode(GL_PROJECTION); | |
gluOrtho2D(-40,40,-40,40); | |
glutDisplayFunc(draw); | |
glutMainLoop(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment