本文整理汇总了C++中Audio::AudioPlay方法的典型用法代码示例。如果您正苦于以下问题:C++ Audio::AudioPlay方法的具体用法?C++ Audio::AudioPlay怎么用?C++ Audio::AudioPlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Audio
的用法示例。
在下文中一共展示了Audio::AudioPlay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
//
// WinMain
//
int WINAPI WinMain(HINSTANCE hinstance,
HINSTANCE prevInstance,
PSTR cmdLine,
int showCmd)
{
if(!d3d::InitD3D(hinstance,
Width, Height, true, D3DDEVTYPE_HAL, &Device))
{
::MessageBox(0, "InitD3D() - FAILED", 0, 0);
return 0;
}
HRESULT hr;
if( FAILED( hr = sound.PrepareXACT() ) )
{
if( hr == HRESULT_FROM_WIN32( ERROR_FILE_NOT_FOUND ) )
MessageBox( 0, "Failed to init XACT because media not found.", "XACT Tutorial", MB_OK );
else
MessageBox( 0, "Failed to init XACT./n(sometimes Xact like to act up the first time ran on new computers try going to the Sound.xap file in the project folder and pressing F7 then enter)", "XACT Tutorial", MB_OK );
sound.CleanupXACT();
return 0;
}
if(!Setup())
{
::MessageBox(0, "Setup() - FAILED", 0, 0);
return 0;
}
sound.AudioPlay(Song);
::MessageBoxA(0, "You wake up in a field, and as you look around all you see is a scary mansion off in the distance\nYou decide to make your way towards the mansion in hopes of finding help", "Welcome", MB_OK);
::MessageBoxA(0, "Use WSAD to move the camera around\nUse the Arrow Keys to look around", "Welcome", MB_OK);
d3d::EnterMsgLoop( Display );
Cleanup();
Device->Release();
return 0;
}
示例2: Display
//.........这里部分代码省略.........
//6
D3DXMatrixTranslation(&tripler, RavengerSirenPos.x, RavengerSirenPos.y, RavengerSirenPos.z);
D3DXMatrixScaling(&grow, .1/sizeModifier, .1/sizeModifier, .1/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
RavengerSiren.Draw(Stone);
//7
D3DXMatrixTranslation(&tripler, SectoidPos.x, SectoidPos.y, SectoidPos.z);
D3DXMatrixScaling(&grow, 3/sizeModifier, 3/sizeModifier, 3/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Sectoid.Draw(Stone);
//8
D3DXMatrixTranslation(&tripler, SlendermanPos.x, SlendermanPos.y, SlendermanPos.z);
D3DXMatrixScaling(&grow, .05/sizeModifier, .05/sizeModifier, .05/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Slenderman.Draw(Stone);
//9
D3DXMatrixTranslation(&tripler, SoccerPos.x, SoccerPos.y, SoccerPos.z);
D3DXMatrixScaling(&grow, .05/sizeModifier, .05/sizeModifier, .05/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Soccer.Draw(Stone);
//10
D3DXMatrixTranslation(&tripler, TurretPos.x, TurretPos.y, TurretPos.z);
D3DXMatrixScaling(&grow, .1/sizeModifier, .1/sizeModifier, .1/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Turret.Draw(Stone);
//11
D3DXMatrixTranslation(&tripler, UltramanPos.x, UltramanPos.y, UltramanPos.z);
D3DXMatrixScaling(&grow, .01/sizeModifier, .01/sizeModifier, .01/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Ultraman.Draw(Stone);
//12
D3DXMatrixTranslation(&tripler, ZombiePos.x, ZombiePos.y, ZombiePos.z);
D3DXMatrixScaling(&grow, .1/sizeModifier, .1/sizeModifier, .1/sizeModifier);
D3DXMatrixMultiply(&tripler, &grow, &tripler);
Device->SetTransform(D3DTS_WORLD, &tripler);
Zombie.Draw(Stone);
if(!shrunk && p.z > 10)
{
shrunk = true;
sound.AudioPlay(Voice);
::MessageBoxA(0, "OH NO! you appear to be Shrinking\nStart Running to try and reach the manor", "Oh No!", MB_OK);
DTime *= 5;
}
else if(shrunk)
{
if(sizeModifier >1)
{
sizeModifier-=.005;
}
else if(message)
{
message = false;
::MessageBoxA(0, "It's too late, however you seem to be at the entrance to a castle and there appears to be some createures on the inside.\nMaybe you should try to approach one of them, Be Careful Though: they could be Evil", "Too Late", MB_OK);
}
}
static bool approach = false;
if(!approach)
if(p.z > 125)
{
::MessageBoxA(0, "The creatures seem to be frozen and have had all their color drained...\nThey look like they were once the things that only exis in nightmares\nWhat kind of Powerfull Monster could have done this?\nMaybe you shouldn't have ignored those warnings.", "", MB_OK);
approach = true;
}
static bool bang = false;
if(p.z > 0)
{
if(!bang)
{
bang = true;
sound.AudioPlay(Bang);
}
Device->SetStreamSource(0, VBufferGround, 0, sizeof(Vertex));
Device->SetFVF(FVF_VERTEX);
Device->SetTexture(0, DoNot);
Device->SetTransform(D3DTS_WORLD, &i);
Device->DrawPrimitive(D3DPT_TRIANGLELIST, 36, 2);
Device->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
}
D3DXMATRIX V, T;
TheCamera.getViewMatrix(&V);
Device->SetTransform(D3DTS_VIEW, &V);
TheCamera.getPosition(&p);
if (p.y != 8.5)
p.y = 8.5;
TheCamera.setPosition(&p);
TheCamera.getLook(&t);
Device->EndScene();
Device->Present(0, 0, 0, 0);
}
return true;
}