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 * グラフィックスバッファフォーマットヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef GRAPHICS_BUFFER_FORMAT_H_ 00026 #define GRAPHICS_BUFFER_FORMAT_H_ 00027 00028 namespace Lamp{ 00029 00030 //------------------------------------------------------------------------------ 00031 /** 00032 * グラフィックスバッファフォーマット 00033 * 00034 * このクラスは継承しないで下さい。 00035 */ 00036 class GraphicsBufferFormat{ 00037 public: 00038 /** 00039 * コンストラクタ 00040 */ 00041 GraphicsBufferFormat(){ format_ = D3DFMT_UNKNOWN; } 00042 00043 /** 00044 * コピーコンストラクタ 00045 * @param format 設定するフォーマット 00046 */ 00047 explicit GraphicsBufferFormat(const D3DFORMAT& format){ format_ = format; } 00048 00049 /** 00050 * フォーマットの設定 00051 * @param format 設定するフォーマット 00052 */ 00053 void setFormat(D3DFORMAT format){ format_ = format; } 00054 00055 /** 00056 * フォーマットの取得 00057 * @return フォーマット 00058 */ 00059 D3DFORMAT getFormat(){ return format_; } 00060 00061 /** 00062 * 代入演算子 00063 * @param format 代入元フォーマット 00064 * @return 代入結果 00065 */ 00066 const D3DFORMAT& operator=(const D3DFORMAT& format){ 00067 format_ = format; 00068 return format_; 00069 } 00070 00071 //-------------------------------------------------------------------------- 00072 /** 00073 * フォーマット名の取得 00074 * @return フォーマット名 00075 */ 00076 String getName(); 00077 00078 /** 00079 * カラーチャンネルビット数の取得 00080 * @return カラーチャンネルビット数 00081 */ 00082 u_int getColorChannelBits(); 00083 00084 /** 00085 * アルファチャンネルビット数の取得 00086 * @return アルファチャンネルビット数 00087 */ 00088 u_int getAlphaChannelBits(); 00089 00090 /** 00091 * 深度ビット数の取得 00092 * @return 深度ビット数 00093 */ 00094 u_int getDepthBits(); 00095 00096 /** 00097 * ステンシルビット数の取得 00098 * @return ステンシルビット数 00099 */ 00100 u_int getStencilBits(); 00101 00102 private: 00103 // フォーマット 00104 D3DFORMAT format_; 00105 00106 }; 00107 00108 //------------------------------------------------------------------------------ 00109 } // End of namespace Lamp 00110 #endif // End of GRAPHICS_BUFFER_FORMAT_H_ 00111 //------------------------------------------------------------------------------ 00112