28 lines
666 B
C++
28 lines
666 B
C++
|
// http://www.codebind.com/linux-tutorials/install-opengl-ubuntu-linux/
|
||
|
#include <GL/glew.h>
|
||
|
#include <GL/glut.h>
|
||
|
|
||
|
void displayMe(void)
|
||
|
{
|
||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||
|
glBegin(GL_POLYGON);
|
||
|
glVertex3f(0.5, 0.0, 0.5);
|
||
|
glVertex3f(0.5, 0.0, 0.0);
|
||
|
glVertex3f(0.0, 0.5, 0.0);
|
||
|
glVertex3f(0.0, 0.0, 0.5);
|
||
|
glEnd();
|
||
|
glFlush();
|
||
|
}
|
||
|
|
||
|
int main(int argc, char** argv)
|
||
|
{
|
||
|
glutInit(&argc, argv);
|
||
|
glutInitDisplayMode(GLUT_SINGLE);
|
||
|
glutInitWindowSize(1920, 1080);
|
||
|
glutInitWindowPosition(0, 0);
|
||
|
glutCreateWindow("Hello world!");
|
||
|
glutFullScreen();
|
||
|
glutDisplayFunc(displayMe);
|
||
|
glutMainLoop();
|
||
|
return 0;
|
||
|
}
|