2 #ifndef INCLUDED_LIB3DS_TYPES_H
3 #define INCLUDED_LIB3DS_TYPES_H
5 * The 3D Studio File Format Library
6 * Copyright (C) 1996-2001 by J.E. Hoffmann <je-h@gmx.net>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or (at
12 * your option) any later version.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 * License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * $Id: types.h,v 1.18 2005/01/11 16:12:52 madmac Exp $
29 #if defined (UBUILD_SHARED) && defined(_WIN32) && (!defined(__GNUC__))
31 #define LIB3DSAPI __declspec(dllexport)
33 #define LIB3DSAPI __declspec(dllimport)
40 #define LIB3DS_FALSE 0
42 typedef int Lib3dsBool;
43 typedef unsigned char Lib3dsByte;
44 typedef unsigned short int Lib3dsWord;
45 typedef unsigned long Lib3dsDword;
46 typedef signed char Lib3dsIntb;
47 typedef signed short int Lib3dsIntw;
48 typedef signed long Lib3dsIntd;
49 typedef float Lib3dsFloat;
50 typedef double Lib3dsDouble;
52 typedef float Lib3dsVector[3];
53 typedef float Lib3dsTexel[2];
54 typedef float Lib3dsQuat[4];
55 typedef float Lib3dsMatrix[4][4];
56 typedef float Lib3dsRgb[3];
57 typedef float Lib3dsRgba[4];
59 #define LIB3DS_EPSILON (1e-8)
60 #define LIB3DS_PI 3.14159265358979323846
61 #define LIB3DS_TWOPI (2.0*LIB3DS_PI)
62 #define LIB3DS_HALFPI (LIB3DS_PI/2.0)
63 #define LIB3DS_RAD_TO_DEG(x) ((180.0/LIB3DS_PI)*(x))
64 #define LIB3DS_DEG_TO_RAD(x) ((LIB3DS_PI/180.0)*(x))
66 #ifndef INCLUDED_STDIO_H
67 #define INCLUDED_STDIO_H
74 #define ASSERT(__expr) assert(__expr)
76 #define LIB3DS_ERROR_LOG \
77 {printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
80 #define ASSERT(__expr)
82 #define LIB3DS_ERROR_LOG
85 typedef struct _Lib3dsIo Lib3dsIo;
86 typedef struct _Lib3dsFile Lib3dsFile;
87 typedef struct _Lib3dsBackground Lib3dsBackground;
88 typedef struct _Lib3dsAtmosphere Lib3dsAtmosphere;
89 typedef struct _Lib3dsShadow Lib3dsShadow;
90 typedef struct _Lib3dsViewport Lib3dsViewport;
91 typedef struct _Lib3dsMaterial Lib3dsMaterial;
92 typedef struct _Lib3dsFace Lib3dsFace;
93 typedef struct _Lib3dsBoxMap Lib3dsBoxMap;
94 typedef struct _Lib3dsMapData Lib3dsMapData;
95 typedef struct _Lib3dsMesh Lib3dsMesh;
96 typedef struct _Lib3dsCamera Lib3dsCamera;
97 typedef struct _Lib3dsLight Lib3dsLight;
98 typedef struct _Lib3dsBoolKey Lib3dsBoolKey;
99 typedef struct _Lib3dsBoolTrack Lib3dsBoolTrack;
100 typedef struct _Lib3dsLin1Key Lib3dsLin1Key;
101 typedef struct _Lib3dsLin1Track Lib3dsLin1Track;
102 typedef struct _Lib3dsLin3Key Lib3dsLin3Key;
103 typedef struct _Lib3dsLin3Track Lib3dsLin3Track;
104 typedef struct _Lib3dsQuatKey Lib3dsQuatKey;
105 typedef struct _Lib3dsQuatTrack Lib3dsQuatTrack;
106 typedef struct _Lib3dsMorphKey Lib3dsMorphKey;
107 typedef struct _Lib3dsMorphTrack Lib3dsMorphTrack;
109 typedef enum _Lib3dsNodeTypes {
110 LIB3DS_UNKNOWN_NODE =0,
111 LIB3DS_AMBIENT_NODE =1,
112 LIB3DS_OBJECT_NODE =2,
113 LIB3DS_CAMERA_NODE =3,
114 LIB3DS_TARGET_NODE =4,
115 LIB3DS_LIGHT_NODE =5,
119 typedef struct _Lib3dsNode Lib3dsNode;
121 typedef union _Lib3dsUserData {
126 Lib3dsMaterial *material;
128 Lib3dsCamera *camera;
133 #ifndef LIB3DS_EXPORT
134 /* The purpose of this variable is to force a recompile of any code
135 * that links to the lib3ds library whenever there is an incompatible
136 * change in the header files. It should be sufficient to include
137 * any lib3ds header file in any source file to satisfy this dependency.
139 * This variable will be updated any time there is an incompatible change
140 * in the lib3ds data structures.
142 // int lib3ds_version1_3;