► スポイラーを表示
//****************************************************************************************************
// DX10DeviceResources.h for Windows application 2016.12.24 - 2017.3.15 by V30
//****************************************************************************************************
#pragma once
#define DIRECTINPUT_VERSION 0x0800 //DirectInput Version
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#pragma comment(lib, "d2d1.lib")
#pragma comment(lib, "d3d10_1.lib")
#pragma comment(lib, "dinput8.lib")
#pragma comment(lib, "dsound.lib")
#pragma comment(lib, "dwrite.lib")
#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "imm32.lib")
#pragma comment(lib, "strmiids.lib")
#pragma comment(lib, "windowscodecs.lib")
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "xaudio2.lib")
typedef ID2D1RenderTarget ID2D1DXGISurfaceRenderTarget, ID2D1DXGIRenderTarget, ID2D1WICRenderTarget; //ID2D1RenderTargetシノニム
//D2D1図形輪郭スタイル
enum D2D1_SHAPE_FRAMESTYLE
{
D2D1_SHAPE_FRAMESTYLE_NORMAL, //基本スタイル
D2D1_SHAPE_FRAMESTYLE_HALFSTROKEIN //図形面積維持スタイル
};
//ジョイスティックキー列挙体
enum JOYSTICK : UINT
{
JOYSTICK_1, //ボタン1
JOYSTICK_2, //ボタン2
JOYSTICK_3, //ボタン3
JOYSTICK_4, //ボタン4
JOYSTICK_5, //ボタン5
JOYSTICK_6, //ボタン6
JOYSTICK_7, //ボタン7
JOYSTICK_8, //ボタン8
JOYSTICK_9, //ボタン9
JOYSTICK_10, //ボタン10
JOYSTICK_11, //ボタン11
JOYSTICK_12, //ボタン12
JOYSTICK_13, //ボタン13
JOYSTICK_14, //ボタン14
JOYSTICK_15, //ボタン15
JOYSTICK_16, //ボタン16
JOYSTICK_17, //ボタン17
JOYSTICK_18, //ボタン18
JOYSTICK_19, //ボタン19
JOYSTICK_20, //ボタン20
JOYSTICK_21, //ボタン21
JOYSTICK_22, //ボタン22
JOYSTICK_23, //ボタン23
JOYSTICK_24, //ボタン24
JOYSTICK_25, //ボタン25
JOYSTICK_26, //ボタン26
JOYSTICK_27, //ボタン27
JOYSTICK_28, //ボタン28
JOYSTICK_29, //ボタン29
JOYSTICK_30, //ボタン30
JOYSTICK_31, //ボタン31
JOYSTICK_32, //ボタン32
JOYSTICK_UP, //上方向キー
JOYSTICK_DOWN, //下方向キー
JOYSTICK_LEFT, //左方向キー
JOYSTICK_RIGHT, //右方向キー
JOYSTICK_RANGE_PITCH, //左スティックX方向傾斜度
JOYSTICK_RANGE_SLIDE, //左スティックY方向傾斜度
JOYSTICK_RANGE_SLOTL, //右スティックZ方向傾斜度
JOYSTICK_MAX //ジョイスティックキー列挙子総数
};
//キーボードキー列挙体
enum KEYBOARD
{
KEYBOARD_ESC = DIK_ESCAPE, // Escキー
KEYBOARD_1 = DIK_1, // 1キー
KEYBOARD_2 = DIK_2, // 2キー
KEYBOARD_3 = DIK_3, // 3キー
KEYBOARD_4 = DIK_4, // 4キー
KEYBOARD_5 = DIK_5, // 5キー
KEYBOARD_6 = DIK_6, // 6キー
KEYBOARD_7 = DIK_7, // 7キー
KEYBOARD_8 = DIK_8, // 8キー
KEYBOARD_9 = DIK_9, // 9キー
KEYBOARD_0 = DIK_0, // 0キー
KEYBOARD_MINUS = DIK_MINUS, // -キー
KEYBOARD_EQUALS = DIK_EQUALS, // =キー
KEYBOARD_BACK_SPACE = DIK_BACK, // Back Spaceキー
KEYBOARD_TAB = DIK_TAB, // Tabキー
KEYBOARD_Q = DIK_Q, // Qキー
KEYBOARD_W = DIK_W, // Wキー
KEYBOARD_E = DIK_E, // Eキー
KEYBOARD_R = DIK_R, // Rキー
KEYBOARD_T = DIK_T, // Tキー
KEYBOARD_Y = DIK_Y, // Yキー
KEYBOARD_U = DIK_U, // Uキー
KEYBOARD_I = DIK_I, // Iキー
KEYBOARD_O = DIK_O, // Oキー
KEYBOARD_P = DIK_P, // Pキー
KEYBOARD_BRACKET_L = DIK_LBRACKET, // [キー
KEYBOARD_BRACKET_R = DIK_RBRACKET, // ]キー
KEYBOARD_ENTER = DIK_RETURN, // Enterキー
KEYBOARD_CTRL_L = DIK_LCONTROL, // 左Ctrlキー
KEYBOARD_A = DIK_A, // Aキー
KEYBOARD_S = DIK_S, // Sキー
KEYBOARD_D = DIK_D, // Dキー
KEYBOARD_F = DIK_F, // Fキー
KEYBOARD_G = DIK_G, // Gキー
KEYBOARD_H = DIK_H, // Hキー
KEYBOARD_J = DIK_J, // Jキー
KEYBOARD_K = DIK_K, // Kキー
KEYBOARD_L = DIK_L, // Lキー
KEYBOARD_SEMICOLON = DIK_SEMICOLON, // ;キー
KEYBOARD_APOSTROPHE = DIK_APOSTROPHE, // 'キー
KEYBOARD_GRAVE = DIK_GRAVE, // `キー
KEYBOARD_SHIFT_L = DIK_LSHIFT, // 左Shiftキー
KEYBOARD_BACKSLASH = DIK_BACKSLASH, // \[Back Slash]キー
KEYBOARD_Z = DIK_Z, // Zキー
KEYBOARD_X = DIK_X, // Xキー
KEYBOARD_C = DIK_C, // Cキー
KEYBOARD_V = DIK_V, // Vキー
KEYBOARD_B = DIK_B, // Bキー
KEYBOARD_N = DIK_N, // Nキー
KEYBOARD_M = DIK_M, // Mキー
KEYBOARD_COMMA = DIK_COMMA, // ,キー
KEYBOARD_PERIOD = DIK_PERIOD, // .キー
KEYBOARD_SLASH = DIK_SLASH, // /キー
KEYBOARD_SHIFT_R = DIK_RSHIFT, // 右Shiftキー
KEYBOARD_NUMPAD_MULTIPLY = DIK_MULTIPLY, // [Num]*キー
KEYBOARD_ALT_L = DIK_LMENU, // 左Altキー
KEYBOARD_SPACE = DIK_SPACE, // Spaceキー
KEYBOARD_CAPS_LOCK = DIK_CAPITAL, // Caps Lockキー
KEYBOARD_F1 = DIK_F1, // F1キー
KEYBOARD_F2 = DIK_F2, // F2キー
KEYBOARD_F3 = DIK_F3, // F3キー
KEYBOARD_F4 = DIK_F4, // F4キー
KEYBOARD_F5 = DIK_F5, // F5キー
KEYBOARD_F6 = DIK_F6, // F6キー
KEYBOARD_F7 = DIK_F7, // F7キー
KEYBOARD_F8 = DIK_F8, // F8キー
KEYBOARD_F9 = DIK_F9, // F9キー
KEYBOARD_F10 = DIK_F10, // F10キー
KEYBOARD_NUMPAD_NUM_LOCK = DIK_NUMLOCK, // [Num]Num Lockキー
KEYBOARD_SCROLL_LOCK = DIK_SCROLL, // Scroll Lockキー
KEYBOARD_NUMPAD_7 = DIK_NUMPAD7, // [Num]7キー
KEYBOARD_NUMPAD_8 = DIK_NUMPAD8, // [Num]8キー
KEYBOARD_NUMPAD_9 = DIK_NUMPAD9, // [Num]9キー
KEYBOARD_NUMPAD_SUBTRACT = DIK_SUBTRACT, // [Num]-キー
KEYBOARD_NUMPAD_4 = DIK_NUMPAD4, // [Num]4キー
KEYBOARD_NUMPAD_5 = DIK_NUMPAD5, // [Num]5キー
KEYBOARD_NUMPAD_6 = DIK_NUMPAD6, // [Num]6キー
KEYBOARD_NUMPAD_ADD = DIK_ADD, // [Num]+キー
KEYBOARD_NUMPAD_1 = DIK_NUMPAD1, // [Num]1キー
KEYBOARD_NUMPAD_2 = DIK_NUMPAD2, // [Num]2キー
KEYBOARD_NUMPAD_3 = DIK_NUMPAD3, // [Num]3キー
KEYBOARD_NUMPAD_0 = DIK_NUMPAD0, // [Num]0キー
KEYBOARD_NUMPAD_DECIMAL = DIK_DECIMAL, // [Num].キー
KEYBOARD_F11 = DIK_F11, // F11キー
KEYBOARD_F12 = DIK_F12, // F12キー
KEYBOARD_F13 = DIK_F13, // F13キー
KEYBOARD_F14 = DIK_F14, // F14キー
KEYBOARD_F15 = DIK_F15, // F15キー
KEYBOARD_KANA = DIK_KANA, // カナキー
KEYBOARD_CONVERT = DIK_CONVERT, // 変換キー
KEYBOARD_NOCONVERT = DIK_NOCONVERT, // 無変換キー
KEYBOARD_YEN = DIK_YEN, // \キー
KEYBOARD_NUMPAD_EQUALS = DIK_NUMPADEQUALS,// [Num]=キー
KEYBOARD_CIRCUMFLEX = DIK_CIRCUMFLEX, // ^キー
KEYBOARD_AT = DIK_AT, // @キー
KEYBOARD_COLON = DIK_COLON, // :キー
KEYBOARD_UNDERLINE = DIK_UNDERLINE, // _キー
KEYBOARD_KANJI = DIK_KANJI, // 漢字キー
KEYBOARD_STOP = DIK_STOP, // Stopキー
KEYBOARD_AX = DIK_AX, // [Japan AX]AXキー
KEYBOARD_UNLABELED = DIK_UNLABELED, // [J3100]Unlabeledキー
KEYBOARD_NUMPAD_ENTER = DIK_NUMPADENTER, // [Num]Enterキー
KEYBOARD_CTRL_R = DIK_RCONTROL, // 右Ctrlキー
KEYBOARD_NUMPAD_COMMA = DIK_NUMPADCOMMA, // [Num],キー
KEYBOARD_NUMPAD_DIVIDE = DIK_DIVIDE, // [Num]/キー
KEYBOARD_SYS_RQ = DIK_SYSRQ, // Sys Rqキー
KEYBOARD_ALT_R = DIK_RMENU, // 右Altキー
KEYBOARD_PAUSE = DIK_PAUSE, // Pauseキー
KEYBOARD_HOME = DIK_HOME, // Homeキー
KEYBOARD_UP = DIK_UP, // ↑キー
KEYBOARD_PAGE_UP = DIK_PRIOR, // Page Upキー
KEYBOARD_LEFT = DIK_LEFT, // ←キー
KEYBOARD_RIGHT = DIK_RIGHT, // →キー
KEYBOARD_END = DIK_END, // Endキー
KEYBOARD_DOWN = DIK_DOWN, // ↓キー
KEYBOARD_PAGE_DOWN = DIK_NEXT, // Page Downキー
KEYBOARD_INSERT = DIK_INSERT, // Insertキー
KEYBOARD_DELETE = DIK_DELETE, // Deleteキー
KEYBOARD_LWIN = DIK_LWIN, // [Windows]左Winキー
KEYBOARD_RWIN = DIK_RWIN, // [Windows]右Winキー
KEYBOARD_MENU = DIK_APPS, // Menuキー
KEYBOARD_POWER = DIK_POWER, // Powerキー
KEYBOARD_SLEEP = DIK_SLEEP, // [Windows]Sleepキー
KEYBOARD_224 = 224, // [Unused]224キー
KEYBOARD_225 = 225, // [Unused]225キー
KEYBOARD_226 = 226, // [Unused]226キー
KEYBOARD_WAKE = DIK_WAKE, // Wakeキー
KEYBOARD_228 = 228, // [Unused]228キー
KEYBOARD_WEB_SEARCH = DIK_WEBSEARCH, // Web Searchキー
KEYBOARD_WEB_FAVORITES = DIK_WEBFAVORITES,// Web Favoritesキー
KEYBOARD_WEB_REFRESH = DIK_WEBREFRESH, // Web Refreshキー
KEYBOARD_WEB_STOP = DIK_WEBSTOP, // Web Stopキー
KEYBOARD_WEB_FORWARD = DIK_WEBFORWARD, // Web Forwardキー
KEYBOARD_WEB_BACK = DIK_WEBBACK, // Web Backキー
KEYBOARD_MY_COMPUTER = DIK_MYCOMPUTER, // My Computerキー
KEYBOARD_MAIL = DIK_MAIL, // Mailキー
KEYBOARD_MEDIA_SELECT = DIK_MEDIASELECT, // Media Selectキー
KEYBOARD_238 = 238, // [Unused]238キー
KEYBOARD_239 = 239, // [Unused]239キー
KEYBOARD_240 = 240, // [Unused]240キー
KEYBOARD_241 = 241, // [Unused]241キー
KEYBOARD_242 = 242, // [Unused]242キー
KEYBOARD_243 = 243, // [Unused]243キー
KEYBOARD_244 = 244, // [Unused]244キー
KEYBOARD_245 = 245, // [Unused]245キー
KEYBOARD_246 = 246, // [Unused]246キー
KEYBOARD_247 = 247, // [Unused]247キー
KEYBOARD_248 = 248, // [Unused]248キー
KEYBOARD_249 = 249, // [Unused]249キー
KEYBOARD_250 = 250, // [Unused]250キー
KEYBOARD_251 = 251, // [Unused]251キー
KEYBOARD_252 = 252, // [Unused]252キー
KEYBOARD_253 = 253, // [Unused]253キー
KEYBOARD_254 = 254, // [Unused]254キー
KEYBOARD_255 = 255, // [Unused]255キー
KEYBOARD_MAX // キーボードキー列挙子最大値
};
//マウスキー列挙体
enum MOUSE
{
MOUSE_LEFT, //左ボタン
MOUSE_RIGHT, //右ボタン
MOUSE_CENTER, //中ボタン
MOUSE_EX1, //追加ボタン1
MOUSE_EX2, //追加ボタン2
MOUSE_EX3, //追加ボタン3
MOUSE_EX4, //追加ボタン4
MOUSE_EX5, //追加ボタン5
MOUSE_MAX //マウスキー列挙子最大値
};
//D2D1レンダーターゲット名列挙体
enum D2D1_RENDERTARGET_TYPE
{
D2D1_RENDERTARGET_TYPE_CUSTOM, //カスタムD2D1レンダーターゲット
D2D1_RENDERTARGET_TYPE_BITMAP, //D2D1ビットマップレンダーターゲット
D2D1_RENDERTARGET_TYPE_DXGI, //D2D1DXGIサーフェスレンダーターゲット
D2D1_RENDERTARGET_TYPE_WIC, //D2D1WICビットマップレンダーターゲット
D2D1_RENDERTARGET_TYPE_WIND, //D2D1hWndレンダーターゲット
D2D1_RENDERTARGET_TYPE_CONTEXT //D2D1デバイスコンテキスト
};
#ifndef HINST_THISCOMPONENT
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
#define HINST_THISCOMPONENT ((HINSTANCE)&__ImageBase)
#endif
#define D2D1BITMAP_MAX 0x10000U //D2D1ビットマップ登録数上限
#define DI8JOYSTICK_BUTTON_MAX 10U //DI8ジョイスティックボタン数最大値
#define DI8JOYSTICK_MAX 0x10U //DI8ジョイスティック登録数上限
#define DI8JOYSTICK_ENUM_MAX 0x10U //DI8ジョイスティック列挙数上限
#define DI8JOYSTICK_RANGE_MAX 100L //DI8ジョイスティックアナログ方向キー入力範囲[最大値]
#define DI8JOYSTICK_RANGE_MIN (-DI8JOYSTICK_RANGE_MAX) //DI8ジョイスティックアナログ方向キー入力範囲[最小値]
#define DI8KEYBOARD_BUFFER KEYBOARD_MAX //DI8キーボードキー入力バッファサイズ
#define DI8KEYBOARD_KEY_MAX 238U //DI8キーボードキー総数
#define DI8MOUSE_CLICKINTERVAL 30U //DI8クリック感知最大フレーム数
#define DI8MOUSE_WCLICKINTERVAL 15U //DI8ダブルクリック感知最大フレーム数
#define DI8MOUSE_BUTTON_MAX MOUSE_MAX //既定マウスボタン数
#define DS8DEVICE_MAX 0x10U //DS8GUID登録数上限
#define DS8DEVICE_ENUM_MAX 0x10U //DS8GUID列挙数上限
#define DS8SOUND_MAX 0x1000U //DS8Sound登録数上限
#define DWRITE_LOCALENAME L"ja" //ロケール名
#define DWRITE_STRING_BUFFER 1024U //IDWriteTextFormat文字数上限
#define DWRITE_TEXTFORMAT_MAX 0x1000U //IDWriteTextFormat登録数上限
#define FPS_CHECK //FPSチェック
#define FPS_SYNC 0U //CRT同期リフレッシュレート
#define FPS_DEFAULTRATE FPS_SYNC //既定リフレッシュレート
#define FPS_MAX 9999U //リフレッシュレート上限値
#define FPS_MIN 1LL //リフレッシュレート下限値
#define FPS_DEFAULTSLEEPTIME 1UL //CPU休憩時間既定値
#define RENDERTARGET_HEIGHT 1080U //レンダーターゲット縦幅
#define RENDERTARGET_WIDTH 1920U //レンダーターゲット横幅
#define WICBITMAP_MAX 0x10000U //WIC画像オブジェクト登録数上限
#define XA2SOURCEVOICE_MAX 0x10U //XA2ソースボイス登録数上限
#define XA2SOUND_MAX 0x10U //XA2Sound登録数上限
//B8G8R8A8カラー構造体
typedef struct _B8G8R8A8Color
{
FLOAT b;
FLOAT g;
FLOAT r;
FLOAT a;
//コンストラクタ
_B8G8R8A8Color(FLOAT blue = 0.0F, FLOAT green = 0.0F, FLOAT red = 0.0F, FLOAT alpha = 1.0F);
_B8G8R8A8Color(D3DCOLORVALUE &);
} B8G8R8A8Color, BGRA8F, *LPB8G8R8A8Color, *LPBGRA8F;
//R8G8B8A8カラー構造体
typedef struct _R8G8B8A8Color : public _D3DCOLORVALUE
{
//コンストラクタ
_R8G8B8A8Color(FLOAT red = 0.0F, FLOAT green = 0.0F, FLOAT blue = 0.0F, FLOAT alpha = 1.0F);
_R8G8B8A8Color(D3DCOLORVALUE &);
_R8G8B8A8Color(B8G8R8A8Color &);
} R8G8B8A8Color, RGBA8F, *LPR8G8B8A8Color, *LPRGBA8F;
//DI8Joystick構造体
typedef struct DI8Joystick
{
Microsoft::WRL::ComPtr device; //DI8入力デバイスインターフェイス
UINT buttons; //DI8ジョイスティックボタン数
LONG press[JOYSTICK_MAX]; //DI8ジョイスティック入力継続値
//コンストラクタ
DI8Joystick();
//デストラクタ
~DI8Joystick();
//DI8ジョイスティック入力状態初期化
void ClearState();
//DI8ジョイスティック方向キー入力強度参照
FLOAT GetDegree(JOYSTICK JOYSTICK_RANGE_x);
//DI8ジョイスティック入力デバイス能力参照
DIDEVCAPS GetDeviceCaps();
//DI8ジョイスティック入力継続値参照
LONG GetPressTime(JOYSTICK JOYSTICK_x);
//DI8ジョイスティック入力状態取得
BOOL GetState();
//DI8ジョイスティック押下キー総数参照
UINT GetTotalPressKey();
//DI8ジョイスティック入力継続値設定
void SetPressTime(JOYSTICK JOYSTICK_x = JOYSTICK_MAX, LONG presstime = 0);
} *LPDI8Joystick;
//DI8Keyboard構造体
typedef struct DI8Keyboard
{
Microsoft::WRL::ComPtr device; //DI8入力デバイスインターフェイス
UINT keys; //DI8キーボードキー総数
LONG press[DI8KEYBOARD_BUFFER]; //DI8キー入力継続値
//コンストラクタ
DI8Keyboard();
//デストラクタ
~DI8Keyboard();
//DI8キーボード入力状態初期化
void ClearSate();
//DI8キーボード入力デバイス能力オブジェクト参照
DIDEVCAPS GetDeviceCaps();
//DI8キーボード入力継続値参照
LONG GetPressTime(KEYBOARD KEYBOARD_x);
//DI8キーボード入力状態取得
BOOL GetState();
//DI8キーボード押下キー総数参照
UINT GetTotalPressKey();
//DI8キーボード入力継続値設定
void SetPressTime(KEYBOARD KEYBOARD_x = KEYBOARD_MAX, LONG presstime = 0);
} *LPDI8Keyboard;
//DS8列挙デバイス構造体
typedef struct DS8EnumDevice
{
LPGUID guid; //GUID
LPCTSTR description; //description
LPCTSTR module; //module
//コンストラクタ
DS8EnumDevice();
} DSDEVICEINSTANCE, *LPDS8EnumDevice, *LPDSDEVICEINSTANCE;
//Gloval variables
extern DIDEVICEINSTANCE g_di8_joystick_enum[DI8JOYSTICK_ENUM_MAX]; //DI8ジョイスティック列挙デバイス
extern UINT g_di8_joystick_enum_total; //DI8ジョイスティック列挙デバイス総数
extern DSDEVICEINSTANCE g_ds8_device_enum[DS8DEVICE_ENUM_MAX]; //DS8列挙デバイス
extern UINT g_ds8_device_enum_total; //DS8列挙デバイス総数
//DI8ジョイスティック入力デバイス列挙
UINT EnumDI8JoystickDevice(IDirectInput8* di8device);
//DI8ジョイスティック入力デバイス列挙コールバック
BOOL CALLBACK EnumDI8JoystickDeviceCallBack(LPCDIDEVICEINSTANCE deviceinstance, LPVOID context);
//DS8デバイス列挙
UINT EnumDS8Device();
//DS8デバイス列挙コールバック
BOOL CALLBACK EnumDS8DeviceCallback(LPGUID guid, LPCTSTR desc, LPCTSTR module, LPVOID context);
//DI8ジョイスティックGUID列挙総数参照
UINT GetDI8JoystickTotalEnumDevice();
//DS8デバイスGUID列挙総数参照
UINT GetDS8TotalEnumDevice();
//DI8ジョイスティック入力デバイスオブジェクトプロパティ設定コールバック
BOOL CALLBACK SetDI8JoystickPropertyCallback(LPCDIDEVICEOBJECTINSTANCE deviceobjectinstance, LPVOID context);
//*******************************************************************************************************************************************************************************************************************
//DX10DeviceResourcesクラス
typedef class DX10DeviceResources
{
//Devices
HWND m_window; //ウインドウハンドル
//Interfaces
Microsoft::WRL::ComPtr m_d2d1_context; //D2D1デバイスコンテキストインターフェイス
Microsoft::WRL::ComPtr m_d2d1_device; //D2D1デバイスインターフェイス
Microsoft::WRL::ComPtr m_d2d1_dxgirendertarget; //D2D1DXGIサーフェスレンダーターゲットインターフェイス
Microsoft::WRL::ComPtr m_d2d1_factory; //D2D1ルートインターフェイス
ID2D1RenderTarget* m_d2d1_rendertarget; //カレントD2D1レンダーターゲットインターフェイスポインタ
Microsoft::WRL::ComPtr m_d2d1_brush_default; //既定D2D1ブラシインターフェイス
Microsoft::WRL::ComPtr m_d2d1_wicrendertarget; //D2D1WICビットマップレンダーターゲットインターフェイス
Microsoft::WRL::ComPtr m_d3d10_device1; //D3D10デバイスインターフェイス
Microsoft::WRL::ComPtr m_d3d10_dsview; //D3D10深度ステンシルビューインターフェイス
Microsoft::WRL::ComPtr m_d3d10_rtview; //D3D10レンダーターゲットビューインターフェイス
Microsoft::WRL::ComPtr m_di8_device; //DI8ルートインターフェイス
Microsoft::WRL::ComPtr m_di8_joystick[DI8JOYSTICK_MAX]; //DI8ジョイスティック入力デバイスインターフェイス
Microsoft::WRL::ComPtr m_di8_keyboard; //DI8キーボード入力インターフェイス
Microsoft::WRL::ComPtr m_di8_mouse; //DI8マウス入力インターフェイス
Microsoft::WRL::ComPtr m_ds8_device[DS8DEVICE_MAX]; //DS8デバイスインターフェイス
Microsoft::WRL::ComPtr m_dshow_buider; //DShowフィルタ グラフマネージャインターフェイス
Microsoft::WRL::ComPtr m_dshow_control; //DShow制御インターフェイス
Microsoft::WRL::ComPtr m_dshow_event; //DShowイベントインターフェイス
Microsoft::WRL::ComPtr m_dwrite_factory; //DWriteルートインターフェイス
Microsoft::WRL::ComPtr m_dwrite_textformat_default; //既定DWriteテキスト形式インターフェイス
Microsoft::WRL::ComPtr m_dxgi_output; //DXGIスワップチェーンインターフェイス
Microsoft::WRL::ComPtr m_dxgi_swapchain; //DXGIスワップチェーンインターフェイス
Microsoft::WRL::ComPtr m_wic_factory; //WICルートインターフェイス
Microsoft::WRL::ComPtr m_xa2_factory; //XA2ルートインターフェイス
std::unique_ptr m_xa2_mastervoice; //XA2マスターボイス
//Others
HRESULT m_createresults; //リソース作成結果
D2D1_ALPHA_MODE m_d2d1_alphamode; //D2D1アルファモード
D2D1_ANTIALIAS_MODE m_d2d1_antialiasmode; //D2D1アンチエイリアシングモード
D2D1_BITMAP_INTERPOLATION_MODE m_d2d1_bitmap_ipmode; //D2D1ビットマップ描画拡縮方法
D2D1_BITMAP_PROPERTIES m_d2d1_bitmap_props; //D2D1画像オブジェクトプロパティ
D2D1_CREATION_PROPERTIES m_d2d1_creation_props; //D2D1デバイス作成プロパティ
D2D1_RENDERTARGET_TYPE m_d2d1_currentrendertarget; //カレントD2D1レンダーターゲット
D2D1_MATRIX_3X2_F m_d2d1_matrix; //D2D1 2D変換
D2D1_RENDER_TARGET_PROPERTIES m_d2d1_rendertarget_props; //D2D1レンダーターゲットプロパティ
D2D1_SHAPE_FRAMESTYLE m_d2d1_shape_framestyle; //D2D1図形輪郭スタイル
D2D1_TAG m_d2d1_tag1; //D2D1情報タグ1
D2D1_TAG m_d2d1_tag2; //D2D1情報タグ2
UINT m_d3d10_creation_flags; //D3D10デバイス作成フラグ
D3D10_DEPTH_STENCIL_VIEW_DESC m_d3d10_dsvdesc; //D3D10深度ステンシルビューインターフェイスサブリソース設定
D3D10_FEATURE_LEVEL1 m_d3d10_featurelevel; //D3D10機能レベル
D3D10_FEATURE_LEVEL1 m_d3d10_featurelevels[5]; //D3D10機能レベル列挙子配列
DirectX::XMFLOAT4X4 m_d3d10_matrix; //D3D10 3D変換
D3D10_VIEWPORT m_d3d10_viewport; //D3D10ビューポート
UINT m_di8_joystick_buttons[DI8JOYSTICK_MAX]; //DI8ジョイスティックボタン数
LONG m_di8_joystick_press[DI8JOYSTICK_MAX][JOYSTICK_MAX]; //DI8ジョイスティック入力継続値
UINT m_di8_joystick_total; //DI8Joystick構造体インスタンス総数
BOOL m_di8_joystick_use; //DI8ジョイスティック入力デバイス使用フラグ
UINT m_di8_keyboard_keys; //DI8キーボードキー総数
LONG m_di8_keyboard_press[DI8KEYBOARD_BUFFER]; //DI8キー入力継続値
BOOL m_di8_keyboard_use; //DI8キーボード入力デバイス使用フラグ
UINT m_di8_mouse_buttons; //DI8マウスボタン数
BOOL m_di8_mouse_click[MOUSE_MAX]; //DI8マウスボタンクリックフラグ
UINT m_di8_mouse_click_after[MOUSE_MAX]; //DI8マウスボタンクリック後フレーム数
UINT m_di8_mouse_click_interval; //DI8マウスボタンクリック感知最大フレーム数
UINT m_di8_mouse_press[MOUSE_MAX]; //DI8マウスボタン入力継続値
UINT m_di8_mouse_press_last[MOUSE_MAX]; //DI8マウスボタン入力継続値[前回]
DIMOUSESTATE2 m_di8_mouse_state; //DI8マウス入力状態バッファ
BOOL m_di8_mouse_use; //DI8マウス入力デバイス使用フラグ
BOOL m_di8_mouse_wclick[MOUSE_MAX]; //DI8マウスボタンダブルクリックフラグ
UINT m_di8_mouse_wclick_interval; //DI8マウスボタンダブルクリック感知最大フレーム数
FLOAT m_dpi_x; //DPI[x軸]
FLOAT m_dpi_y; //DPI[y軸]
UINT m_ds8_device_total; //DS8デバイス登録数
DWRITE_MEASURING_MODE m_dwrite_textformat_measuring; //DWriteテキスト形式オブジェクトレイアウト測定方法
D2D1_DRAW_TEXT_OPTIONS m_dwrite_textformat_options; //DWriteテキスト形式オブジェクトスナップクリップ設定
DXGI_FORMAT m_dxgi_format; //DXGIフォーマット
DXGI_SWAP_CHAIN_DESC m_dxgi_swapdesc; //DXGIスワップチェーンプロパティ
BOOL m_dxgi_windowmode; //DXGIスワップチェーンウインドウモードフラグ
LONGLONG m_fps_last; //パフォーマンス測定終了時刻
LONGLONG m_fps_now; //FPS測定値
UINT m_fps_rate; //FPS設定値
DWORD m_fps_sleeptime; //CPU休憩時間
LONGLONG m_fps_start; //パフォーマンス測定開始時刻
D2D1_RECT_F m_d2d1_infinitrect; //最大描画RECT
LARGE_INTEGER m_systemtimer_freq; //システム周波数
BOOL m_systemtimer_freq_enable; //システム周波数使用可能フラグ
WICBitmapDitherType m_wic_bitmap_dithertype; //WIC画像オブジェクトディザリング方法
WICBitmapInterpolationMode m_wic_bitmap_ipmode; //WIC画像オブジェクト描画拡縮方法
WICBitmapCreateCacheOption m_wic_bitmap_option; //WIC画像オブジェクト作成オプション
WICBitmapPaletteType m_wic_bitmap_palettetype; //WIC画像オブジェクトパレットタイプ
WICDecodeOptions m_wic_decoder_options; //WICデコーダ作成オプション
UINT32 m_xa2_createflags; //XA2ルートインターフェイス作成フラグ
public:
//********** Constructor & Destructor **********
//コンストラクタ
DX10DeviceResources(const HWND &window);
//デストラクタ
~DX10DeviceResources();
//********** Device Resouce Functions **********
//デバイス依存リソース作成
HRESULT CreateDependentDeviceResources();
//デバイス非依存リソース作成
HRESULT CreateIndependentDeviceResources();
//リソース作成結果参照
HRESULT GetCreateResults();
//********** Getting Devices **********
HWND GetWindowHandle() const;
ID2D1RenderTarget* GetCurrentD2D1RenderTarget() const;
ID2D1Device* GetD2D1Device() const;
ID2D1DeviceContext* GetD2D1DeviceContext() const;
ID2D1DXGIRenderTarget* GetD2D1DXGISurfaceRenderTarget() const;
ID2D1Factory* GetD2D1Factory() const;
ID2D1WICRenderTarget* GetD2D1WICRenderTarget() const;
ID3D10DepthStencilView* GetD3D10DepthStencilView() const;
ID3D10Device1* GetD3D10Device1() const;
ID3D10RenderTargetView* GetD3D10RenderTargetView() const;
IDirectInput8* GetDI8Device() const;
IDirectInputDevice8* GetDI8Joystick(UINT joysticknumber) const;
IDirectInputDevice8* GetDI8Keyboard() const;
IDirectInputDevice8* GetDI8Mouse() const;
IDirectSound8* GetDS8Device(UINT devicenumber) const;
IGraphBuilder* GetDShowBuilder() const;
IDWriteFactory* GetDWriteFactory() const;
IDXGISwapChain* GetDXGISwapChain() const;
IWICImagingFactory* GetWICFactory() const;
IXAudio2* GetXA2Factory() const;
IXAudio2MasteringVoice* GetXA2MasterVoice() const;
//操作
//********** DXGI SwapChain Functions **********
//ウインドウモード変更
BOOL ChangeWindowMode();
//ウインドウモード設定
BOOL SetWindowMode(BOOL flag = TRUE);
//********** DWrite TextFormat Functions **********
//DWriteテキスト形式オブジェクト作成
BOOL LoadFont(Microsoft::WRL::ComPtr &format, LPCTSTR name, FLOAT size, DWRITE_FONT_WEIGHT weight = DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE style = DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH stretch = DWRITE_FONT_STRETCH_NORMAL);
//DWriteテキスト形式オブジェクトスナップクリップ設定
void SetFontDrawingOption(D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE);
//DWriteテキスト形式オブジェクトレイアウト測定方法設定
void SetFontMeasuringMode(DWRITE_MEASURING_MODE measuring = DWRITE_MEASURING_MODE_NATURAL);
//DWriteテキスト形式オブジェクトスナップクリップ設定&レイアウト測定方法設定
void SetFontOptionMode(D2D1_DRAW_TEXT_OPTIONS options = D2D1_DRAW_TEXT_OPTIONS_NONE, DWRITE_MEASURING_MODE measuring = DWRITE_MEASURING_MODE_NATURAL);
//********** WIC Bitmap Functions **********
//空WIC画像オブジェクト作成
BOOL CreateWICBmp(Microsoft::WRL::ComPtr &wicbitmap, D2D1_SIZE_U size);
//WIC画像オブジェクトフレーム数取得
UINT GetWICBmpFrames(IWICBitmapDecoder *wicdecoder);
UINT GetWICBmpFrames(Microsoft::WRL::ComPtr &wicdecoder);
UINT GetWICBmpFrames(LPCTSTR filename);
//WIC画像オブジェクトサイズ取得
D2D1_SIZE_U GetWICBmpSize(Microsoft::WRL::ComPtr &wicbitmap);
D2D1_SIZE_U GetWICBmpSize(LPCTSTR filename);
//WIC画像オブジェクト作成
BOOL LoadWICBmp(Microsoft::WRL::ComPtr &wicbitmap, LPCTSTR filename, D2D1_SIZE_U scalesize = D2D1::SizeU());
//********** D2D1 Device Functions **********
//D2D1描画開始
void BeginDraw();
//D2D1画面消去
void ClearScreen(const D2D1_COLOR_F &color);
void ClearScreen(const UINT32 &color, const FLOAT &alpha = 1.0F);
void ClearScreen(const D2D1_RECT_F &rect, const D2D1_COLOR_F &color);
void ClearScreen(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const D2D1_COLOR_F &color);
//D2D1描画終了
BOOL EndDraw();
//DPI取得
D2D_SIZE_F GetDPI();
//D2D1描画クリップ領域作成設定
void LockDrawArea(const D2D1_RECT_F &rect);
void LockDrawArea(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size);
void LockDrawArea(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height);
//D2D1変換解除
void ReleaseTransform();
//D2D1回転変換
void RotateTransform(const D2D1_POINT_2F &point, const FLOAT &angle);
void RotateTransform(const FLOAT &cx, const FLOAT &cy, const FLOAT &angle);
//描画先D2D1レンダーターゲット設定
BOOL SetCurrentD2D1RenderTarget(D2D1_RENDERTARGET_TYPE D2D1_RENDERTARGET_TYPE_x = D2D1_RENDERTARGET_TYPE_DXGI);
BOOL SetCurrentD2D1RenderTarget(Microsoft::WRL::ComPtr rendertarget);
BOOL SetCurrentD2D1RenderTarget(ID2D1RenderTarget *rendertarget);
//D2D1拡大縮小反転変換
void ScaleTransform(const D2D1_POINT_2F &point, const D2D1_SIZE_F &scalefactor);
void ScaleTransform(const FLOAT &cx, const FLOAT &cy, const D2D1_SIZE_F &scalefactor);
//D2D1描画領域設定解除
void UnlockDrawArea();
//********** D2D1 Brush Functions **********
//D2D1ビットマップブラシ作成
BOOL CreateBitmapBrush(Microsoft::WRL::ComPtr sourcebmp, Microsoft::WRL::ComPtr &brush);
//D2D1グラデーション境界コレクション作成
BOOL CreateGradientStopCollection(D2D1_GRADIENT_STOP gradientstop[], UINT count, Microsoft::WRL::ComPtr &collection);
//D2D1線状グラデーションブラシ作成
BOOL CreateLinearGradientBrush(Microsoft::WRL::ComPtr collection, Microsoft::WRL::ComPtr &brush);
BOOL CreateLinearGradientBrush(D2D1_GRADIENT_STOP gradientstop[], UINT count, Microsoft::WRL::ComPtr &brush);
//D2D1純色ブラシ作成
BOOL CreateSolidColorBrush(D2D1_COLOR_F color, Microsoft::WRL::ComPtr &brush);
//********** D2D1 Drawing String Functions **********
//DWriteテキスト形式オブジェクト文字列描画
void DrawString(const D2D1_POINT_2F &point, LPCTSTR string, Microsoft::WRL::ComPtr textformat = nullptr, Microsoft::WRL::ComPtr brush = nullptr);
void DrawString(const FLOAT &left, const FLOAT &top, LPCTSTR string, Microsoft::WRL::ComPtr textformat = nullptr, Microsoft::WRL::ComPtr brush = nullptr);
void DrawString(const D2D1_POINT_2F &point, LPCTSTR string, Microsoft::WRL::ComPtr textformat = nullptr, const D2D1_COLOR_F &color = D2D1::ColorF(0xffffff));
void DrawString(const FLOAT &left, const FLOAT &top, LPCTSTR string, Microsoft::WRL::ComPtr textformat = nullptr, const D2D1_COLOR_F &color = D2D1::ColorF(0xffffff));
//DWriteテキスト形式オブジェクト書式文字列描画
void DrawFormatString(const D2D1_POINT_2F &point, Microsoft::WRL::ComPtr textformat, Microsoft::WRL::ComPtr brush, LPCTSTR format, ...);
void DrawFormatString(const FLOAT &left, const FLOAT &top, Microsoft::WRL::ComPtr textformat, Microsoft::WRL::ComPtr brush, LPCTSTR format, ...);
void DrawFormatString(const D2D1_POINT_2F &point ,Microsoft::WRL::ComPtr textformat, const D2D1_COLOR_F &color, LPCTSTR format, ...);
void DrawFormatString(const FLOAT &left, const FLOAT &top, Microsoft::WRL::ComPtr textformat, const D2D1_COLOR_F &color, LPCTSTR format, ...);
//********** D2D1 Drawing Shape Functions **********
//四角形描画
void DrawBox(const D2D1_RECT_F &rect, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawBox(const D2D1_RECT_F &rect, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
//円形描画
void DrawCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
//楕円形描画
void DrawEllipse(const D2D1_ELLIPSE &ellipse, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawEllipse(const D2D1_ELLIPSE &ellipse, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
//塗りつぶし四角形描画
void DrawFilledBox(const D2D1_RECT_F &rect, const Microsoft::WRL::ComPtr &brush);
void DrawFilledBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &brush);
void DrawFilledBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &brush);
void DrawFilledBox(const D2D1_RECT_F &rect, const D2D1_COLOR_F &color);
void DrawFilledBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const D2D1_COLOR_F &color);
void DrawFilledBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const D2D1_COLOR_F &color);
//塗りつぶし円形描画
void DrawFilledCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const Microsoft::WRL::ComPtr &brush);
void DrawFilledCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const Microsoft::WRL::ComPtr &brush);
void DrawFilledCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const D2D1_COLOR_F &color);
void DrawFilledCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const D2D1_COLOR_F &color);
//塗りつぶし楕円形描画
void DrawFilledEllipse(const D2D1_ELLIPSE &ellipse, const Microsoft::WRL::ComPtr &fillbrush);
void DrawFilledEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &fillbrush);
void DrawFilledEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &fillbrush);
void DrawFilledEllipse(const D2D1_ELLIPSE &ellipse, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawFilledEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawFilledEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
//塗りつぶし角丸四角形描画
void DrawFilledRoundedBox(const D2D1_RECT_F &rect, const FLOAT &rad, const Microsoft::WRL::ComPtr &brush);
void DrawFilledRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const FLOAT &rad, const Microsoft::WRL::ComPtr &brush);
void DrawFilledRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const FLOAT &rad, const Microsoft::WRL::ComPtr &brush);
void DrawFilledRoundedBox(const D2D1_RECT_F &rect, const FLOAT &rad, const D2D1_COLOR_F &color);
void DrawFilledRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const FLOAT &rad, const D2D1_COLOR_F &color);
void DrawFilledRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const FLOAT &rad, const D2D1_COLOR_F &color);
//四角形描画
void DrawFramedBox(const D2D1_RECT_F &rect, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedBox(const D2D1_RECT_F &rect, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//円形描画
void DrawFramedCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedCircle(const D2D1_POINT_2F ¢erpoint, const FLOAT &rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedCircle(const FLOAT &cx, const FLOAT &cy, const FLOAT &rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//楕円形描画
void DrawFramedEllipse(const D2D1_ELLIPSE &ellipse, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedEllipse(const D2D1_ELLIPSE &ellipse, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedEllipse(const D2D1_POINT_2F &point, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedEllipse(const FLOAT &cx, const FLOAT &cy, const FLOAT &radx, const FLOAT &rady, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//角丸四角形描画
void DrawFramedRoundedBox(const D2D1_ROUNDED_RECT &roundrect, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, FLOAT rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, FLOAT rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedRoundedBox(const D2D1_ROUNDED_RECT &roundrect, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, FLOAT rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawFramedRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, FLOAT rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//直線描画
void DrawLine(const D2D1_POINT_2F &start, const D2D1_POINT_2F &end, const Microsoft::WRL::ComPtr &brush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawLine(const D2D1_POINT_2F &start, const D2D1_POINT_2F &end, const D2D1_COLOR_F &color, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//連続直線描画
void DrawLineChain(const D2D1_POINT_2F point[], UINT totalpoint, const Microsoft::WRL::ComPtr &brush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
void DrawLineChain(const D2D1_POINT_2F point[], UINT totalpoint, const D2D1_COLOR_F &color, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr);
//角丸四角形描画
void DrawRoundedBox(const D2D1_ROUNDED_RECT &roundrect, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, FLOAT rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, FLOAT rad, const Microsoft::WRL::ComPtr &framebrush, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const Microsoft::WRL::ComPtr &fillbrush = nullptr);
void DrawRoundedBox(const D2D1_ROUNDED_RECT &roundrect, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawRoundedBox(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, FLOAT rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
void DrawRoundedBox(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, FLOAT rad, const D2D1_COLOR_F &framecolor, FLOAT stroke = 1.0F, const Microsoft::WRL::ComPtr &style = nullptr, BOOL fillflag = FALSE, const D2D1_COLOR_F &fillcolor = D2D1::ColorF(0));
//********** D2D1 WIC Bitmap Functions **********
//WICビットマップレンダーターゲット作成
BOOL CreateWICBmpRenderTarget(Microsoft::WRL::ComPtr wicbmp, Microsoft::WRL::ComPtr &wicbmpRT);
BOOL CreateWICBmpRenderTarget(int wicbmphandle);
//********** D2D1 Bitmap Functions **********
//空D2D1ビットマップ作成
BOOL CreateBmp(Microsoft::WRL::ComPtr &d2d1bitmap, D2D1_SIZE_U size);
//D2D1ビットマップ複製
BOOL CreateBmpCopy(Microsoft::WRL::ComPtr &d2d1bitmap, Microsoft::WRL::ComPtr sourcebmp, D2D1_POINT_2U point = D2D1::Point2U(), D2D1_SIZE_U size = D2D1::SizeU());
//D2D1ビットマップ合成
BOOL CreateBmpMerge(Microsoft::WRL::ComPtr &d2d1bitmap, Microsoft::WRL::ComPtr destinybmp, Microsoft::WRL::ComPtr sourcebmp, int x = 0, int y = 0, BOOL scale = FALSE);
//D2D1ビットマップ描画
void DrawBmp(const D2D1_POINT_2F &point, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmp(const FLOAT &left, const FLOAT &top, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ描画
void DrawBmpC(const D2D1_POINT_2F ¢erpoint, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpC(const FLOAT &cx, const FLOAT &cy, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ部分描画
void DrawBmpRect(const D2D1_POINT_2F &point, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_RECT_F &srcrect, const FLOAT &alpha = 1.0F);
void DrawBmpRect(const D2D1_POINT_2F &point, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_POINT_2F &srcpoint, const D2D1_SIZE_F &srcsize, const FLOAT &alpha = 1.0F);
void DrawBmpRect(const FLOAT &left, const FLOAT &top, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &srcleft, const FLOAT &srctop, const FLOAT &srcwidth, const FLOAT &srcheight, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ部分描画
void DrawBmpRectC(const D2D1_POINT_2F ¢erpoint, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_RECT_F &srcrect, const FLOAT &alpha = 1.0F);
void DrawBmpRectC(const D2D1_POINT_2F ¢erpoint, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_POINT_2F &srcpoint, const D2D1_SIZE_F &srcsize, const FLOAT &alpha = 1.0F);
void DrawBmpRectC(const FLOAT &cx, const FLOAT &cy, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &srcleft, const FLOAT &srctop, const FLOAT &srcwidth, const FLOAT &srcheight, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ拡縮描画
void DrawBmpResize(const D2D1_RECT_F &rect, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpResize(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpResize(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ拡縮描画
void DrawBmpResizeC(const D2D1_POINT_2F ¢erpoint, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpResizeC(const FLOAT &cx, const FLOAT &cy, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ部分拡縮描画
void DrawBmpResizeRect(const D2D1_RECT_F &dstrect, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_RECT_F &srcrect, const FLOAT &alpha = 1.0F);
void DrawBmpResizeRect(const D2D1_POINT_2F &point, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_POINT_2F &srcpoint, const D2D1_SIZE_F &srcsize, const FLOAT &alpha = 1.0F);
void DrawBmpResizeRect(const FLOAT &left, const FLOAT &top, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &srcleft, const FLOAT &srctop, const FLOAT &srcwidth, const FLOAT &srcheight, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ部分拡縮描画
void DrawBmpResizeRectC(const D2D1_POINT_2F ¢erpoint, const D2D1_SIZE_F &size, const Microsoft::WRL::ComPtr &d2d1bitmap, const D2D1_POINT_2F &srcpoint, const D2D1_SIZE_F &srcsize, const FLOAT &alpha = 1.0F);
void DrawBmpResizeRectC(const FLOAT &cx, const FLOAT &cy, const FLOAT &width, const FLOAT &height, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &srcleft, const FLOAT &srctop, const FLOAT &srcwidth, const FLOAT &srcheight, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ回転描画
void DrawBmpRotate(const D2D1_POINT_2F &point, const FLOAT &angle, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpRotate(const FLOAT &left, const FLOAT &top, const FLOAT &angle, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ回転描画
void DrawBmpRotateC(const D2D1_POINT_2F ¢erpoint, const FLOAT &angle, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpRotateC(const FLOAT &cx, const FLOAT &cy, const FLOAT &angle, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ拡大縮小反転描画
void DrawBmpScaleC(const D2D1_POINT_2F ¢erpoint, const D2D1_SIZE_F &scalefactor, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
void DrawBmpScaleC(const FLOAT &cx, const FLOAT &cy, const D2D1_SIZE_F &scalefactor, const Microsoft::WRL::ComPtr &d2d1bitmap, const FLOAT &alpha = 1.0F);
//D2D1ビットマップ作成
BOOL LoadBmp(Microsoft::WRL::ComPtr &d2d1bitmap, Microsoft::WRL::ComPtr wicbitmap, D2D1_SIZE_U scalesize = D2D1::SizeU());
BOOL LoadBmp(Microsoft::WRL::ComPtr &d2d1bitmap, LPCTSTR filename, D2D1_SIZE_U scalesize = D2D1::SizeU());
BOOL LoadBmp(Microsoft::WRL::ComPtr &d2d1bitmap, UINT resourceName, LPCTSTR resourceType, D2D1_SIZE_U scalesize = D2D1::SizeU());
BOOL LoadBmpFromResIcon(Microsoft::WRL::ComPtr &d2d1bitmap, UINT resourceName, D2D1_SIZE_U scalesize = D2D1::SizeU());
BOOL LoadBmpFromResImage(Microsoft::WRL::ComPtr &d2d1bitmap, UINT resourceName, D2D1_SIZE_U scalesize = D2D1::SizeU());
//D2D1ビットマップ分割作成
BOOL LoadDivBmp(Microsoft::WRL::ComPtr bitmaparray[], LPCTSTR filename, UINT AllNum, UINT XNum, UINT YNum, D2D1_SIZE_U partsize = D2D1::SizeU());
//D2D1ビットマップ合成
BOOL MergeBmp(Microsoft::WRL::ComPtr &destinybitmap, Microsoft::WRL::ComPtr sourcebitmap, int x = 0, int y = 0, BOOL scale = FALSE);
//D2D1画像オブジェクトサイズ変更
BOOL ResizeBmp(Microsoft::WRL::ComPtr &d2d1bitmap, D2D1_SIZE_U scalesize = D2D1::SizeU(), FLOAT alpha = 1.0F);
//D2D1ビットマップ描画拡縮方法変更
void SetBmpInterporlationMode(D2D1_BITMAP_INTERPOLATION_MODE ipmode = D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
//********** D3D10 Device Functions **********
//D3D10画面消去
void ClearScreen(R8G8B8A8Color color = R8G8B8A8Color(0.0F, 0.0F, 0.0F, 1.0F));
void ClearScreen(FLOAT red, FLOAT green, FLOAT blue, FLOAT alpha = 1.0F);
void ClearScreen(D3DCOLORVALUE color);
//画面出力
void FlipScreen();
//********** DI8 Function **********
//DI8デバイス入力状態取得
BOOL GetDI8DevicesState();
//********** DI8 Joystick Device Functions **********
//DI8ジョイスティック入力デバイス初期化
void AllDeleteDI8Joystick();
//DI8ジョイスティック入力状態初期化
void ClearDI8JoystickState(UINT number);
//DI8ジョイスティック入力状態取得
BOOL GetAllDI8JoystickState();
//DI8ジョイスティック方向キー入力強度参照
FLOAT GetDI8JoystickDegree(UINT number, JOYSTICK JOYSTICK_RANGE_x);
//DI8ジョイスティック入力デバイス能力参照
DIDEVCAPS GetDI8JoystickDeviceCaps(UINT number);
//DI8ジョイスティック入力継続値参照
LONG GetDI8JoystickPressTime(UINT number, JOYSTICK JOYSTICK_x);
//DI8ジョイスティック入力状態取得
BOOL GetDI8JoystickState(UINT number);
//DI8ジョイスティック押下キー総数参照
UINT GetDI8JoystickTotalPressKey(UINT number);
//DI8ジョイスティック入力継続値設定
void SetDI8JoystickPressTime(UINT number, JOYSTICK JOYSTICK_x = JOYSTICK_MAX, LONG presstime = 0);
//DI8ジョイスティック総数参照
UINT GetDI8JoystickTotalDevice();
//DI8ジョイスティック入力使用フラグ設定
void UsingDI8Joystick(BOOL flag = TRUE);
//********** DI8 Keyboard Device Functions **********
//DI8キーボード入力状態初期化
void ClearDI8KeyboardSate();
//DI8キーボード入力デバイス能力オブジェクト参照
DIDEVCAPS GetDI8KeyboardDeviceCaps();
//DI8キーボード入力継続値参照
LONG GetDI8KeyboardPressTime(KEYBOARD KEYBOARD_x);
//DI8キーボード入力状態取得
BOOL GetDI8KeyboardState();
//DI8キーボード押下キー総数参照
UINT GetDI8KeyboardTotalPressKey();
//DI8キーボード入力継続値設定
void SetDI8KeyboardPressTime(KEYBOARD KEYBOARD_x = KEYBOARD_MAX, LONG presstime = 0);
//DI8キーボード入力使用フラグ設定
void UsingDI8Keyboard(BOOL flag = TRUE);
//********** DI8 Mouse Device Functions **********
//DI8マウス入力状態初期化
void ClearDI8MouseState();
//DI8マウス軸入力状態参照
LONG GetDI8MouseAxisState(UINT axisnumber);
//DI8マウスボタン数参照
UINT GetDI8MouseButtons();
//DI8マウスボタン入力状態参照
BYTE GetDI8MouseButtonState(UINT buttonnumber);
//DI8マウスクリック入力参照
BOOL GetDI8MouseClick(MOUSE MOUSE_x);
//DI8マウスボタンクリック感知最大フレーム数参照
UINT GetDI8MouseClickInterval();
//DI8マウスカーソル位置参照
POINT GetDI8MouseCursorRealPoint();
//DI8マウスカーソル位置参照
POINT GetDI8MouseCursorTruePoint();
//DI8マウス入力デバイス能力オブジェクト参照
DIDEVCAPS GetDI8MouseDeviceCaps();
//DI8マウスダブルクリック入力参照
BOOL GetDI8MouseDoubleClick(MOUSE MOUSE_x);
//DI8マウスボタンダブルクリック感知最大フレーム数参照
UINT GetDI8MouseDoubleClickInterval();
//DI8マウスポインタクライアント領域内存在確認
BOOL GetDI8MousePointInClient();
//DI8マウスポインタ指定領域内存在確認
BOOL GetDI8MousePointInRect(D2D1_RECT_F &rect);
//DI8マウス入力継続値参照
UINT GetDI8MousePressTime(MOUSE MOUSE_x);
//DI8マウス入力状態取得
BOOL GetDI8MouseState();
//DI8マウス押下キー総数参照
UINT GetDI8MouseTotalPressKey();
//DI8マウスボタンクリック感知最大フレーム数設定
void SetDI8MouseClickInterval(UINT maxframe);
//DI8マウスボタンダブルクリック感知最大フレーム数設定
void SetDI8MouseDoubleClickInterval(UINT maxframe);
//DI8マウス入力継続値設定
void SetDI8MousePressTime(MOUSE MOUSE_x = MOUSE_MAX, UINT presstime = 0);
//DI8マウス入力使用フラグ設定
void UsingDI8Mouse(BOOL flag = TRUE);
//********** DS8 Device Functions **********
//DS8デバイス初期化
void AllDeleteDS8Device();
//DS8デバイス能力オブジェクト参照
DSCAPS GetDS8DeviceCaps(int devicenumber);
//DS8デバイス総数参照
UINT GetDS8DeviceTotal();
//********** DS8 Secondery Buffer Functions **********
//DS8セカンダリバッファ作成
BOOL LoadDS8Buffer(const Microsoft::WRL::ComPtr device, Microsoft::WRL::ComPtr &buffer, LPTSTR filename, BOOL glovalfocus = FALSE);
//********** XA2 MasteringVoice Function **********
//XA2マスターボイス削除
void DeleteXA2MasterVoice();
//********** System Timer **********
//高精度システム時刻使用可能チェック
BOOL CheckHiPerformanceCounter();
//システム周波数取得
LONGLONG GetFrequency();
BOOL GetFrequency(LONGLONG *frequency);
//システム周波数使用可能フラグ取得
BOOL GetFrequencyEnable();
BOOL GetFrequencyEnable(LPBOOL flag);
//高精度システム時刻取得
LONGLONG GetHiPerformanceCount();
BOOL GetHiPerformanceCount(LONGLONG *count);
//システム時刻取得
DWORD GetNowCount();
BOOL GetNowCount(DWORD *count);
//********** FPS Controler **********
//FPS調整
void FPSAdjustment();
//現在FPS取得
UINT GetNowRefreshRate();
//リフレッシュレート取得
UINT GetRefreshRate();
//CPU休憩時間取得
DWORD GetCPUSleepTime();
//FPSシーク
BOOL SeekRefreshRate(int offset);
//リフレッシュレート設定
BOOL SetRefreshRate(UINT fps = FPS_DEFAULTRATE);
//CPU休憩時間設定
void SetCPUSleepTime(DWORD milliseconds = FPS_DEFAULTSLEEPTIME);
} *LPDX10DeviceResources;