Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

PictureRGB8.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * RGB8ビットピクチャヘッダ
00022  * @author Junpee
00023  */
00024 
00025 #ifndef PICTURE_RGB8_H_
00026 #define PICTURE_RGB8_H_
00027 
00028 #include <Graphics/Picture/Picture.h>
00029 
00030 namespace Lamp{
00031 
00032 //------------------------------------------------------------------------------
00033 /**
00034  * RGB8ビットピクチャ
00035  */
00036 class PictureRGB8 : public Picture{
00037 friend class PictureManager;
00038 public:
00039     /**
00040      * RGB8ビットピクチャかどうか
00041      * @return RGB8ビットピクチャならtrue
00042      */
00043     virtual bool isPictureRGB8() const{ return true; }
00044 
00045     //--------------------------------------------------------------------------
00046     /**
00047      * コピー
00048      * @return コピーされたピクチャ
00049      */
00050     virtual Picture* copy() const{ return copyPictureRGB8(); }
00051 
00052     /**
00053      * RGB8ビットピクチャのコピー
00054      * @return コピーされたピクチャ
00055      */
00056     virtual PictureRGB8* copyPictureRGB8() const;
00057 
00058     //--------------------------------------------------------------------------
00059     /**
00060      * デバイスオブジェクトの初期化
00061      * @return 成功したらtrueを返す
00062      */
00063     virtual bool initializeGraphicsDeviceObjects(){ return compile(); }
00064 
00065     /**
00066      * デバイスオブジェクトの削除
00067      */
00068     virtual void deleteGraphicsDeviceObjects(){ SafeRelease(d3dTexture_); }
00069 
00070     //--------------------------------------------------------------------------
00071     /**
00072      * サイズの設定
00073      * @param size サイズ
00074      */
00075     virtual void setSize(const DimensionI& size);
00076 
00077     /**
00078      * イメージバッファの取得
00079      * @return イメージバッファ
00080      */
00081     virtual Color3c* getImageBuffer(){ return image_; }
00082 
00083     //--------------------------------------------------------------------------
00084     /**
00085      * イメージの設定
00086      * @param image 設定するイメージ
00087      */
00088     virtual void setImage(const Color3c* image);
00089 
00090     /**
00091      * イメージの取得
00092      * @return イメージ
00093      */
00094     virtual const Color3c* getImage() const{ return image_; }
00095 
00096     //--------------------------------------------------------------------------
00097 protected:
00098     /**
00099      * コンストラクタ
00100      * @param name 名前
00101      * @param scene シーン
00102      */
00103     PictureRGB8(const String& name, Scene* scene);
00104 
00105     /**
00106      * デストラクタ
00107      */
00108     virtual ~PictureRGB8();
00109 
00110     /**
00111      * D3Dテクスチャの取得
00112      * @return D3Dテクスチャの取得
00113      */
00114     virtual Direct3DTexture* getD3DTexture();
00115 
00116     /**
00117      * コンパイル
00118      * @return 成功すればtrueを返す
00119      */
00120     virtual bool compile();
00121 
00122     /**
00123      * イメージのコンパイル
00124      */
00125     virtual bool compileImage(
00126         const Color3c* image, const DimensionI& size, int mipmapLevel);
00127 
00128     /**
00129      * ミップマップのコンパイル
00130      */
00131     virtual bool compileMipmap(
00132         const Color3c* image, const DimensionI& size, int mipmapLevel);
00133 
00134 private:
00135     // Direct3Dテクスチャ
00136     Direct3DTexture* d3dTexture_;
00137     // イメージ
00138     Color3c* image_;
00139 
00140 };
00141 
00142 //------------------------------------------------------------------------------
00143 } // End of namespace Lamp
00144 #endif // End of PICTURE_RGB8_H_
00145 //------------------------------------------------------------------------------
00146 

Generated on Wed Mar 16 10:29:33 2005 for Lamp by doxygen 1.3.2