Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sgldb.h

00001 /*****************************************************************************
00002  * SGL: A Scene Graph Library
00003  *
00004  * Copyright (C) 1997-2001  Scott McMillan   All Rights Reserved.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public
00017  * License along with this library; if not, write to the Free
00018  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *****************************************************************************
00020  *     File: sgldb.h
00021  *  Project: 9 September 1999
00022  *  Summary: SGL database library....miscellaneous file loaders (models/images)
00023  *****************************************************************************/
00024 
00025 #ifndef __SGLDB_H
00026 #define __SGLDB_H
00027 
00028 #if defined(WIN32) && defined(_DLL)
00029 // The next define will come from the makefile for archive objects.
00030 #ifdef sgldb_DLL_FILE
00031 #define SGLDB_DLL_API __declspec(dllexport)
00032 #else
00033 #define SGLDB_DLL_API __declspec(dllimport)
00034 #endif
00035 #else
00036 #define SGLDB_DLL_API
00037 #endif
00038 
00039 #include <sgl.h>
00040 
00041 #if defined(linux)
00042 #include <endian.h>
00043 #endif
00044 
00045 #if defined(WIN32) || (defined(sgi) && defined(unix) && defined(_MIPSEL)) || (defined(sun) && defined(unix) && !defined(_BIG_ENDIAN)) || (defined(__BYTE_ORDER) && (__BYTE_ORDER == __LITTLE_ENDIAN)) || (defined(__APPLE__) && defined( __LITTLE_ENDIAN__ ))
00046 #  define SGL_LITTLE_ENDIAN
00047 #elif (defined(sgi) && defined(unix) && defined(_MIPSEB)) || (defined(sun) && defined(unix) && defined(_BIG_ENDIAN)) || defined(vxw) || (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || (defined(__APPLE__) && defined( __BIG_ENDIAN__) )
00048 #  define SGL_BIG_ENDIAN
00049 #else
00050 #  error unknown endian type
00051 #endif
00052 
00053 static inline void sglEndianSwap(unsigned int *x)
00054 {
00055    *x = (( *x >> 24 ) & 0x000000FF ) | 
00056         (( *x >>  8 ) & 0x0000FF00 ) | 
00057         (( *x <<  8 ) & 0x00FF0000 ) | 
00058         (( *x << 24 ) & 0xFF000000 ) ;
00059 }
00060 
00061 static inline void sglEndianSwap(int *x)
00062 {
00063    *x = (( *x >> 24 ) & 0x000000FF ) | 
00064         (( *x >>  8 ) & 0x0000FF00 ) | 
00065         (( *x <<  8 ) & 0x00FF0000 ) | 
00066         (( *x << 24 ) & 0xFF000000 ) ;
00067 }
00068 
00069 static inline void sglEndianSwap(unsigned short *x)
00070 {
00071    *x = (( *x >>  8 ) & 0x00FF ) | 
00072         (( *x <<  8 ) & 0xFF00 ) ;
00073 }
00074 
00075 static inline void sglEndianSwap(short *x)
00076 {
00077    *x = (( *x >>  8 ) & 0x00FF ) | 
00078         (( *x <<  8 ) & 0xFF00 ) ;
00079 }
00080 
00081 #endif

Generated at Mon Jul 1 18:00:04 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001