File: stereo.c

package info (click to toggle)
glut 3.6-7
  • links: PTS
  • area: main
  • in suites: slink
  • size: 9,104 kB
  • ctags: 15,230
  • sloc: ansic: 131,032; makefile: 2,261; ada: 2,012; yacc: 473; fortran: 290; lex: 131; sed: 49; csh: 38; sh: 4
file content (33 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

/* Copyright (c) Mark J. Kilgard, 1994. */

/* This program is freely distributable without licensing fees 
   and is provided without guarantee or warrantee expressed or 
   implied. This program is -not- in the public domain. */

#include <stdlib.h>
#include <stdio.h>
#include <GL/glut.h>

void
display(void)
{
  glDrawBuffer(GL_BACK_LEFT);
  glClearColor(1.0, 0.0, 0.0, 1.0); /* red */
  glClear(GL_COLOR_BUFFER_BIT);
  glDrawBuffer(GL_BACK_RIGHT);
  glClearColor(0.0, 0.0, 1.0, 1.0); /* blue */
  glClear(GL_COLOR_BUFFER_BIT);
  glutSwapBuffers();
}

int
main(int argc, char **argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_STEREO);
  glutCreateWindow("stereo example");
  glutDisplayFunc(display);
  glutMainLoop();
  return 0;             /* ANSI C requires main to return int. */
}