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

GraphicsDeviceSelector.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  * グラフィックスデバイスセレクタヘッダ
00022  * @author Junpee
00023  */
00024 
00025 #ifndef GRAPHICS_DEVICE_SELECTOR_H_
00026 #define GRAPHICS_DEVICE_SELECTOR_H_
00027 
00028 namespace Lamp{
00029 
00030 class GraphicsAdapterInformation;
00031 class GraphicsDeviceInformation;
00032 class GraphicsDeviceComboInformation;
00033 
00034 //------------------------------------------------------------------------------
00035 // 設定ファイルを読み込もうとするプロキシデバイスセレクタとかあるといいかも
00036 // フルスクリーン設定もファイルに書き込んどく
00037 // それかSettingsにReader、Writer対応させて、セレクタ通さずに設定もありかも
00038 // 読み込み失敗したときに選択しなおす必要がある
00039 // 失敗の判定はやっぱりセレクタ任せなのでプロキシかな
00040 /**
00041  * グラフィックスデバイスセレクタ
00042  */
00043 class GraphicsDeviceSelector{
00044 public:
00045     /**
00046      * コンストラクタ
00047      */
00048     GraphicsDeviceSelector(){}
00049 
00050     /**
00051      * デストラクタ
00052      */
00053     virtual ~GraphicsDeviceSelector(){}
00054 
00055     /**
00056      * デバイス設定の選択
00057      * @param windowHandle ウィンドウハンドル
00058      * @param startFullscreen フルスクリーンを優先して初期化するならtrue
00059      * @return 使用できるデバイスが存在すればtrue
00060      */
00061     virtual bool chooseDeviceSettings(
00062         HWND windowHandle, bool startFullscreen);
00063 
00064     /**
00065      * ウィンドウモードの最適な設定を探す
00066      * @param windowHandle ウィンドウハンドル
00067      * @param requireHAL ハードウェアアクセラレーションを要求する場合はtrue
00068      * @param requireREF リファレンスラスタライザを要求する場合はtrue
00069      * @return 使用できるデバイスが存在すればtrue
00070      */
00071     virtual bool findBestWindowedMode(
00072         HWND windowHandle, bool requireHAL, bool requireREF) = 0;
00073 
00074     /**
00075      * フルスクリーンモードの最適な設定を探す
00076      * @param windowHandle ウィンドウハンドル
00077      * @param requireHAL ハードウェアアクセラレーションを要求する場合はtrue
00078      * @param requireREF リファレンスラスタライザを要求する場合はtrue
00079      * @return 使用できるデバイスが存在すればtrue
00080      */
00081     virtual bool findBestFullscreenMode(
00082         HWND windowHandle, bool requireHAL, bool requireREF) = 0;
00083 
00084 protected:
00085     /**
00086      * ウインドウモード設定の構築
00087      * @param windowHandle ウィンドウハンドル
00088      * @param displayMode ディスプレイモード
00089      * @param bestAdapter 最適なアダプタ
00090      * @param bestDevice 最適なデバイス
00091      * @param bestDeviceCombo 最適なデバイスコンボ
00092      */
00093     virtual void buildWindowModeSettings(
00094         HWND windowHandle, const D3DDISPLAYMODE& displayMode,
00095         GraphicsAdapterInformation* bestAdapter,
00096         GraphicsDeviceInformation* bestDevice,
00097         GraphicsDeviceComboInformation* bestDeviceCombo);
00098 
00099     /**
00100      * フルスクリーンモード設定の構築
00101      * @param displayMode ディスプレイモード
00102      * @param bestAdapter 最適なアダプタ
00103      * @param bestDevice 最適なデバイス
00104      * @param bestDeviceCombo 最適なデバイスコンボ
00105      */
00106     virtual void buildFullscreenModeSettings(
00107         const D3DDISPLAYMODE& displayMode,
00108         GraphicsAdapterInformation* bestAdapter,
00109         GraphicsDeviceInformation* bestDevice,
00110         GraphicsDeviceComboInformation* bestDeviceCombo);
00111 
00112 private:
00113     // コピーコンストラクタの隠蔽
00114     GraphicsDeviceSelector(const GraphicsDeviceSelector& copy);
00115 
00116     // 代入コピーの隠蔽
00117     void operator =(const GraphicsDeviceSelector& copy);
00118 
00119 };
00120 
00121 //------------------------------------------------------------------------------
00122 } // End of namespace Lamp
00123 #endif // End of GRAPHICS_DEVICE_SELECTOR_H_
00124 //------------------------------------------------------------------------------
00125 

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