home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / src / api.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-31  |  2.1 KB  |  95 lines

  1. /* $Id: api.h,v 1.1 1997/08/22 01:42:26 brianp Exp $ */
  2.  
  3. /*
  4.  * Mesa 3-D graphics library
  5.  * Version:  2.4
  6.  * Copyright (C) 1995-1997  Brian Paul
  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.  * $Log: api.h,v $
  26.  * Revision 1.1  1997/08/22 01:42:26  brianp
  27.  * Initial revision
  28.  *
  29.  */
  30.  
  31.  
  32. /*
  33.  * The original api.c file has been split into two files:  api1.c and api2.c
  34.  * because some compilers complained that api.c was too big.
  35.  *
  36.  * This header contains stuff only included by api1.c and api2.c
  37.  */
  38.  
  39.  
  40. #ifndef API_H
  41. #define API_H
  42.  
  43.  
  44. /*
  45.  * Single/multiple thread context selection.
  46.  */
  47. #ifdef MULTI_THREADING
  48.  
  49. /* Get the context associated with the calling thread */
  50. #define GET_CONTEXT    GLcontext *CC = gl_get_thread_context()
  51.  
  52. #else
  53.  
  54. /* CC is a global pointer for all threads in the address space */
  55. #define GET_CONTEXT
  56.  
  57. #endif /*MULTI_THREADED*/
  58.  
  59.  
  60. /*
  61.  * Make sure there's a rendering context.
  62.  */
  63. #define CHECK_CONTEXT                            \
  64.    if (!CC) {                                \
  65.       if (getenv("MESA_DEBUG")) {                    \
  66.      fprintf(stderr,"Mesa user error: no rendering context.\n");    \
  67.       }                                    \
  68.       return;                                \
  69.    }
  70.  
  71. #define CHECK_CONTEXT_RETURN(R)                        \
  72.    if (!CC) {                                \
  73.       if (getenv("MESA_DEBUG")) {                    \
  74.          fprintf(stderr,"Mesa user error: no rendering context.\n");    \
  75.       }                                    \
  76.       return (R);                            \
  77.    }
  78.  
  79.  
  80. /*
  81.  * An optimization in a few performance-critical functions.
  82.  */
  83. #define SHORTCUT
  84.  
  85.  
  86. /*
  87.  * Windows 95/NT DLL stuff.
  88.  */
  89. #ifndef WINDOWS_NT
  90. #define APIENTRY
  91. #endif
  92.  
  93.  
  94. #endif
  95.