#include "dxlib_bishamon_dx11.h" #include "DxLib.h" #define SCREEN_WIDTH 768 #define SCREEN_HEIGHT 432 #define NEAR_CLIP 0.1f #define FAR_CLIP 1000.0f #define CAMERA_FOV 40.0f namespace bmfw = ml::bmfw; // エフェクトインスタンス bmfw::Animation* effect; // WinMain関数 int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { // ウインドウモードで起動 ChangeWindowMode( TRUE ) ; // 画面のサイズを設定 SetGraphMode( SCREEN_WIDTH, SCREEN_HEIGHT, 32 ) ; // 深度バッファのビット深度を32にする SetZBufferBitDepth( 32 ) ; // DXライブラリの初期化 if( DxLib_Init() < 0 ) return -1 ; // 描画先を裏画面に設定 SetDrawScreen( DX_SCREEN_BACK ) ; // カメラのパラメータを設定 SetCameraNearFar( NEAR_CLIP, FAR_CLIP ) ; SetupCamera_Perspective( CAMERA_FOV * DX_PI_F / 180.0f ) ; SetCameraPositionAndTarget_UpVecY( VGet( 0.0f, 78.4040298f, -187.938522f ), VGet( 0.0f, 10.0f, 0.0f ) ) ; // BISHAMON の初期化 if( DxLib_Bishamon_DX11_Init() == false ) { return -1 ; } // BISHAMONのエフェクトの生成 bmfw::CreateParam createParam; // 生成するエフェクトデータ名(.bmbファイル) createParam.name = "aura"; effect = bmfw::CreateAnimation( createParam ); if( effect == NULL ) { return 1; } // メインループ while( ProcessMessage() == 0 ) { // 画面を初期化 ClearDrawScreen() ; // BISHAMONのアニメーションのパラメーターの設定. effect->coord.position = bmfw::Vec3(0.0f, 0.0f, 0.0f); effect->coord.rotation = bmfw::Vec3(0.0f, 0.0f, 0.0f); effect->coord.scale = bmfw::Vec3(1.0f, 1.0f, 1.0f); effect->deltaScale = 1.0f; // BISHAMONのエフェクトの更新. effect->Update(); // BISHAMONのエフェクト再生終了ならリセット if( effect->IsExpired() ) { effect->Reset(); } // 地面代わりの箱を描画 SetUseZBufferFlag( TRUE ) ; SetWriteZBufferFlag( TRUE ) ; DrawCube3D( VGet( -200.0f, -20.0f, -200.0f ), VGet( 200.0f, 0.0f, 200.0f ), GetColor( 128,128,128 ), 0, TRUE ) ; SetWriteZBufferFlag( FALSE ) ; SetUseZBufferFlag( FALSE ) ; // DXライブラリの描画処理を終わらせる RenderVertex() ; // BISHAMONの描画の準備を行う DxLib_Bishamon_DX11_DrawSetup() ; // BISHAMONのエフェクトの描画. bmfw::DrawBegin(); effect->Draw(); bmfw::DrawEnd(); // DXライブラリの Direct3D 11 の設定を復帰する RefreshDxLibDirect3DSetting() ; // 裏画面の内容を表画面に反映 ScreenFlip() ; } // BISHAMONのエフェクトの破棄 bmfw::DestroyAnimation( effect ); // BISHAMONフレームワークの後処理 bmfw::Clean(); // DXライブラリの後始末 DxLib_End() ; // ソフトの終了 return 0 ; }