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

LWTexture.h

Go to the documentation of this file.
00001 
00002 /*
00003     TEDDY - General graphics application library
00004     Copyright (C) 1999-2002  Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2.1 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     $Id: LWTexture.h,v 1.4 2002/01/11 14:34:59 tksuoran Exp $
00022 */
00023 
00024 
00025 #ifndef TEDDY__IMPORTS__LW_TEXTURE__H
00026 #define TEDDY__IMPORTS__LW_TEXTURE__H
00027 
00028 
00029 #include "Teddy/TeddyConfig.h"
00030 #if defined( TEDDY_INCLUDE_LW_SCENE )
00031 
00032 
00033 #include "Teddy/Imports/lwdef.h"
00034 #include "Teddy/Graphics/Texture.h"
00035 using namespace Teddy::Graphics;
00036 
00037 
00038 namespace Teddy   {
00039 namespace Imports {
00040 
00041 
00042 class LWFile;
00043 class LWSurface;
00044 
00045 
00046 #define LW_TF_AXIS_X            (1<<0)
00047 #define LW_TF_AXIS_Y            (1<<1)
00048 #define LW_TF_AXIS_Z            (1<<2)
00049 #define LW_TF_WORLD_COORDINATES (1<<3)
00050 #define LW_TF_NEGATIVE_IMAGE    (1<<4)
00051 #define LW_TF_PIXEL_BLENDING    (1<<5)
00052 #define LW_TF_ANTIALISING       (1<<6)
00053 
00054 #define LW_IMAGE_WRAP_BLACK         0
00055 #define LW_IMAGE_WRAP_CLAMP         1
00056 #define LW_IMAGE_WRAP_REPEAT        2  //  default
00057 #define LW_IMAGE_WPAP_MIRROR_REPEAT 3
00058 #define LW_IMAGE_WRAP_DEFAULT       LW_IMAGE_WRAP_REPEAT
00059 
00060 
00065 class LWTexture {
00066 public:
00067     LWTexture( LWSurface *surface, int map_type );
00068 
00069     void processTexture();  //  Read in
00070     void applyTexture  ();  //  Apply to surface
00071 
00072 public:
00073     void readTextureFlags_U2          ();  //  TFLG
00074     void readTextureSize_VEC12        ();  //  TSIZ
00075     void readTextureCenter_VEC12      ();  //  TCTR
00076     void readTextureFallOff_VEC12     ();  //  TFAL
00077     void readTextureVelocity_VEC12    ();  //  TVEL
00078 
00079     void readTextureReferenceObject_S0();  //  TREF
00080     void readTextureColor_COL4        ();  //  TCLR
00081     void readTextureValue_IP2         ();  //  TVAL
00082     void readBumpTextureAmplitude_FP4 ();  //  TAMP
00083     void readTextureAlgorithm_F4      ();  //  TFPn
00084     void readTextureAlgorithm_I2      ();  //  TIPb
00085 
00086     void readImageMap_FNAM0           ();  //  TIMG
00087     void readImageAlpha_FNAM0         ();  //  TALP
00088     void readImageWarpOptions_U2_U2   ();  //  TWRP
00089     void readAntialiasingStrength_FP4 ();  //  TAAS
00090     void readTextureOpacity_FP4       ();  //  TOPC
00091 
00092 protected:
00093     LWFile    *f;                        
00094     LWSurface *surface;                  
00095     VEC12      texture_center;           
00096     VEC12      texture_size;             
00097     U2         texture_projection_mode;  
00098     U2         texture_major_axis;       
00099     FNAM0      texture_image_map;        
00100 };
00101 
00102 
00103 };  //  namespace Imports
00104 };  //  namespace Teddy
00105 
00106 
00107 #endif  //  TEDDY_INCLUDE_LW_SCENE
00108 #endif  //  TEDDY__IMPORTS__LW_TEXTURE__H
00109