00001 // Filename: dxTextureContext7.h 00002 // Created by: drose (07Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef DXTEXTURECONTEXT7_H 00020 #define DXTEXTURECONTEXT7_H 00021 00022 #include "dxgsg7base.h" 00023 00024 #include <texture.h> 00025 #include <textureContext.h> 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : DXTextureContext7 00029 // Description : 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDADX DXTextureContext7 : public TextureContext { 00032 friend class DXGraphicsStateGuardian7; 00033 friend class wdxGraphicsWindow7; 00034 00035 public: 00036 DXTextureContext7(Texture *tex); 00037 ~DXTextureContext7(); 00038 00039 LPDIRECTDRAWSURFACE7 _surface; 00040 Texture *_tex; // ptr to parent, primarily for access to namestr 00041 00042 // static is_unused_texpixelformat(DDPIXELFORMAT *) 00043 00044 #ifdef USE_TEXFMTVEC 00045 LPDIRECTDRAWSURFACE7 CreateTexture(LPDIRECT3DDEVICE7 pd3dDevice, DDPixelFormatVec &TexFmts,LPD3DDEVICEDESC7 pD3DDevDesc); 00046 #else 00047 LPDIRECTDRAWSURFACE7 CreateTexture(LPDIRECT3DDEVICE7 pd3dDevice, int cNumTexPixFmts, DDPIXELFORMAT *pTexFmts,LPD3DDEVICEDESC7 pD3DDevDesc); 00048 #endif 00049 00050 bool _bHasMipMaps; 00051 DWORD _PixBufConversionType; // enum ConversionType 00052 00053 // must be public since called from global callback fns 00054 void DeleteTexture(void); 00055 HRESULT FillDDSurfTexturePixels(void); 00056 00057 protected: 00058 unsigned int get_bits_per_pixel(PixelBuffer::Format format, int *alphbits); 00059 00060 public: 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 static void init_type() { 00065 TextureContext::init_type(); 00066 register_type(_type_handle, "DXTextureContext7", 00067 TextureContext::get_class_type()); 00068 } 00069 virtual TypeHandle get_type() const { 00070 return get_class_type(); 00071 } 00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 00079 #endif 00080