Advertisement
infogulch

Untitled

Apr 26th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.74 KB | None | 0 0
  1. /* test.c */
  2. /* Ubuntu 12.04.2 guest in Windows 7 Pro VirtualBox (updated) + guestutils
  3. /* compiled with: gcc -lGL -lglut test.c -o test */
  4. /* When run with ./test I get this error:
  5. OpenGL Warning: XGetVisualInfo returned 0 visuals for 0x888c9d8
  6. OpenGL Warning: Retry with 0x8002 returned 0 visuals
  7. Segmentation fault (core dumped)
  8. */
  9.  
  10. #include <GL/glut.h>
  11.  
  12. void draw()
  13. {
  14.     glClearColor(0,1,0,1);
  15.     glClear(GL_COLOR_BUFFER_BIT);
  16.     glFlush();
  17. }
  18.  
  19. int main(int argc, char *argv[])
  20. {
  21.     glutInit(&argc, argv);
  22.     glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
  23.     glutInitWindowPosition(50,25);
  24.     glutInitWindowSize(500,250);
  25.     glutCreateWindow("Green Window");
  26.     glutDisplayFunc(draw);
  27.     glutMainLoop();
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement