home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / opengl / auxdemo / simple.c < prev    next >
C/C++ Source or Header  |  1999-05-11  |  3KB  |  82 lines

  1. static char sccsid[] = "@(#)77    1.2  src/gos/3d/OPENGL/SAMPLES/prog_guide/simple.c, gltest, gos411, 9428A410i 4/11/94 23:25:16";
  2. /*
  3.  *   COMPONENT_NAME: gltest
  4.  *
  5.  *   FUNCTIONS: main
  6.  *
  7.  *   ORIGINS: 103,27
  8.  *
  9.  *
  10.  *   (C) COPYRIGHT International Business Machines Corp. 1994
  11.  *   All Rights Reserved
  12.  *   Licensed Materials - Property of IBM
  13.  *   US Government Users Restricted Rights - Use, duplication or
  14.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  15.  */
  16. /*
  17.  */
  18. /*
  19.  * (c) Copyright 1993, Silicon Graphics, Inc.
  20.  * ALL RIGHTS RESERVED 
  21.  * Permission to use, copy, modify, and distribute this software for 
  22.  * any purpose and without fee is hereby granted, provided that the above
  23.  * copyright notice appear in all copies and that both the copyright notice
  24.  * and this permission notice appear in supporting documentation, and that 
  25.  * the name of Silicon Graphics, Inc. not be used in advertising
  26.  * or publicity pertaining to distribution of the software without specific,
  27.  * written prior permission. 
  28.  *
  29.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  30.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  31.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  32.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  33.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  34.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  35.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  36.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  37.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  38.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  39.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  40.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  41.  * 
  42.  * US Government Users Restricted Rights 
  43.  * Use, duplication, or disclosure by the Government is subject to
  44.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  45.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  46.  * clause at DFARS 252.227-7013 and/or in similar or successor
  47.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  48.  * Unpublished-- rights reserved under the copyright laws of the
  49.  * United States.  Contractor/manufacturer is Silicon Graphics,
  50.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  51.  *
  52.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  53.  */
  54. /*
  55.  *  simple.c
  56.  *  This program draws a white rectangle on a black background.
  57.  */
  58. #include <GL/gl.h>
  59. #include "aux.h"
  60.  
  61. int main(int argc, char** argv)
  62. {
  63.     auxInitDisplayMode (AUX_SINGLE | AUX_RGB);
  64.     auxInitPosition (0, 0, 500, 500);
  65.     auxInitWindow (argv[0]);
  66.  
  67.     glClearColor (0.0, 0.0, 0.0, 0.0);
  68.     glClear(GL_COLOR_BUFFER_BIT);
  69.     glColor3f(1.0, 1.0, 1.0);
  70.     glMatrixMode (GL_PROJECTION);
  71.     glLoadIdentity ();
  72.     glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
  73.     glBegin(GL_POLYGON);
  74.          glVertex2f(-0.5, -0.5);
  75.          glVertex2f(-0.5, 0.5);
  76.          glVertex2f(0.5, 0.5);
  77.          glVertex2f(0.5, -0.5);
  78.     glEnd();
  79.     glFlush();
  80.     DosSleep (1000);
  81. }
  82.