home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / mesa-1.2.8 / src / clip.h < prev    next >
C/C++ Source or Header  |  1996-05-27  |  2KB  |  92 lines

  1. /* clip.h */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  1.2
  6.  * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library; if not, write to the Free
  20.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. /*
  25.  * Line and polygon clipping.
  26.  */
  27.  
  28.  
  29. /*
  30. $Id: clip.h,v 1.5 1995/10/14 17:41:29 brianp Exp $
  31.  
  32. $Log: clip.h,v $
  33.  * Revision 1.5  1995/10/14  17:41:29  brianp
  34.  * made glClipPlane display list-able
  35.  *
  36.  * Revision 1.4  1995/05/22  20:59:34  brianp
  37.  * Release 1.2
  38.  *
  39.  * Revision 1.3  1995/03/23  17:04:31  brianp
  40.  * added GL_VIEWCLIP_POINT macro
  41.  *
  42.  * Revision 1.2  1995/03/04  19:25:29  brianp
  43.  * 1.1 beta revision
  44.  *
  45.  * Revision 1.1  1995/02/24  14:18:12  brianp
  46.  * Initial revision
  47.  *
  48.  */
  49.  
  50.  
  51. #ifndef CLIP_H
  52. #define CLIP_H
  53.  
  54.  
  55. #include "GL/gl.h"
  56. #include "config.h"
  57.  
  58.  
  59.  
  60. #ifdef DEBUG
  61. #  define GL_VIEWCLIP_POINT( V )   gl_viewclip_point( V )
  62. #else
  63. #  define GL_VIEWCLIP_POINT( V )            \
  64.      (    (V)[0] <= (V)[3] && (V)[0] >= -(V)[3]        \
  65.        && (V)[1] <= (V)[3] && (V)[1] >= -(V)[3]        \
  66.        && (V)[2] <= (V)[3] && (V)[2] >= -(V)[3] )
  67. #endif
  68.  
  69.  
  70.  
  71. extern void gl_clipplane( GLenum plane, const float *equation );
  72.  
  73.  
  74.  
  75. extern GLuint gl_viewclip_point( const GLfloat v[] );
  76.  
  77. extern GLuint gl_viewclip_line( GLuint *i, GLuint *j );
  78.  
  79. extern GLuint gl_viewclip_polygon( GLuint n, GLuint vlist[] );
  80.  
  81.  
  82.  
  83. extern GLuint gl_userclip_point( const GLfloat v[] );
  84.  
  85. extern GLuint gl_userclip_line( GLuint *i, GLuint *j );
  86.  
  87. extern GLuint gl_userclip_polygon( GLuint n, GLuint vlist[] );
  88.  
  89.  
  90. #endif
  91.  
  92.