Last active
July 30, 2023 22:06
-
-
Save fegemo/ddfa33441281e564eefe to your computer and use it in GitHub Desktop.
Um Hello World em OpenGL usando C e GLUT.
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
#include <GL/freeglut.h> | |
void desenhaMinhaCena(void) | |
{ | |
glClearColor(1, 1, 1, 1); | |
glClear(GL_COLOR_BUFFER_BIT); | |
glBegin(GL_TRIANGLE_FAN); | |
glVertex3f(-0.5, -0.5, 0.0); | |
glVertex3f( 0.5, -0.5, 0.0); | |
glVertex3f( 0.5, 0.5, 0.0); | |
glVertex3f(-0.5, 0.5, 0.0); | |
glEnd(); | |
glFlush(); | |
} | |
int main(int argc, char** argv) | |
{ | |
glutInit(&argc, argv); | |
glutInitDisplayMode(GLUT_SINGLE); | |
glutInitWindowSize(500, 500); | |
glutCreateWindow("Hello World"); | |
glutDisplayFunc(desenhaMinhaCena); | |
glutMainLoop(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment