home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / lmwrap / igl / draw.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-11  |  1.8 KB  |  65 lines

  1. /*
  2.  * Copyright (c) 1995, Silicon Graphics, Inc.
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and
  5.  * its documentation for any purpose is hereby granted without fee, provided
  6.  * that the name of Silicon Graphics may not be used in any advertising or
  7.  * publicity relating to the software without the specific, prior written
  8.  * permission of Silicon Graphics.
  9.  *
  10.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
  11.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
  12.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  13.  *
  14.  * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
  15.  * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
  16.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE
  17.  * POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN
  18.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  19.  *
  20.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  21.  */
  22. /*----------------------------------------------------------------------------
  23.  *
  24.  * file   : draw.c 
  25.  *
  26.  * Author : Yusuf Attarwala
  27.  * Date   : Mar 95
  28.  *
  29.  *---------------------------------------------------------------------------*/
  30. #include <stdio.h>
  31. #include <gl/device.h>
  32.  
  33. #include "globals.h"
  34.  
  35. void
  36. drawScene()
  37. {
  38.     static float sp1[] = {0.2,0.2,0.2,3.0};
  39.     static float sp2[] = {3.4,3.4,0.2,3.0};
  40.  
  41.     GLXwinset(XtDisplay(glw), XtWindow(glw));
  42.  
  43.     lmbind(LMODEL,curLModel);
  44.  
  45.     RGBcolor(0,0,0);
  46.     clear();
  47.     zclear();
  48.  
  49.     pushmatrix();
  50.     rotate(anglex,'x');
  51.     rotate(angley,'y');
  52.     rotate(anglez,'z');
  53.     lmbind(MATERIAL,curMatSet);
  54.     sphdraw(sp1);
  55.     lmbind(MATERIAL,curMatSet+1);
  56.     sphdraw(sp2);
  57.     popmatrix();
  58.  
  59.     lmbind(LMODEL,0);
  60.  
  61.     if (doubleBuffer) swapbuffers();
  62.  
  63. }
  64.  
  65.