38 lines
No EOL
811 B
C++
38 lines
No EOL
811 B
C++
#include <GL/gl.h>
|
|
#include <GL/glu.h>
|
|
#include <GL/glut.h>
|
|
|
|
void display() {
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
glColor3f(1, 0, 0);
|
|
glBegin(GL_QUADS);
|
|
glVertex2f(150,150);
|
|
glVertex2f(250, 150);
|
|
glVertex2f(50, 50);
|
|
glVertex2f(,);
|
|
glEnd();
|
|
glFlush();
|
|
}
|
|
|
|
void init() {
|
|
// Define a cor de fundo (R, G, B, Alpha) - Preto por omissao
|
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
glutInit(&argc, argv);
|
|
|
|
// Configuracoes basicas da janela
|
|
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
|
|
glutInitWindowSize(400,400);
|
|
|
|
// Cria a janela com o prefixo obrigatorio
|
|
glutCreateWindow("GLUT: Ex2");
|
|
|
|
|
|
gluOrtho2D(0, 400, 400, 0);
|
|
glutDisplayFunc(display);
|
|
glutMainLoop();
|
|
|
|
return 0;
|
|
} |