どうやったらBGMを再生できるか分かりません。
ご教授下さい。お願いします。
#define GLOBAL_INSTANCE
#include "../include/GV.h"
extern int DrawGraphFd( int xd, int yd, int GrHandle, int TransFlag);
int timer = 0;
int menuout = 0;
int menucount = 0;
//ループで必ず行う3大処理
int ProcessLoop(){
if(ProcessMessage()!=0)return -1;//プロセス処理がエラーなら-1を返す
if(ClearDrawScreen()!=0)return -1;//画面クリア処理がエラーなら-1を返す
GetHitKeyStateAll_2();//現在のキー入力処理を行う
GetHitPadStateAll(); //現在のパッド入力処理を行う
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){
ChangeWindowMode(TRUE);//ウィンドウモード
if(DxLib_Init() == -1 || SetDrawScreen( DX_SCREEN_BACK )!=0) return -1;//初期化と裏画面化
while(ProcessLoop()==0){//メインループ
static int sel = 0;//追加
static int x = 100 ,y = 100;//追加
music_ini();
switch(func_state){
case 0://初回のみ入る処理
load(); //データロード
loaduserstate(); //ユーザー情報のロード
first_ini();//初回の初期化
func_state=98;//ここを98に
break;
case 98://STGを始める前に行う初期化
ini();
load_story();
func_state=99;//メニューへ
break;
case 99://メニュー
DrawGraphFd(-32,-16,img_back[12],TRUE);
//泡の描画
//タイトル文字
DrawGraphFd(0,logos,img_back[13],TRUE);
DrawGraphFd(logoss,50,img_back[14],TRUE);
if (gameextraf == 1){
DrawGraphFd(10 + menuout,260,img_etc[10],TRUE);
}
if (gameextraf == 0){
DrawGraphFd(10 + menuout,260,img_etc[9],TRUE);
}
DrawGraphFd(-15 + menuout + (logoss -150) ,255 + (sel * 33),img_etc[11],TRUE);
if(CheckStateKey(KEY_INPUT_UP)==1 && logoss > 120)
{
if(sel > 0)
sel--;
else
sel = 5;
}
if(CheckStateKey(KEY_INPUT_DOWN)==1 && logoss > 120)
{
if(sel < 5)
sel++;
else
sel = 0;
}
if(CheckStateKey(KEY_INPUT_Z)==1 && logoss > 120)
{
if(sel == 0)
menucount = 1;
if(sel == 5){
DxLib_End();
return 0;
}
}
if (menucount ==1){
menuout = menuout - 9;
}
if(menuout < -280){
menuout = 0;
func_state=100;
}
break;
case 100://通常処理
enter_func_tm("");
calc_ch(); enter_func_tm("");
ch_move(); enter_func_tm("");
cshot_main(); enter_func_tm("");
enemy_main(); enter_func_tm("");
boss_shot_main();enter_func_tm("");
shot_main(); enter_func_tm("");
out_main(); enter_func_tm("");
effect_main(); enter_func_tm("");
calc_main(); enter_func_tm("");
graph_main(); enter_func_tm("");
bgm_main(); enter_func_tm("");
if(boss.flag==0)
stage_count++;
break;
default:
printfDx("不明なfunc_state\n");
break;
}
music_play(); enter_func_tm("");
fps_wait(); enter_func_tm("",1);
if(CheckStateKey(KEY_INPUT_ESCAPE)==1)break;//エスケープが入力されたらブレイク
ScreenFlip();//裏画面反映
count++;
}
DxLib_End();//DXライブラリ終了処理
return 0;
}