0

Im looking for a "Hello world" code using Mesa 3D. Any help? I have found this code below, but since it is using GL/glut.h I think it corresponds to OpenGL but not Mesa 3D.

#include <GL/glut.h>

void displayMe(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glBegin(GL_POLYGON);
        glVertex3f(0.0, 0.0, 0.0);
        glVertex3f(0.5, 0.0, 0.0);
        glVertex3f(0.5, 0.5, 0.0);
        glVertex3f(0.0, 0.5, 0.0);
    glEnd();
    glFlush();
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE);
    glutInitWindowSize(300, 300);
    glutInitWindowPosition(100, 100);
    glutCreateWindow("Hello world :D");
    glutDisplayFunc(displayMe);
    glutMainLoop();
    return 0;
}
Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
tirenweb
  • 30,963
  • 73
  • 183
  • 303

0 Answers0