home *** CD-ROM | disk | FTP | other *** search
/ Amiga Magazin: Amiga-CD 2000 April & May / AMIGA_2000_04.iso / patches / mesa3.1 / mesa-aux.lha / include / GL / glaux.h
Encoding:
C/C++ Source or Header  |  1998-09-18  |  8.2 KB  |  351 lines

  1. /*
  2.  * $Id: glaux.h,v 1.2 1998/01/16 02:28:47 brianp Exp $ 
  3.  */
  4.  
  5. /*
  6.  * Mesa - a 3-D graphics library
  7.  * Version:  2.6
  8.  * Copyright (C) 1995-1996  Brian Paul
  9.  *
  10.  * This library is free software; you can redistribute it and/or
  11.  * modify it under the terms of the GNU Library General Public
  12.  * License as published by the Free Software Foundation; either
  13.  * version 2 of the License, or (at your option) any later version.
  14.  *
  15.  * This library is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18.  * Library General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU Library General Public
  21.  * License along with this library; if not, write to the Free
  22.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. /*
  26.  * This code originated from SGI and was modified for use with Mesa.
  27.  */
  28.  
  29. #ifndef AUX_INCLUDED
  30. #define AUX_INCLUDED
  31.  
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35.  
  36. #if !defined(AMIGA) && !defined(__WIN32__) && !defined(NeXT) && !defined(__QUICKDRAW__) && !defined(DOSVGA) && !defined(__BEOS__)
  37. #include <X11/Xlib.h>
  38. #include <X11/Xutil.h>
  39. #endif
  40. #ifdef __BEOS__
  41. #include "GL/gl.h"
  42. #include "GL/glu.h"
  43. #else
  44. #include <GL/gl.h>
  45. #include <GL/glu.h>
  46. #endif
  47.  
  48. /*
  49.  * ** ToolKit Window Types
  50.  * ** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
  51.  */
  52.  
  53. #define AUX_RGB        0
  54. #define AUX_RGBA    AUX_RGB
  55. #define AUX_INDEX    1
  56. #define AUX_SINGLE    0
  57. #define AUX_DOUBLE    2
  58. #define AUX_DIRECT    0
  59. #define AUX_INDIRECT    4
  60.  
  61. #define AUX_ACCUM    8
  62. #define AUX_ALPHA    16
  63. #define AUX_DEPTH    32
  64. #define AUX_STENCIL    64
  65. #define AUX_AUX        128
  66.  
  67. /*
  68.  * ** Window Masks
  69.  */
  70.  
  71. #define AUX_WIND_IS_RGB(x)    (((x) & AUX_INDEX) == 0)
  72. #define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
  73. #define AUX_WIND_IS_SINGLE(x)    (((x) & AUX_DOUBLE) == 0)
  74. #define AUX_WIND_IS_DOUBLE(x)    (((x) & AUX_DOUBLE) != 0)
  75. #define AUX_WIND_IS_INDIRECT(x)    (((x) & AUX_INDIRECT) != 0)
  76. #define AUX_WIND_IS_DIRECT(x)    (((x) & AUX_INDIRECT) == 0)
  77. #define AUX_WIND_HAS_ACCUM(x)    (((x) & AUX_ACCUM) != 0)
  78. #define AUX_WIND_HAS_ALPHA(x)    (((x) & AUX_ALPHA) != 0)
  79. #define AUX_WIND_HAS_DEPTH(x)    (((x) & AUX_DEPTH) != 0)
  80. #define AUX_WIND_HAS_STENCIL(x)    (((x) & AUX_STENCIL) != 0)
  81.  
  82. /*
  83.  * ** Display Mode Selection Criteria
  84.  */
  85.  
  86.   enum {
  87.     AUX_USE_ID = 1,
  88.     AUX_EXACT_MATCH,
  89.     AUX_MINIMUM_CRITERIA
  90.   };
  91.  
  92. #define AUX_OFF 0
  93. #define AUX_ON 1
  94.  
  95. /*
  96.  * ** ToolKit Event Structure
  97.  */
  98.  
  99.   typedef struct _AUX_EVENTREC {
  100.     GLint event;
  101.     GLint data[4];
  102.   } AUX_EVENTREC;
  103.  
  104. /*
  105.  * ** ToolKit Event Types
  106.  */
  107. #define AUX_EXPOSE    1
  108. #define AUX_CONFIG    2
  109. #define AUX_DRAW    4
  110. #define AUX_KEYEVENT    8
  111. #define AUX_MOUSEDOWN    16
  112. #define AUX_MOUSEUP    32
  113. #define AUX_MOUSELOC    64
  114.  
  115. /*
  116.  * ** Toolkit Event Data Indices
  117.  */
  118. #define AUX_WINDOWX        0
  119. #define AUX_WINDOWY        1
  120. #define AUX_MOUSEX        0
  121. #define AUX_MOUSEY        1
  122. #define AUX_MOUSESTATUS        3
  123. #define AUX_KEY            0
  124. #define AUX_KEYSTATUS        1
  125.  
  126. /*
  127.  * ** ToolKit Event Status Messages
  128.  */
  129. #define    AUX_LEFTBUTTON        1
  130. #define    AUX_RIGHTBUTTON        2
  131. #define    AUX_MIDDLEBUTTON    4
  132. #define    AUX_SHIFT        1
  133. #define    AUX_CONTROL        2
  134.  
  135. /*
  136.  * ** ToolKit Key Codes
  137.  */
  138. #define AUX_RETURN        0x0D
  139. #define AUX_ESCAPE        0x1B
  140. #define AUX_SPACE        0x20
  141. #define AUX_LEFT        0x25
  142. #define AUX_UP            0x26
  143. #define AUX_RIGHT        0x27
  144. #define AUX_DOWN        0x28
  145. #define AUX_A            'A'
  146. #define AUX_B            'B'
  147. #define AUX_C            'C'
  148. #define AUX_D            'D'
  149. #define AUX_E            'E'
  150. #define AUX_F            'F'
  151. #define AUX_G            'G'
  152. #define AUX_H            'H'
  153. #define AUX_I            'I'
  154. #define AUX_J            'J'
  155. #define AUX_K            'K'
  156. #define AUX_L            'L'
  157. #define AUX_M            'M'
  158. #define AUX_N            'N'
  159. #define AUX_O            'O'
  160. #define AUX_P            'P'
  161. #define AUX_Q            'Q'
  162. #define AUX_R            'R'
  163. #define AUX_S            'S'
  164. #define AUX_T            'T'
  165. #define AUX_U            'U'
  166. #define AUX_V            'V'
  167. #define AUX_W            'W'
  168. #define AUX_X            'X'
  169. #define AUX_Y            'Y'
  170. #define AUX_Z            'Z'
  171. #define AUX_a            'a'
  172. #define AUX_b            'b'
  173. #define AUX_c            'c'
  174. #define AUX_d            'd'
  175. #define AUX_e            'e'
  176. #define AUX_f            'f'
  177. #define AUX_g            'g'
  178. #define AUX_h            'h'
  179. #define AUX_i            'i'
  180. #define AUX_j            'j'
  181. #define AUX_k            'k'
  182. #define AUX_l            'l'
  183. #define AUX_m            'm'
  184. #define AUX_n            'n'
  185. #define AUX_o            'o'
  186. #define AUX_p            'p'
  187. #define AUX_q            'q'
  188. #define AUX_r            'r'
  189. #define AUX_s            's'
  190. #define AUX_t            't'
  191. #define AUX_u            'u'
  192. #define AUX_v            'v'
  193. #define AUX_w            'w'
  194. #define AUX_x            'x'
  195. #define AUX_y            'y'
  196. #define AUX_z            'z'
  197. #define AUX_0            '0'
  198. #define AUX_1            '1'
  199. #define AUX_2            '2'
  200. #define AUX_3            '3'
  201. #define AUX_4            '4'
  202. #define AUX_5            '5'
  203. #define AUX_6            '6'
  204. #define AUX_7            '7'
  205. #define AUX_8            '8'
  206. #define AUX_9            '9'
  207.  
  208. /*
  209.  * ** ToolKit Gets and Sets
  210.  */
  211. #define AUX_FD            1                           /*
  212.                                             * return fd (long) 
  213.                                             */
  214. #define AUX_COLORMAP        3                           /*
  215.                                             * pass buf of r, g and b (unsigned char) 
  216.                                             */
  217. #define AUX_GREYSCALEMAP    4
  218. #define AUX_FOGMAP        5                           /*
  219.                                             * pass fog and color bits (long) 
  220.                                             */
  221. #define AUX_ONECOLOR        6                           /*
  222.                                             * pass index, r, g, and b (long) 
  223.                                             */
  224.  
  225. /*
  226.  * ** Color Macros
  227.  */
  228.  
  229.   enum {
  230.     AUX_BLACK = 0,
  231. #ifdef __WIN32__
  232.     AUX_RED = 10,
  233. #else
  234.     AUX_RED,
  235. #endif
  236.     AUX_GREEN,
  237.     AUX_YELLOW,
  238.     AUX_BLUE,
  239.     AUX_MAGENTA,
  240.     AUX_CYAN,
  241.     AUX_WHITE
  242.   };
  243.  
  244. #if defined(__WIN32__) || defined(DOSVGA)
  245.   extern float auxRGBMap[17][3];
  246. #else
  247.   extern float auxRGBMap[8][3];
  248. #endif
  249.  
  250. #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
  251.                    glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
  252.  
  253. /*
  254.  * ** RGB Image Structure
  255.  */
  256.  
  257.   typedef struct _AUX_RGBImageRec {
  258.     GLint sizeX, sizeY;
  259.     unsigned char *data;
  260.   } AUX_RGBImageRec;
  261.  
  262. /*
  263.  * ** Prototypes
  264.  */
  265.  
  266. #ifdef __BEOS__
  267. #pragma export on
  268. #endif
  269.  
  270.   extern void auxInitDisplayMode(GLbitfield);
  271.   extern void auxInitPosition(int, int, int, int);
  272.   extern GLenum auxInitWindow(char *);
  273.   extern void auxCloseWindow(void);
  274.   extern void auxQuit(void);
  275.   extern void auxSwapBuffers(void);
  276.  
  277. #ifdef    __amigaos__
  278.   extern void *auxAOSWindow(void);
  279.   extern void *auxAOSScreen(void);
  280.   extern void *auxAOSContext(void);
  281. #endif
  282.  
  283.   extern void auxMainLoop(void (*)(void));
  284.   extern void auxExposeFunc(void (*)(int, int));
  285.   extern void auxReshapeFunc(void (*)(int, int));
  286.   extern void auxIdleFunc(void (*)(void));
  287.   extern void auxKeyFunc(int, void (*)(void));
  288.   extern void auxMouseFunc(int, int, void (*)(AUX_EVENTREC *));
  289.  
  290.   extern void auxDeleteMouseFunc(int, int, void (*)(AUX_EVENTREC *));
  291.  
  292.   extern int auxGetColorMapSize(void);
  293.   extern void auxGetMouseLoc(int *, int *);
  294.   extern void auxSetOneColor(int, float, float, float);
  295.   extern void auxSetFogRamp(int, int);
  296.   extern void auxSetGreyRamp(void);
  297.   extern void auxSetRGBMap(int, float *);
  298.  
  299.   extern AUX_RGBImageRec *auxRGBImageLoad(char *);
  300.  
  301.   extern void auxCreateFont(void);
  302.   extern void auxDrawStr(char *);
  303.  
  304.   extern void auxWireSphere(GLdouble);
  305.   extern void auxSolidSphere(GLdouble);
  306.   extern void auxWireCube(GLdouble);
  307.   extern void auxSolidCube(GLdouble);
  308.   extern void auxWireBox(GLdouble, GLdouble, GLdouble);
  309.   extern void auxSolidBox(GLdouble, GLdouble, GLdouble);
  310.   extern void auxWireTorus(GLdouble, GLdouble);
  311.   extern void auxSolidTorus(GLdouble, GLdouble);
  312.   extern void auxWireCylinder(GLdouble, GLdouble);
  313.   extern void auxSolidCylinder(GLdouble, GLdouble);
  314.   extern void auxWireIcosahedron(GLdouble);
  315.   extern void auxSolidIcosahedron(GLdouble);
  316.   extern void auxWireOctahedron(GLdouble);
  317.   extern void auxSolidOctahedron(GLdouble);
  318.   extern void auxWireTetrahedron(GLdouble);
  319.   extern void auxSolidTetrahedron(GLdouble);
  320.   extern void auxWireDodecahedron(GLdouble);
  321.   extern void auxSolidDodecahedron(GLdouble);
  322.   extern void auxWireCone(GLdouble, GLdouble);
  323.   extern void auxSolidCone(GLdouble, GLdouble);
  324.   extern void auxWireTeapot(GLdouble);
  325.   extern void auxSolidTeapot(GLdouble);
  326.  
  327. /*
  328.  * added for viewperf benchmark 
  329.  */
  330.   extern void auxInitDisplayModePolicy(GLenum type);
  331.   extern GLenum auxGetDisplayModePolicy(void);
  332.   extern GLenum auxInitDisplayModeID(GLint id);
  333.   extern GLint auxGetDisplayModeID(void);
  334.   extern GLenum auxGetDisplayMode(void);
  335.  
  336.   extern void auxGetScreenSize(GLint * width, GLint * height);
  337.  
  338.   extern void auxAnimation(GLint flag);
  339.  
  340. #ifdef __BEOS__
  341. #pragma export off
  342. #endif
  343.  
  344. #ifdef __cplusplus
  345. }
  346.  
  347. #endif
  348. #endif                                           /*
  349.                                             * AUX_INCLUDED 
  350.                                             */
  351.