C:/jkyprian/devel/lib3ds/lib3ds/types.h

00001 /* -*- c -*- */
00002 #ifndef INCLUDED_LIB3DS_TYPES_H
00003 #define INCLUDED_LIB3DS_TYPES_H
00004 /*
00005  * The 3D Studio File Format Library
00006  * Copyright (C) 1996-2007 by Jan Eric Kyprianidis <www.kyprianidis.com>
00007  * All rights reserved.
00008  *
00009  * This program is  free  software;  you can redistribute it and/or modify it
00010  * under the terms of the  GNU Lesser General Public License  as published by 
00011  * the  Free Software Foundation;  either version 2.1 of the License,  or (at 
00012  * your option) any later version.
00013  *
00014  * This  program  is  distributed in  the  hope that it will  be useful,  but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00016  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public  
00017  * License for more details.
00018  *
00019  * You should  have received  a copy of the GNU Lesser General Public License
00020  * along with  this program;  if not, write to the  Free Software Foundation,
00021  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00022  *
00023  * $Id: types.h,v 1.25 2007/06/21 08:36:41 jeh Exp $
00024  */
00025 #ifdef __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #ifdef _MSC_VER
00030 #ifdef LIB3DS_EXPORTS
00031 #define LIB3DSAPI __declspec(dllexport)
00032 #else               
00033 #define LIB3DSAPI __declspec(dllimport)
00034 #endif           
00035 #else
00036 #define LIB3DSAPI
00037 #endif
00038 
00039 #define LIB3DS_TRUE 1
00040 #define LIB3DS_FALSE 0
00041 
00042 #ifdef _MSC_VER
00043 typedef __int32 Lib3dsBool;
00044 typedef unsigned __int8 Lib3dsByte;
00045 typedef unsigned __int16 Lib3dsWord;
00046 typedef unsigned __int32 Lib3dsDword;
00047 typedef signed __int8 Lib3dsIntb;
00048 typedef signed __int16 Lib3dsIntw;
00049 typedef signed __int16 Lib3dsIntd;
00050 #else
00051 #include <stdint.h>
00052 typedef int32_t Lib3dsBool;
00053 typedef uint8_t Lib3dsByte;
00054 typedef uint16_t Lib3dsWord;
00055 typedef uint32_t Lib3dsDword;
00056 typedef int8_t Lib3dsIntb;
00057 typedef int16_t Lib3dsIntw;
00058 typedef int32_t Lib3dsIntd;
00059 #endif
00060 
00061 typedef float Lib3dsFloat;
00062 typedef double Lib3dsDouble;
00063 
00064 typedef float Lib3dsVector[3];
00065 typedef float Lib3dsTexel[2];
00066 typedef float Lib3dsQuat[4];
00067 typedef float Lib3dsMatrix[4][4];
00068 typedef float Lib3dsRgb[3];
00069 typedef float Lib3dsRgba[4];
00070 
00071 #define LIB3DS_EPSILON (1e-8)
00072 #define LIB3DS_PI 3.14159265358979323846
00073 #define LIB3DS_TWOPI (2.0*LIB3DS_PI)
00074 #define LIB3DS_HALFPI (LIB3DS_PI/2.0)
00075 #define LIB3DS_RAD_TO_DEG(x) ((180.0/LIB3DS_PI)*(x))
00076 #define LIB3DS_DEG_TO_RAD(x) ((LIB3DS_PI/180.0)*(x))
00077   
00078 #include <stdio.h>
00079 
00080 #ifdef _DEBUG
00081   #ifndef ASSERT
00082   #include <assert.h>
00083   #define ASSERT(__expr) assert(__expr)
00084   #endif
00085   #define LIB3DS_ERROR_LOG \
00086     {printf("\t***LIB3DS_ERROR_LOG*** %s : %d\n", __FILE__, __LINE__);}
00087 #else 
00088   #ifndef ASSERT
00089   #define ASSERT(__expr)
00090   #endif
00091   #define LIB3DS_ERROR_LOG
00092 #endif
00093 
00094 typedef struct Lib3dsIo Lib3dsIo;
00095 typedef struct Lib3dsFile Lib3dsFile;
00096 typedef struct Lib3dsBackground Lib3dsBackground;
00097 typedef struct Lib3dsAtmosphere Lib3dsAtmosphere;
00098 typedef struct Lib3dsShadow Lib3dsShadow;
00099 typedef struct Lib3dsViewport Lib3dsViewport;
00100 typedef struct Lib3dsMaterial Lib3dsMaterial;
00101 typedef struct Lib3dsFace Lib3dsFace; 
00102 typedef struct Lib3dsBoxMap Lib3dsBoxMap; 
00103 typedef struct Lib3dsMapData Lib3dsMapData; 
00104 typedef struct Lib3dsMesh Lib3dsMesh;
00105 typedef struct Lib3dsCamera Lib3dsCamera;
00106 typedef struct Lib3dsLight Lib3dsLight;
00107 typedef struct Lib3dsBoolKey Lib3dsBoolKey;
00108 typedef struct Lib3dsBoolTrack Lib3dsBoolTrack;
00109 typedef struct Lib3dsLin1Key Lib3dsLin1Key;
00110 typedef struct Lib3dsLin1Track Lib3dsLin1Track;
00111 typedef struct Lib3dsLin3Key Lib3dsLin3Key;
00112 typedef struct Lib3dsLin3Track Lib3dsLin3Track;
00113 typedef struct Lib3dsQuatKey Lib3dsQuatKey;
00114 typedef struct Lib3dsQuatTrack Lib3dsQuatTrack;
00115 typedef struct Lib3dsMorphKey Lib3dsMorphKey;
00116 typedef struct Lib3dsMorphTrack Lib3dsMorphTrack;
00117                
00118 typedef enum Lib3dsNodeTypes {
00119   LIB3DS_UNKNOWN_NODE =0,
00120   LIB3DS_AMBIENT_NODE =1,
00121   LIB3DS_OBJECT_NODE  =2,
00122   LIB3DS_CAMERA_NODE  =3,
00123   LIB3DS_TARGET_NODE  =4,
00124   LIB3DS_LIGHT_NODE   =5,
00125   LIB3DS_SPOT_NODE    =6
00126 } Lib3dsNodeTypes;
00127 
00128 typedef struct Lib3dsNode Lib3dsNode;
00129 
00130 typedef enum Lib3dsObjectFlags {
00131   LIB3DS_OBJECT_HIDDEN          =0x01, 
00132   LIB3DS_OBJECT_VIS_LOFTER      =0x02, 
00133   LIB3DS_OBJECT_DOESNT_CAST     =0x04, 
00134   LIB3DS_OBJECT_MATTE           =0x08, 
00135   LIB3DS_OBJECT_DONT_RCVSHADOW  =0x10, 
00136   LIB3DS_OBJECT_FAST            =0x20, 
00137   LIB3DS_OBJECT_FROZEN          =0x40 
00138 } Lib3dsObjectFlags;
00139 
00140 typedef union Lib3dsUserData {
00141     void *p;
00142     Lib3dsIntd i;
00143     Lib3dsDword d;
00144     Lib3dsFloat f;
00145     Lib3dsMaterial *material;
00146     Lib3dsMesh *mesh;
00147     Lib3dsCamera *camera;
00148     Lib3dsLight *light;
00149     Lib3dsNode *node;
00150 } Lib3dsUserData;
00151 
00152 #ifdef __cplusplus
00153 }
00154 #endif
00155 #endif

Hosted by
SourceForge.net Logo
Generated at Wed Jun 20 18:51:36 2007 by Doxygen 1.5.2