]> icculus.org git repositories - taylor/freespace2.git/blob - include/3dfx.h
embed standalone web in executable
[taylor/freespace2.git] / include / 3dfx.h
1 /*
2 ** Copyright (c) 1995, 3Dfx Interactive, Inc.
3 ** All Rights Reserved.
4 **
5 ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
6 ** the contents of this file may not be disclosed to third parties, copied or
7 ** duplicated in any form, in whole or in part, without the prior written
8 ** permission of 3Dfx Interactive, Inc.
9 **
10 ** RESTRICTED RIGHTS LEGEND:
11 ** Use, duplication or disclosure by the Government is subject to restrictions
12 ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
13 ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
14 ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished  -
15 ** rights reserved under the Copyright Laws of the United States.
16 **
17 ** $Revision$
18 ** $Date$
19 */
20 #ifndef __3DFX_H__
21 #define __3DFX_H__
22
23 /*
24 ** basic data types
25 */
26 typedef unsigned char   FxU8;
27 typedef signed   char   FxI8;
28 typedef unsigned short  FxU16;
29 typedef signed   short  FxI16;
30 typedef signed   long   FxI32;
31 typedef unsigned long   FxU32;
32 typedef int             FxBool;
33 typedef float           FxFloat;
34 typedef double          FxDouble;
35
36 /*
37 ** color types
38 */
39 typedef unsigned long                FxColor_t;
40 typedef struct { float r, g, b, a; } FxColor4;
41
42 /*
43 ** fundamental types
44 */
45 #define FXTRUE    1
46 #define FXFALSE   0
47
48 /*
49 ** helper macros
50 */
51 #define FXUNUSED( a ) ( (a) = (a) )
52 #define FXBIT( i )    ( 1L << (i) )
53
54 /*
55 ** export macros
56 */
57
58 #if defined(__MSC__)
59   #if defined (MSVC16)
60     #define FX_ENTRY 
61     #define FX_CALL
62   #else
63     #define FX_ENTRY extern
64     #define FX_CALL  __stdcall
65   #endif
66 #elif defined(__WATCOMC__)
67   #define FX_ENTRY extern
68   #define FX_CALL  __stdcall
69 #elif defined (__IBMC__) || defined (__IBMCPP__)
70   /*  IBM Visual Age C/C++: */
71   #define FX_ENTRY extern
72   #define FX_CALL  __stdcall
73 #elif defined(__DJGPP__)
74   #define FX_ENTRY extern
75   #define FX_CALL
76 #elif defined(__unix__)
77   #define FX_ENTRY extern
78   #define FX_CALL
79 #else
80   #warning define FX_ENTRY & FX_CALL for your compiler
81   #define FX_ENTRY extern
82   #define FX_CALL
83 #endif
84
85 /*
86 ** x86 compiler specific stuff
87 */
88 #if defined(__BORLANDC_)
89   #  define REALMODE
90
91   #  define REGW( a, b ) ((a).x.b)
92   #  define REGB( a, b ) ((a).h.b)
93   #  define INT86( a, b, c ) int86(a,b,c)
94   #  define INT86X( a, b, c, d ) int86x(a,b,c,d)
95
96   #  define RM_SEG( a ) FP_SEG( a )
97   #  define RM_OFF( a ) FP_OFF( a )
98 #elif defined(__WATCOMC__)
99   #  undef FP_SEG
100   #  undef FP_OFF
101
102   #  define REGW( a, b ) ((a).w.b)
103   #  define REGB( a, b ) ((a).h.b)
104   #  define INT86( a, b, c ) int386(a,b,c)
105   #  define INT86X( a, b, c, d ) int386x(a,b,c,d)
106
107   #  define RM_SEG( a )  ( ( ( ( FxU32 ) (a) ) & 0x000F0000 ) >> 4 )
108   #  define RM_OFF( a )  ( ( FxU16 ) (a) )
109 #endif
110
111 #endif /* !__3DFX_H__ */
112