Initial commit: ROW Client source code
Game client codebase including: - CharacterActionControl: Character and creature management - GlobalScript: Network, items, skills, quests, utilities - RYLClient: Main client application with GUI and event handlers - Engine: 3D rendering engine (RYLGL) - MemoryManager: Custom memory allocation - Library: Third-party dependencies (DirectX, boost, etc.) - Tools: Development utilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
684
Library/dxx8/samples/Multimedia/Demos/DMBoids/boids.cpp
Normal file
684
Library/dxx8/samples/Multimedia/Demos/DMBoids/boids.cpp
Normal file
@@ -0,0 +1,684 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Boids.cpp
|
||||
//
|
||||
// Desc:
|
||||
//
|
||||
// Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#define STRICT
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <d3dx8.h>
|
||||
#include "D3DApp.h"
|
||||
#include "D3DFile.h"
|
||||
#include "D3DFont.h"
|
||||
#include "D3DUtil.h"
|
||||
#include "DXUtil.h"
|
||||
#include "boids.h"
|
||||
#include "music.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Defines, constants, and global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
BoidMusic g_Music;
|
||||
|
||||
struct BOIDVERTEX
|
||||
{
|
||||
D3DXVECTOR3 p;
|
||||
D3DXVECTOR3 n;
|
||||
};
|
||||
|
||||
struct GRIDVERTEX
|
||||
{
|
||||
D3DXVECTOR3 pos;
|
||||
D3DCOLOR color;
|
||||
};
|
||||
|
||||
#define D3DFVF_BOIDVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL)
|
||||
#define D3DFVF_GRIDVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE)
|
||||
|
||||
#define NUM_BOIDS 40
|
||||
|
||||
inline FLOAT rnd() { return (((FLOAT)rand())/RAND_MAX); }
|
||||
|
||||
inline FLOAT Min( D3DXVECTOR3 v )
|
||||
{
|
||||
if( v.x < v.y ) return (v.x < v.z ) ? v.x : v.z;
|
||||
else return (v.y < v.z ) ? v.y : v.z;
|
||||
}
|
||||
|
||||
inline FLOAT Max( D3DXVECTOR3 v )
|
||||
{
|
||||
if( v.x > v.y ) return (v.x > v.z ) ? v.x : v.z;
|
||||
else return (v.y > v.z ) ? v.y : v.z;
|
||||
}
|
||||
|
||||
BOOL g_bSeparation = FALSE;
|
||||
BOOL g_bAlignment = FALSE;
|
||||
BOOL g_bCohesion = FALSE;
|
||||
BOOL g_bMigratory = FALSE;
|
||||
BOOL g_bObstacle = FALSE;
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: class CMyD3DApplication
|
||||
// Desc: Application class. The base class (CD3DApplication) provides the
|
||||
// generic functionality needed in all Direct3D samples. CMyD3DApplication
|
||||
// adds functionality specific to this sample program.
|
||||
//-----------------------------------------------------------------------------
|
||||
class CMyD3DApplication : public CD3DApplication
|
||||
{
|
||||
CD3DFont* m_pFont; // Font for drawing text
|
||||
|
||||
D3DXMATRIX m_matWorld; // Transform matrices
|
||||
D3DXMATRIX m_matView;
|
||||
D3DXMATRIX m_matProj;
|
||||
|
||||
D3DLIGHT8 m_Light1; // Lights and materials
|
||||
D3DLIGHT8 m_Light2;
|
||||
D3DMATERIAL8 m_mtrlBackground;
|
||||
D3DMATERIAL8 m_mtrlGrid;
|
||||
D3DMATERIAL8 m_mtrlBoid;
|
||||
|
||||
CD3DMesh* m_pSphere; // Spheres
|
||||
FLOAT m_fSphereSpin;
|
||||
|
||||
LPDIRECT3DVERTEXBUFFER8 m_pBoidVB; // Boid mesh
|
||||
LPDIRECT3DINDEXBUFFER8 m_pBoidIB;
|
||||
BOIDVERTEX m_vBoidVertices[16];
|
||||
WORD m_wBoidIndices[30];
|
||||
DWORD m_dwNumBoidVertices;
|
||||
DWORD m_dwNumBoidIndices;
|
||||
|
||||
CFlock m_Flock; // The flock structure
|
||||
|
||||
CD3DMesh* m_pSeaGull; // Seagull mesh
|
||||
|
||||
GRIDVERTEX m_vGridPattern1[25]; // Grid mesh
|
||||
GRIDVERTEX m_vGridPattern2[9];
|
||||
|
||||
// Internal functions
|
||||
HRESULT RenderFlock();
|
||||
|
||||
protected:
|
||||
HRESULT OneTimeSceneInit();
|
||||
HRESULT InitDeviceObjects();
|
||||
HRESULT RestoreDeviceObjects();
|
||||
HRESULT InvalidateDeviceObjects();
|
||||
HRESULT DeleteDeviceObjects();
|
||||
HRESULT FinalCleanup();
|
||||
HRESULT Render();
|
||||
HRESULT FrameMove();
|
||||
|
||||
public:
|
||||
LRESULT MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
|
||||
|
||||
CMyD3DApplication();
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: WinMain()
|
||||
// Desc: Entry point to the program. Initializes everything, and goes into a
|
||||
// message-processing loop. Idle time is used to render the scene.
|
||||
//-----------------------------------------------------------------------------
|
||||
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
|
||||
{
|
||||
CMyD3DApplication d3dApp;
|
||||
|
||||
if( FAILED( d3dApp.Create( hInst ) ) )
|
||||
return 0;
|
||||
return d3dApp.Run();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: CMyD3DApplication()
|
||||
// Desc: Application constructor. Sets attributes for the app.
|
||||
//-----------------------------------------------------------------------------
|
||||
CMyD3DApplication::CMyD3DApplication()
|
||||
:CD3DApplication()
|
||||
{
|
||||
m_strWindowTitle = _T("DMBoids: DMusic Flocking Boids Sample");
|
||||
m_bUseDepthBuffer = TRUE;
|
||||
|
||||
m_fSphereSpin = 0.0f;
|
||||
m_pBoidVB = NULL;
|
||||
m_pBoidIB = NULL;
|
||||
m_pSphere = new CD3DMesh();
|
||||
m_pSeaGull = new CD3DMesh();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::OneTimeSceneInit()
|
||||
{
|
||||
D3DXVECTOR3 vNorm;
|
||||
|
||||
// generate the boid data
|
||||
m_dwNumBoidVertices = 16;
|
||||
m_dwNumBoidIndices = 30;
|
||||
|
||||
// top
|
||||
m_vBoidVertices[ 0].p = D3DXVECTOR3( 0.0f, 0.0f, 10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 0].n, &D3DXVECTOR3( 0.2f, 1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 1].p = D3DXVECTOR3( 10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 1].n, &D3DXVECTOR3( 0.1f, 1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 2].p = D3DXVECTOR3( 3.0f, 3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[ 2].n, &D3DXVECTOR3( 0.0f, 1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 3].p = D3DXVECTOR3( -3.0f, 3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[ 3].n, &D3DXVECTOR3(-0.1f, 1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 4].p = D3DXVECTOR3(-10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 4].n, &D3DXVECTOR3(-0.2f, 1.0f, 0.0f) );
|
||||
|
||||
// bottom
|
||||
m_vBoidVertices[ 5].p = D3DXVECTOR3( 0.0f, 0.0f, 10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 5].n, &D3DXVECTOR3( 0.2f, -1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 6].p = D3DXVECTOR3( 10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 6].n, &D3DXVECTOR3( 0.1f, -1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 7].p = D3DXVECTOR3( 3.0f,-3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[ 7].n, &D3DXVECTOR3( 0.0f, -1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 8].p = D3DXVECTOR3( -3.0f,-3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[ 8].n, &D3DXVECTOR3(-0.1f, -1.0f, 0.0f) );
|
||||
m_vBoidVertices[ 9].p = D3DXVECTOR3(-10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[ 9].n, &D3DXVECTOR3(-0.2f, -1.0f, 0.0f) );
|
||||
|
||||
// rear
|
||||
m_vBoidVertices[10].p = D3DXVECTOR3( 10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[10].n, &D3DXVECTOR3(-0.4f, 0.0f, -1.0f) );
|
||||
m_vBoidVertices[11].p = D3DXVECTOR3( 3.0f, 3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[11].n, &D3DXVECTOR3(-0.2f, 0.0f, -1.0f) );
|
||||
m_vBoidVertices[12].p = D3DXVECTOR3( -3.0f, 3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[12].n, &D3DXVECTOR3( 0.2f, 0.0f, -1.0f) );
|
||||
m_vBoidVertices[13].p = D3DXVECTOR3(-10.0f, 0.0f,-10.0f); D3DXVec3Normalize( &m_vBoidVertices[13].n, &D3DXVECTOR3( 0.4f, 0.0f, -1.0f) );
|
||||
m_vBoidVertices[14].p = D3DXVECTOR3( -3.0f,-3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[14].n, &D3DXVECTOR3( 0.2f, 0.0f, -1.0f) );
|
||||
m_vBoidVertices[15].p = D3DXVECTOR3( 3.0f,-3.0f, -7.0f); D3DXVec3Normalize( &m_vBoidVertices[15].n, &D3DXVECTOR3(-0.2f, 0.0f, -1.0f) );
|
||||
|
||||
// top
|
||||
m_wBoidIndices[ 0] = 0; m_wBoidIndices[ 1] = 1; m_wBoidIndices[ 2] = 2;
|
||||
m_wBoidIndices[ 3] = 0; m_wBoidIndices[ 4] = 2; m_wBoidIndices[ 5] = 3;
|
||||
m_wBoidIndices[ 6] = 0; m_wBoidIndices[ 7] = 3; m_wBoidIndices[ 8] = 4;
|
||||
|
||||
// bottom
|
||||
m_wBoidIndices[ 9] = 5; m_wBoidIndices[10] = 7; m_wBoidIndices[11] = 6;
|
||||
m_wBoidIndices[12] = 5; m_wBoidIndices[13] = 8; m_wBoidIndices[14] = 7;
|
||||
m_wBoidIndices[15] = 5; m_wBoidIndices[16] = 9; m_wBoidIndices[17] = 8;
|
||||
|
||||
// rear
|
||||
m_wBoidIndices[18] = 10; m_wBoidIndices[19] = 15; m_wBoidIndices[20] = 11;
|
||||
m_wBoidIndices[21] = 11; m_wBoidIndices[22] = 15; m_wBoidIndices[23] = 12;
|
||||
m_wBoidIndices[24] = 12; m_wBoidIndices[25] = 15; m_wBoidIndices[26] = 14;
|
||||
m_wBoidIndices[27] = 12; m_wBoidIndices[28] = 14; m_wBoidIndices[29] = 13;
|
||||
|
||||
// scale the boid to be unit length
|
||||
for( DWORD i=0; i<16; i++ )
|
||||
{
|
||||
m_vBoidVertices[i].p.x /= 20.0f;
|
||||
m_vBoidVertices[i].p.y /= 20.0f;
|
||||
m_vBoidVertices[i].p.z /= 20.0f;
|
||||
}
|
||||
|
||||
// seed the random number generator
|
||||
srand( timeGetTime() );
|
||||
|
||||
// allocate the flock
|
||||
m_Flock.m_Boids = new Boid[NUM_BOIDS];
|
||||
m_Flock.m_dwNumBoids = NUM_BOIDS;
|
||||
m_Flock.m_afDist = (FLOAT**)new LPVOID[NUM_BOIDS];
|
||||
m_Flock.m_vGoal = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
|
||||
for( i=0; i<m_Flock.m_dwNumBoids; i++ )
|
||||
{
|
||||
D3DXMatrixIdentity( &m_Flock.m_Boids[i].matWorld );
|
||||
m_Flock.m_Boids[i].vPos = D3DXVECTOR3( 200.0f*(rnd()-rnd()), 100.0f*rnd(), 200.0f*(rnd()-rnd()) );
|
||||
D3DXVec3Normalize( &m_Flock.m_Boids[i].vDir, &D3DXVECTOR3(rnd()-rnd(), rnd()-rnd(), rnd()-rnd()));
|
||||
m_Flock.m_Boids[i].yaw = 0.0f;
|
||||
m_Flock.m_Boids[i].pitch = 0.0f;
|
||||
m_Flock.m_Boids[i].roll = 0.0f;
|
||||
m_Flock.m_Boids[i].dyaw = 0.0f;
|
||||
m_Flock.m_Boids[i].speed = 0.1f;
|
||||
m_Flock.m_Boids[i].color = D3DXVECTOR3( rnd(), rnd(), rnd() );
|
||||
m_Flock.m_Boids[i].color -= D3DXVECTOR3( Min(m_Flock.m_Boids[i].color), Min(m_Flock.m_Boids[i].color), Min(m_Flock.m_Boids[i].color) );
|
||||
m_Flock.m_Boids[i].color /= Max( m_Flock.m_Boids[i].color );
|
||||
m_Flock.m_afDist[i] = new FLOAT[NUM_BOIDS];
|
||||
}
|
||||
|
||||
m_Flock.m_dwNumObstacles = 4;
|
||||
m_Flock.m_Obstacles = new Obstacle[m_Flock.m_dwNumObstacles];
|
||||
m_Flock.m_Obstacles[0].vPos = D3DXVECTOR3( 100.0f, 10.0f, 0.0f );
|
||||
m_Flock.m_Obstacles[1].vPos = D3DXVECTOR3( 0.0f, 10.0f, 100.0f );
|
||||
m_Flock.m_Obstacles[2].vPos = D3DXVECTOR3(-100.0f, 10.0f, 0.0f );
|
||||
m_Flock.m_Obstacles[3].vPos = D3DXVECTOR3( 0.0f, 10.0f,-100.0f );
|
||||
m_Flock.m_Obstacles[0].fRadius = 0.2f;
|
||||
m_Flock.m_Obstacles[1].fRadius = 0.2f;
|
||||
m_Flock.m_Obstacles[2].fRadius = 0.2f;
|
||||
m_Flock.m_Obstacles[3].fRadius = 0.2f;
|
||||
|
||||
D3DCOLOR diffuse = D3DCOLOR_RGBA( 0, 0, 30, 128 );
|
||||
D3DCOLOR specular = D3DCOLOR_RGBA( 0, 0, 0, 0 );
|
||||
|
||||
for( i=0; i<=24; i++ )
|
||||
m_vGridPattern1[i].color = diffuse;
|
||||
|
||||
m_vGridPattern1[ 0].pos = D3DXVECTOR3(-25.0f, 0.0f, 35.0f );
|
||||
m_vGridPattern1[ 1].pos = D3DXVECTOR3(-15.0f, 0.0f, 35.0f );
|
||||
m_vGridPattern1[ 2].pos = D3DXVECTOR3( -5.0f, 0.0f, 25.0f );
|
||||
m_vGridPattern1[ 3].pos = D3DXVECTOR3( 5.0f, 0.0f, 25.0f );
|
||||
m_vGridPattern1[ 4].pos = D3DXVECTOR3( 15.0f, 0.0f, 35.0f );
|
||||
m_vGridPattern1[ 5].pos = D3DXVECTOR3( 25.0f, 0.0f, 35.0f );
|
||||
m_vGridPattern1[ 6].pos = D3DXVECTOR3( 35.0f, 0.0f, 25.0f );
|
||||
m_vGridPattern1[ 7].pos = D3DXVECTOR3( 35.0f, 0.0f, 15.0f );
|
||||
m_vGridPattern1[ 8].pos = D3DXVECTOR3( 25.0f, 0.0f, 5.0f );
|
||||
m_vGridPattern1[ 9].pos = D3DXVECTOR3( 25.0f, 0.0f, -5.0f );
|
||||
m_vGridPattern1[10].pos = D3DXVECTOR3( 35.0f, 0.0f,-15.0f );
|
||||
m_vGridPattern1[11].pos = D3DXVECTOR3( 35.0f, 0.0f,-25.0f );
|
||||
m_vGridPattern1[12].pos = D3DXVECTOR3( 25.0f, 0.0f,-35.0f );
|
||||
m_vGridPattern1[13].pos = D3DXVECTOR3( 15.0f, 0.0f,-35.0f );
|
||||
m_vGridPattern1[14].pos = D3DXVECTOR3( 5.0f, 0.0f,-25.0f );
|
||||
m_vGridPattern1[15].pos = D3DXVECTOR3( -5.0f, 0.0f,-25.0f );
|
||||
m_vGridPattern1[16].pos = D3DXVECTOR3(-15.0f, 0.0f,-35.0f );
|
||||
m_vGridPattern1[17].pos = D3DXVECTOR3(-25.0f, 0.0f,-35.0f );
|
||||
m_vGridPattern1[18].pos = D3DXVECTOR3(-35.0f, 0.0f,-25.0f );
|
||||
m_vGridPattern1[19].pos = D3DXVECTOR3(-35.0f, 0.0f,-15.0f );
|
||||
m_vGridPattern1[20].pos = D3DXVECTOR3(-25.0f, 0.0f, -5.0f );
|
||||
m_vGridPattern1[21].pos = D3DXVECTOR3(-25.0f, 0.0f, 5.0f );
|
||||
m_vGridPattern1[22].pos = D3DXVECTOR3(-35.0f, 0.0f, 15.0f );
|
||||
m_vGridPattern1[23].pos = D3DXVECTOR3(-35.0f, 0.0f, 25.0f );
|
||||
m_vGridPattern1[24].pos = D3DXVECTOR3(-25.0f, 0.0f, 35.0f );
|
||||
|
||||
for( i=0; i<=8; i++ )
|
||||
m_vGridPattern2[i].color = diffuse;
|
||||
|
||||
m_vGridPattern2[0].pos = D3DXVECTOR3( -5.0f, 0.0f, 15.0f );
|
||||
m_vGridPattern2[1].pos = D3DXVECTOR3( 5.0f, 0.0f, 15.0f );
|
||||
m_vGridPattern2[2].pos = D3DXVECTOR3( 15.0f, 0.0f, 5.0f );
|
||||
m_vGridPattern2[3].pos = D3DXVECTOR3( 15.0f, 0.0f, -5.0f );
|
||||
m_vGridPattern2[4].pos = D3DXVECTOR3( 5.0f, 0.0f,-15.0f );
|
||||
m_vGridPattern2[5].pos = D3DXVECTOR3( -5.0f, 0.0f,-15.0f );
|
||||
m_vGridPattern2[6].pos = D3DXVECTOR3(-15.0f, 0.0f, -5.0f );
|
||||
m_vGridPattern2[7].pos = D3DXVECTOR3(-15.0f, 0.0f, 5.0f );
|
||||
m_vGridPattern2[8].pos = D3DXVECTOR3( -5.0f, 0.0f, 15.0f );
|
||||
|
||||
if( FAILED( g_Music.LoadMusic( m_hWnd ) ) )
|
||||
{
|
||||
OutputDebugString("Failed to initialize DirectMusic.\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
g_Music.StartMusic();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: FrameMove()
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::FrameMove()
|
||||
{
|
||||
D3DXVECTOR3 vEyePt;
|
||||
D3DXVECTOR3 vLookAtPt( 0.0f, 0.0f, 0.0f );
|
||||
D3DXVECTOR3 vUp( 0.0f, 1.0f, 0.0f );
|
||||
|
||||
FLOAT fTime;
|
||||
FLOAT fElapsedTime;
|
||||
|
||||
// The REF device is slow enough to throw off the animation
|
||||
// in this sample, so if using the REF device, simulate
|
||||
// running at 20fps regardless of actual rendering speed.
|
||||
if( m_d3dCaps.DeviceType == D3DDEVTYPE_REF )
|
||||
{
|
||||
static FLOAT fTimePrev = 0.0f;
|
||||
fElapsedTime = 0.05f;
|
||||
fTime = fTimePrev + fElapsedTime;
|
||||
fTimePrev = fTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
fElapsedTime = m_fElapsedTime;
|
||||
fTime = m_fTime;
|
||||
}
|
||||
|
||||
// Move each boids to its new location
|
||||
m_Flock.Update( fElapsedTime );
|
||||
|
||||
// LookAt point is the center of the flock
|
||||
for( DWORD i=0; i<m_Flock.m_dwNumBoids; i++ )
|
||||
vLookAtPt += m_Flock.m_Boids[i].vPos;
|
||||
vLookAtPt /= (FLOAT)m_Flock.m_dwNumBoids;
|
||||
|
||||
vEyePt = vLookAtPt + 40 * D3DXVECTOR3( sinf(fTime*0.111f),
|
||||
0.70f+0.75f*sinf(fTime*0.163f),
|
||||
cosf(fTime*0.155f) );
|
||||
|
||||
D3DXMatrixLookAtLH( &m_matView, &vEyePt, &vLookAtPt, &vUp );
|
||||
|
||||
g_Music.SetDistance( D3DXVec3Length( &( vEyePt - vLookAtPt ) ) );
|
||||
|
||||
// Update the flock's goal
|
||||
m_Flock.m_vGoal = 100.0f * D3DXVECTOR3( sinf(fTime*0.1f), 0.1f, cosf(fTime*0.1f) );
|
||||
|
||||
m_fSphereSpin = fTime;
|
||||
|
||||
g_Music.HandleNotifies();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: RenderFlock()
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::RenderFlock()
|
||||
{
|
||||
// Set the view and projection matrices
|
||||
m_pd3dDevice->SetTransform( D3DTS_VIEW, &m_matView );
|
||||
m_pd3dDevice->SetTransform( D3DTS_PROJECTION, &m_matProj );
|
||||
|
||||
// Draw ground grid
|
||||
m_pd3dDevice->SetMaterial( &m_mtrlGrid );
|
||||
|
||||
for (int dx= -2; dx<3; dx++)
|
||||
{
|
||||
for (int dz= -2; dz<3; dz++)
|
||||
{
|
||||
D3DXMatrixTranslation( &m_matWorld, dx*80.0f, 0.0f, dz*80.0f );
|
||||
m_pd3dDevice->SetTransform( D3DTS_WORLD, &m_matWorld );
|
||||
|
||||
m_pd3dDevice->SetVertexShader( D3DFVF_GRIDVERTEX );
|
||||
m_pd3dDevice->DrawPrimitiveUP( D3DPT_LINESTRIP, 24, m_vGridPattern1,
|
||||
sizeof(GRIDVERTEX) );
|
||||
m_pd3dDevice->DrawPrimitiveUP( D3DPT_LINESTRIP, 8, m_vGridPattern2,
|
||||
sizeof(GRIDVERTEX) );
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the boids
|
||||
for( DWORD i=0; i<m_Flock.m_dwNumBoids; i++ )
|
||||
{
|
||||
// Most of the time display the boid
|
||||
if( i%13 || m_d3dCaps.DeviceType == D3DDEVTYPE_REF )
|
||||
{
|
||||
// Set the boid's world matrix
|
||||
m_pd3dDevice->SetTransform( D3DTS_WORLD, &m_Flock.m_Boids[i].matWorld );
|
||||
|
||||
// Set the boid's color
|
||||
m_mtrlBoid.Diffuse.r = m_Flock.m_Boids[i].color.x;
|
||||
m_mtrlBoid.Diffuse.g = m_Flock.m_Boids[i].color.y;
|
||||
m_mtrlBoid.Diffuse.b = m_Flock.m_Boids[i].color.z;
|
||||
m_pd3dDevice->SetMaterial( &m_mtrlBoid );
|
||||
|
||||
// Render the boid
|
||||
m_pd3dDevice->SetVertexShader( D3DFVF_BOIDVERTEX );
|
||||
m_pd3dDevice->SetStreamSource( 0, m_pBoidVB, sizeof(BOIDVERTEX) );
|
||||
m_pd3dDevice->SetIndices( m_pBoidIB, 0L );
|
||||
m_pd3dDevice->DrawIndexedPrimitive( D3DPT_TRIANGLELIST,
|
||||
0, m_dwNumBoidVertices,
|
||||
0, m_dwNumBoidIndices/3 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the matrix
|
||||
D3DXMATRIX matWorld, matRotateY;
|
||||
D3DXMatrixRotationY( &matRotateY, D3DX_PI );
|
||||
D3DXMatrixMultiply( &matWorld, &matRotateY, &m_Flock.m_Boids[i].matWorld );
|
||||
m_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
|
||||
|
||||
// Display a seagull
|
||||
m_pSeaGull->Render( m_pd3dDevice );
|
||||
}
|
||||
}
|
||||
|
||||
for( i=0; i<m_Flock.m_dwNumObstacles; i++ )
|
||||
{
|
||||
D3DXMATRIX matRotate, matScale;
|
||||
FLOAT fScale = m_Flock.m_Obstacles[i].fRadius;
|
||||
D3DXMatrixRotationY( &matRotate, m_fSphereSpin );
|
||||
D3DXMatrixScaling( &matScale, fScale, fScale, fScale );
|
||||
D3DXMatrixMultiply( &m_matWorld, &matScale, &matRotate );
|
||||
m_matWorld._41 = m_Flock.m_Obstacles[i].vPos.x;
|
||||
m_matWorld._42 = m_Flock.m_Obstacles[i].vPos.y;
|
||||
m_matWorld._43 = m_Flock.m_Obstacles[i].vPos.z;
|
||||
|
||||
m_pd3dDevice->SetTransform( D3DTS_WORLD, &m_matWorld );
|
||||
|
||||
m_pSphere->Render( m_pd3dDevice );
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::Render()
|
||||
{
|
||||
// Clear the scene to black
|
||||
m_pd3dDevice->Clear( 0L, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,
|
||||
0x00000000, 1.0f, 0L );
|
||||
|
||||
// Begin Scene
|
||||
if( FAILED( m_pd3dDevice->BeginScene() ) )
|
||||
return S_OK;
|
||||
|
||||
RenderFlock();
|
||||
|
||||
m_pd3dDevice->EndScene();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::InitDeviceObjects()
|
||||
{
|
||||
if( FAILED( m_pSphere->Create( m_pd3dDevice, _T("orbiter.x") ) ) )
|
||||
return D3DAPPERR_MEDIANOTFOUND;
|
||||
if( FAILED( m_pSeaGull->Create( m_pd3dDevice, _T("Shusui.x") ) ) )
|
||||
return D3DAPPERR_MEDIANOTFOUND;
|
||||
|
||||
// Create a VB for the boids
|
||||
if( FAILED( m_pd3dDevice->CreateVertexBuffer( m_dwNumBoidVertices*sizeof(BOIDVERTEX),
|
||||
D3DUSAGE_WRITEONLY, D3DFVF_BOIDVERTEX,
|
||||
D3DPOOL_MANAGED, &m_pBoidVB ) ) )
|
||||
return E_FAIL;
|
||||
|
||||
BOIDVERTEX* v;
|
||||
m_pBoidVB->Lock( 0, 0, (BYTE**)&v, 0 );
|
||||
memcpy( v, m_vBoidVertices, m_dwNumBoidVertices*sizeof(BOIDVERTEX) );
|
||||
m_pBoidVB->Unlock();
|
||||
|
||||
// Create an IB for the boids
|
||||
if( FAILED( m_pd3dDevice->CreateIndexBuffer( m_dwNumBoidIndices*sizeof(WORD),
|
||||
D3DUSAGE_WRITEONLY, D3DFMT_INDEX16,
|
||||
D3DPOOL_MANAGED, &m_pBoidIB ) ) )
|
||||
return E_FAIL;
|
||||
|
||||
WORD* i;
|
||||
m_pBoidIB->Lock( 0, 0, (BYTE**)&i, 0 );
|
||||
memcpy( i, m_wBoidIndices, m_dwNumBoidIndices*sizeof(WORD) );
|
||||
m_pBoidIB->Unlock();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::RestoreDeviceObjects()
|
||||
{
|
||||
m_pSphere->RestoreDeviceObjects( m_pd3dDevice );
|
||||
m_pSeaGull->RestoreDeviceObjects( m_pd3dDevice );
|
||||
|
||||
// Set up transform matrices
|
||||
D3DXVECTOR3 vEyePt = D3DXVECTOR3( 0.0f, 0.0f, -100.0f );
|
||||
D3DXVECTOR3 vLookAtPt = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
D3DXVECTOR3 vUp = D3DXVECTOR3( 0.0f, 1.0f, 0.0f );
|
||||
D3DXMatrixIdentity( &m_matWorld );
|
||||
D3DXMatrixLookAtLH( &m_matView, &vEyePt, &vLookAtPt, &vUp );
|
||||
D3DXMatrixPerspectiveFovLH( &m_matProj, D3DX_PI/4, 1.0f, 5.0f, 400.0f );
|
||||
|
||||
// Setup materials
|
||||
D3DUtil_InitMaterial( m_mtrlBackground, 0.0f, 0.0f, 0.0f );
|
||||
D3DUtil_InitMaterial( m_mtrlGrid, 0.0f, 0.0f, 0.0f );
|
||||
m_mtrlGrid.Emissive.r = 0.0f;
|
||||
m_mtrlGrid.Emissive.g = 0.3f;
|
||||
m_mtrlGrid.Emissive.b = 0.5f;
|
||||
D3DUtil_InitMaterial( m_mtrlBoid, 1.0f, 1.0f, 1.0f );
|
||||
|
||||
// Create 2 lights
|
||||
D3DUtil_InitLight( m_Light1, D3DLIGHT_DIRECTIONAL, -0.5f, -1.0f, -0.3f );
|
||||
D3DUtil_InitLight( m_Light2, D3DLIGHT_DIRECTIONAL, 0.5f, 1.0f, 0.3f );
|
||||
m_Light2.Diffuse.r = 0.5f;
|
||||
m_Light2.Diffuse.g = 0.5f;
|
||||
m_Light2.Diffuse.b = 0.5f;
|
||||
m_pd3dDevice->SetLight( 0, &m_Light1 );
|
||||
m_pd3dDevice->SetLight( 1, &m_Light2 );
|
||||
m_pd3dDevice->LightEnable( 0, TRUE );
|
||||
m_pd3dDevice->LightEnable( 1, TRUE );
|
||||
|
||||
// Set render state
|
||||
m_pd3dDevice->SetRenderState( D3DRS_SPECULARENABLE, FALSE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_DITHERENABLE, TRUE );
|
||||
m_pd3dDevice->SetRenderState( D3DRS_AMBIENT, 0x11111111 );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::InvalidateDeviceObjects()
|
||||
{
|
||||
m_pSphere->InvalidateDeviceObjects();
|
||||
m_pSeaGull->InvalidateDeviceObjects();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::DeleteDeviceObjects()
|
||||
{
|
||||
m_pSphere->Destroy();
|
||||
m_pSeaGull->Destroy();
|
||||
|
||||
SAFE_RELEASE( m_pBoidVB );
|
||||
SAFE_RELEASE( m_pBoidIB );
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
HRESULT CMyD3DApplication::FinalCleanup()
|
||||
{
|
||||
for( int i=0; i<NUM_BOIDS; i++ )
|
||||
{
|
||||
SAFE_DELETE_ARRAY( m_Flock.m_afDist[i] );
|
||||
}
|
||||
|
||||
SAFE_DELETE_ARRAY( m_Flock.m_Boids );
|
||||
SAFE_DELETE_ARRAY( m_Flock.m_afDist );
|
||||
SAFE_DELETE_ARRAY( m_Flock.m_Obstacles );
|
||||
|
||||
SAFE_DELETE( m_pSphere );
|
||||
SAFE_DELETE( m_pSeaGull );
|
||||
|
||||
g_Music.EndMusic();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name: MsgProc()
|
||||
// Desc: Message proc function to handle key and menu input
|
||||
//-----------------------------------------------------------------------------
|
||||
LRESULT CMyD3DApplication::MsgProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
||||
LPARAM lParam )
|
||||
{
|
||||
// Handle menu commands
|
||||
if( WM_KEYDOWN==uMsg || WM_KEYUP==uMsg )
|
||||
{
|
||||
switch( wParam )
|
||||
{
|
||||
case 'A':
|
||||
g_bAlignment = (WM_KEYDOWN==uMsg);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
g_bCohesion = (WM_KEYDOWN==uMsg);
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
g_bObstacle = (WM_KEYDOWN==uMsg);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
g_bMigratory = (WM_KEYDOWN==uMsg);
|
||||
|
||||
if( g_bMigratory )
|
||||
g_Music.Migrate();
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
g_bSeparation = (WM_KEYDOWN==uMsg);
|
||||
|
||||
if( g_bSeparation )
|
||||
g_Music.Collapse();
|
||||
else
|
||||
g_Music.Expand();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( WM_ACTIVATE==uMsg )
|
||||
{
|
||||
g_Music.Activate( LOWORD( wParam ) != WA_INACTIVE );
|
||||
}
|
||||
|
||||
// Pass remaining messages to default handler
|
||||
return CD3DApplication::MsgProc( hWnd, uMsg, wParam, lParam );
|
||||
}
|
||||
|
||||
|
||||
|
||||
79
Library/dxx8/samples/Multimedia/Demos/DMBoids/boids.h
Normal file
79
Library/dxx8/samples/Multimedia/Demos/DMBoids/boids.h
Normal file
@@ -0,0 +1,79 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Boids.h
|
||||
//
|
||||
// Desc:
|
||||
//
|
||||
// Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifndef BOIDS_H
|
||||
#define BOIDS_H
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
class Boid
|
||||
{
|
||||
public:
|
||||
D3DXMATRIX matWorld; // matrix representing the boids location/orientation
|
||||
D3DXVECTOR3 vPos; // location
|
||||
D3DXVECTOR3 vDir; // cur direction
|
||||
D3DXVECTOR3 vSeparationForce;
|
||||
D3DXVECTOR3 vAlignmentForce;
|
||||
D3DXVECTOR3 vCohesionForce;
|
||||
D3DXVECTOR3 vMigratoryForce;
|
||||
D3DXVECTOR3 vObstacleForce;
|
||||
DWORD dwNumNeighbors;
|
||||
|
||||
D3DXVECTOR3 vDeltaPos; // change in position from flock centering
|
||||
D3DXVECTOR3 vDeltaDir; // change in direction
|
||||
int iDeltaCnt; // number of boids that influence this delta_dir
|
||||
FLOAT speed;
|
||||
FLOAT yaw, pitch, roll, dyaw;
|
||||
D3DXVECTOR3 color;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
struct Obstacle
|
||||
{
|
||||
D3DXVECTOR3 vPos;
|
||||
FLOAT fRadius;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
class CFlock
|
||||
{
|
||||
public:
|
||||
DWORD m_dwNumBoids;
|
||||
Boid* m_Boids;
|
||||
DWORD m_dwNumObstacles;
|
||||
Obstacle* m_Obstacles;
|
||||
FLOAT** m_afDist; // 2-d array of boid distances, yuk what a waste
|
||||
D3DXVECTOR3 m_vGoal;
|
||||
|
||||
// Functions
|
||||
VOID Update( FLOAT fElapsedTime );
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
BIN
Library/dxx8/samples/Multimedia/Demos/DMBoids/directx.ico
Normal file
BIN
Library/dxx8/samples/Multimedia/Demos/DMBoids/directx.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
136
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.dsp
Normal file
136
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.dsp
Normal file
@@ -0,0 +1,136 @@
|
||||
# Microsoft Developer Studio Project File - Name="DMBoids" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=DMBoids - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "dmboids.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "dmboids.mak" CFG="DMBoids - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DMBoids - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DMBoids - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "DMBoids - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 d3dx8.lib d3d8.lib d3dxof.lib dinput.lib dxguid.lib winspool.lib oleaut32.lib uuid.lib dxerr8.lib ole32.lib winmm.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /machine:I386 /stack:0x1f4000,0x1f4000
|
||||
|
||||
!ELSEIF "$(CFG)" == "DMBoids - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
|
||||
# SUBTRACT CPP /YX
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 d3dx8dt.lib d3d8.lib d3dxof.lib dinput.lib dxguid.lib winspool.lib oleaut32.lib uuid.lib dxerr8.lib ole32.lib winmm.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /stack:0x1f4000,0x1f4000
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "DMBoids - Win32 Release"
|
||||
# Name "DMBoids - Win32 Debug"
|
||||
# Begin Group "Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\d3dapp.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\d3dfile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\d3dfont.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\d3dutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\dmutil.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\boids.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\dmboids.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\flock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\music.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
29
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.dsw
Normal file
29
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.dsw
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "DMBoids"=.\dmboids.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
279
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.mak
Normal file
279
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.mak
Normal file
@@ -0,0 +1,279 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Based on dmboids.dsp
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=DMBoids - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to DMBoids - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "DMBoids - Win32 Release" && "$(CFG)" != "DMBoids - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "dmboids.mak" CFG="DMBoids - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "DMBoids - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "DMBoids - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" == "DMBoids - Win32 Release"
|
||||
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Release
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\dmboids.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\boids.obj"
|
||||
-@erase "$(INTDIR)\d3dapp.obj"
|
||||
-@erase "$(INTDIR)\d3dfile.obj"
|
||||
-@erase "$(INTDIR)\d3dfont.obj"
|
||||
-@erase "$(INTDIR)\d3dutil.obj"
|
||||
-@erase "$(INTDIR)\dmboids.res"
|
||||
-@erase "$(INTDIR)\dmutil.obj"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\flock.obj"
|
||||
-@erase "$(INTDIR)\music.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(OUTDIR)\dmboids.exe"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /I "..\..\common\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)\dmboids.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\dmboids.res" /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dmboids.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=d3dx8.lib d3d8.lib d3dxof.lib dinput.lib dxguid.lib winspool.lib oleaut32.lib uuid.lib dxerr8.lib ole32.lib winmm.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /incremental:no /pdb:"$(OUTDIR)\dmboids.pdb" /machine:I386 /out:"$(OUTDIR)\dmboids.exe"
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\d3dapp.obj" \
|
||||
"$(INTDIR)\d3dfile.obj" \
|
||||
"$(INTDIR)\d3dfont.obj" \
|
||||
"$(INTDIR)\d3dutil.obj" \
|
||||
"$(INTDIR)\dmutil.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\boids.obj" \
|
||||
"$(INTDIR)\flock.obj" \
|
||||
"$(INTDIR)\music.obj" \
|
||||
"$(INTDIR)\dmboids.res"
|
||||
|
||||
"$(OUTDIR)\dmboids.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "DMBoids - Win32 Debug"
|
||||
|
||||
OUTDIR=.\Debug
|
||||
INTDIR=.\Debug
|
||||
# Begin Custom Macros
|
||||
OutDir=.\Debug
|
||||
# End Custom Macros
|
||||
|
||||
ALL : "$(OUTDIR)\dmboids.exe"
|
||||
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\boids.obj"
|
||||
-@erase "$(INTDIR)\d3dapp.obj"
|
||||
-@erase "$(INTDIR)\d3dfile.obj"
|
||||
-@erase "$(INTDIR)\d3dfont.obj"
|
||||
-@erase "$(INTDIR)\d3dutil.obj"
|
||||
-@erase "$(INTDIR)\dmboids.res"
|
||||
-@erase "$(INTDIR)\dmutil.obj"
|
||||
-@erase "$(INTDIR)\dxutil.obj"
|
||||
-@erase "$(INTDIR)\flock.obj"
|
||||
-@erase "$(INTDIR)\music.obj"
|
||||
-@erase "$(INTDIR)\vc60.idb"
|
||||
-@erase "$(INTDIR)\vc60.pdb"
|
||||
-@erase "$(OUTDIR)\dmboids.exe"
|
||||
-@erase "$(OUTDIR)\dmboids.ilk"
|
||||
-@erase "$(OUTDIR)\dmboids.pdb"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
CPP=cl.exe
|
||||
CPP_PROJ=/nologo /MLd /W3 /Gm /GX /Zi /Od /I "..\..\common\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
|
||||
|
||||
.c{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.obj::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.c{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cpp{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
.cxx{$(INTDIR)}.sbr::
|
||||
$(CPP) @<<
|
||||
$(CPP_PROJ) $<
|
||||
<<
|
||||
|
||||
MTL=midl.exe
|
||||
MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
|
||||
RSC=rc.exe
|
||||
RSC_PROJ=/l 0x409 /fo"$(INTDIR)\dmboids.res" /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)\dmboids.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LINK32=link.exe
|
||||
LINK32_FLAGS=d3dx8dt.lib d3d8.lib d3dxof.lib dinput.lib dxguid.lib winspool.lib oleaut32.lib uuid.lib dxerr8.lib ole32.lib winmm.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib advapi32.lib shell32.lib /nologo /subsystem:windows /incremental:yes /pdb:"$(OUTDIR)\dmboids.pdb" /debug /machine:I386 /out:"$(OUTDIR)\dmboids.exe" /pdbtype:sept
|
||||
LINK32_OBJS= \
|
||||
"$(INTDIR)\d3dapp.obj" \
|
||||
"$(INTDIR)\d3dfile.obj" \
|
||||
"$(INTDIR)\d3dfont.obj" \
|
||||
"$(INTDIR)\d3dutil.obj" \
|
||||
"$(INTDIR)\dmutil.obj" \
|
||||
"$(INTDIR)\dxutil.obj" \
|
||||
"$(INTDIR)\boids.obj" \
|
||||
"$(INTDIR)\flock.obj" \
|
||||
"$(INTDIR)\music.obj" \
|
||||
"$(INTDIR)\dmboids.res"
|
||||
|
||||
"$(OUTDIR)\dmboids.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
|
||||
$(LINK32) @<<
|
||||
$(LINK32_FLAGS) $(LINK32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(NO_EXTERNAL_DEPS)" != "1"
|
||||
!IF EXISTS("dmboids.dep")
|
||||
!INCLUDE "dmboids.dep"
|
||||
!ELSE
|
||||
!MESSAGE Warning: cannot find "dmboids.dep"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
|
||||
!IF "$(CFG)" == "DMBoids - Win32 Release" || "$(CFG)" == "DMBoids - Win32 Debug"
|
||||
SOURCE=..\..\common\src\d3dapp.cpp
|
||||
|
||||
"$(INTDIR)\d3dapp.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\d3dfile.cpp
|
||||
|
||||
"$(INTDIR)\d3dfile.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\d3dfont.cpp
|
||||
|
||||
"$(INTDIR)\d3dfont.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\d3dutil.cpp
|
||||
|
||||
"$(INTDIR)\d3dutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\dmutil.cpp
|
||||
|
||||
"$(INTDIR)\dmutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=..\..\common\src\dxutil.cpp
|
||||
|
||||
"$(INTDIR)\dxutil.obj" : $(SOURCE) "$(INTDIR)"
|
||||
$(CPP) $(CPP_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\boids.cpp
|
||||
|
||||
"$(INTDIR)\boids.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\dmboids.rc
|
||||
|
||||
"$(INTDIR)\dmboids.res" : $(SOURCE) "$(INTDIR)"
|
||||
$(RSC) $(RSC_PROJ) $(SOURCE)
|
||||
|
||||
|
||||
SOURCE=.\flock.cpp
|
||||
|
||||
"$(INTDIR)\flock.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
SOURCE=.\music.cpp
|
||||
|
||||
"$(INTDIR)\music.obj" : $(SOURCE) "$(INTDIR)"
|
||||
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
211
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.rc
Normal file
211
Library/dxx8/samples/Multimedia/Demos/DMBoids/dmboids.rc
Normal file
@@ -0,0 +1,211 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define IDC_STATIC -1
|
||||
#include <windows.h>
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_MAIN_ICON ICON DISCARDABLE "DirectX.ico"
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define IDC_STATIC -1\r\n"
|
||||
"#include <windows.h>\r\n"
|
||||
"\r\n"
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_MAIN_ACCEL ACCELERATORS DISCARDABLE
|
||||
BEGIN
|
||||
VK_ESCAPE, IDM_EXIT, VIRTKEY, NOINVERT
|
||||
VK_F1, IDM_ABOUT, VIRTKEY, NOINVERT
|
||||
VK_F2, IDM_CHANGEDEVICE, VIRTKEY, NOINVERT
|
||||
VK_RETURN, IDM_TOGGLESTART, VIRTKEY, NOINVERT
|
||||
VK_RETURN, IDM_TOGGLEFULLSCREEN, VIRTKEY, ALT, NOINVERT
|
||||
VK_SPACE, IDM_SINGLESTEP, VIRTKEY, NOINVERT
|
||||
"X", IDM_EXIT, VIRTKEY, ALT, NOINVERT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUT, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 165
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 104
|
||||
END
|
||||
|
||||
IDD_SELECTDEVICE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 259
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 109
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUT DIALOG DISCARDABLE 0, 0, 172, 111
|
||||
STYLE DS_SYSMODAL | DS_MODALFRAME | DS_NOIDLEMSG | DS_SETFOREGROUND |
|
||||
DS_3DLOOK | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,115,90,40,14
|
||||
ICON IDI_MAIN_ICON,IDC_STATIC,5,5,20,20
|
||||
LTEXT "Direct3D Sample",IDC_STATIC,35,5,54,8
|
||||
LTEXT "Copyright (c) 1998-1999 Microsoft Corp.",IDC_STATIC,35,
|
||||
15,126,8
|
||||
LTEXT "About",IDC_STATIC,60,40,20,8
|
||||
LTEXT "Select Driver / Device / Mode",IDC_STATIC,60,50,97,8
|
||||
CTEXT "<Alt+Enter>",IDC_STATIC,10,60,45,8
|
||||
LTEXT "Toggle Fullscreen / Windowed",IDC_STATIC,60,60,98,8
|
||||
LTEXT "Exit",IDC_STATIC,60,70,12,8
|
||||
CTEXT "<F1>",IDC_STATIC,10,40,45,8
|
||||
CTEXT "<F2>",IDC_STATIC,10,50,45,8
|
||||
CTEXT "<ESC>",IDC_STATIC,10,70,45,8
|
||||
GROUPBOX "Usage",IDC_STATIC,5,30,160,55
|
||||
END
|
||||
|
||||
IDD_SELECTDEVICE DIALOG DISCARDABLE 0, 0, 267, 116
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Select Device"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
COMBOBOX IDC_ADAPTER_COMBO,90,15,105,100,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_DEVICE_COMBO,90,30,105,100,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
CONTROL "Use desktop &window",IDC_WINDOW,"Button",
|
||||
BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,10,60,85,15
|
||||
CONTROL "&Fullscreen mode",IDC_FULLSCREEN,"Button",
|
||||
BS_AUTORADIOBUTTON,10,75,75,15
|
||||
CONTROL "Fullscreen &stereo",IDC_STEREO,"Button",
|
||||
BS_AUTORADIOBUTTON,10,90,75,15
|
||||
COMBOBOX IDC_FULLSCREENMODES_COMBO,90,75,105,100,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_GROUP | WS_TABSTOP
|
||||
COMBOBOX IDC_STEREOMODES_COMBO,90,90,105,100,CBS_DROPDOWNLIST |
|
||||
WS_VSCROLL | WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,210,10,50,14
|
||||
PUSHBUTTON "Cancel",IDCANCEL,210,30,50,14
|
||||
GROUPBOX "Rendering device",IDC_STATIC,5,5,200,45
|
||||
LTEXT "&Adapter:",IDC_STATIC,20,15,65,10,SS_CENTERIMAGE
|
||||
LTEXT "D3D &device:",IDC_STATIC,20,30,65,11,SS_CENTERIMAGE
|
||||
GROUPBOX "Rendering mode",IDC_STATIC,5,50,200,60
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "&Go/stop\tEnter", IDM_TOGGLESTART
|
||||
MENUITEM "&Single step\tSpace", IDM_SINGLESTEP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About...\tF1", IDM_ABOUT
|
||||
MENUITEM "&Change device...\tF2", IDM_CHANGEDEVICE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit\tESC", IDM_EXIT
|
||||
END
|
||||
END
|
||||
|
||||
IDR_POPUP MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "Popup"
|
||||
BEGIN
|
||||
MENUITEM "&Go/stop", IDM_TOGGLESTART
|
||||
MENUITEM "&Single step", IDM_SINGLESTEP
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "&About...", IDM_ABOUT
|
||||
MENUITEM "&Change device...", IDM_CHANGEDEVICE
|
||||
MENUITEM SEPARATOR
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
270
Library/dxx8/samples/Multimedia/Demos/DMBoids/flock.cpp
Normal file
270
Library/dxx8/samples/Multimedia/Demos/DMBoids/flock.cpp
Normal file
@@ -0,0 +1,270 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Flock.cpp
|
||||
//
|
||||
// Desc:
|
||||
//
|
||||
// Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <D3DX8.h>
|
||||
#include <stdio.h>
|
||||
#include "DXUtil.h"
|
||||
#include "boids.h"
|
||||
#include "music.h"
|
||||
|
||||
const float g_fInfluenceRadius = 10.0f; // outside of this range forces are considered to be 0
|
||||
|
||||
const float CollisionFraction = 0.8f;
|
||||
const float InvCollisionFraction = 1.0f/(1.0f-CollisionFraction);
|
||||
|
||||
const float g_fNormalSpeed = 0.1f;
|
||||
const float AngleTweak = 0.02f;
|
||||
const float g_fPitchToSpeedRatio = 0.002f;
|
||||
|
||||
// More arbitray constants that look cool
|
||||
const float fSeparationScale = 0.05f;
|
||||
const float fAlignmentScale = 0.1f;
|
||||
const float fCohesionScale = 1.0f;
|
||||
const float fMigratoryScale = 0.4f;
|
||||
const float fObstacleScale = 1.0f;
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Effects
|
||||
//-----------------------------------------------------------------------------
|
||||
extern BoidMusic g_Music;
|
||||
extern BOOL g_bSeparation;
|
||||
extern BOOL g_bAlignment;
|
||||
extern BOOL g_bCohesion;
|
||||
extern BOOL g_bMigratory;
|
||||
extern BOOL g_bObstacle;
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
VOID CFlock::Update( FLOAT fElapsedTime )
|
||||
{
|
||||
DWORD i, j;
|
||||
static DWORD lastobj = 0xffffffff;
|
||||
|
||||
// First, update the dist array 0.0..1.0 with 0.0 being furthest away
|
||||
for( i=0; i<m_dwNumBoids; i++ )
|
||||
{
|
||||
for( j=i+1; j<m_dwNumBoids; j++ )
|
||||
{
|
||||
D3DXVECTOR3 vDiff = m_Boids[i].vPos - m_Boids[j].vPos;
|
||||
FLOAT fDist = D3DXVec3Length( &vDiff );
|
||||
m_afDist[i][j] = m_afDist[j][i] = fDist;
|
||||
}
|
||||
m_afDist[i][i] = 0.0f;
|
||||
|
||||
// Reset boid forces
|
||||
m_Boids[i].vSeparationForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
m_Boids[i].vAlignmentForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
m_Boids[i].vCohesionForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
m_Boids[i].vMigratoryForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
m_Boids[i].vObstacleForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
m_Boids[i].dwNumNeighbors = 0;
|
||||
}
|
||||
|
||||
// For each boid calculate the individual forces affecting it
|
||||
for( i=0; i<m_dwNumBoids; i++ )
|
||||
{
|
||||
// Add in effects from other boids
|
||||
for( j=i+1; j<m_dwNumBoids; j++ )
|
||||
{
|
||||
D3DXVECTOR3 vDiff = m_Boids[i].vPos - m_Boids[j].vPos;
|
||||
FLOAT fDist = D3DXVec3Length( &vDiff );
|
||||
|
||||
// if i is near j have them influence each other
|
||||
if( fDist < g_fInfluenceRadius )
|
||||
{
|
||||
// Sum seperation force
|
||||
m_Boids[i].vSeparationForce += vDiff/(fDist*fDist);
|
||||
m_Boids[j].vSeparationForce -= vDiff/(fDist*fDist);
|
||||
|
||||
// sum alignment force (actually summing the directions of the neighbors)
|
||||
m_Boids[i].vAlignmentForce += m_Boids[j].vDir / fDist;
|
||||
m_Boids[j].vAlignmentForce += m_Boids[i].vDir / fDist;
|
||||
|
||||
// sum cohesion force (actually we're summing neighbor locations)
|
||||
m_Boids[i].vCohesionForce += m_Boids[j].vPos;
|
||||
m_Boids[j].vCohesionForce += m_Boids[i].vPos;
|
||||
|
||||
m_Boids[i].dwNumNeighbors++;
|
||||
m_Boids[j].dwNumNeighbors++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add in any obstacle forces
|
||||
for( j=0; j<m_dwNumObstacles; j++ )
|
||||
{
|
||||
D3DXVECTOR3 vDiff = m_Boids[i].vPos - m_Obstacles[j].vPos;
|
||||
FLOAT fObRadius = m_Obstacles[j].fRadius * 1.5f;
|
||||
|
||||
// Ignore object if already past
|
||||
if( D3DXVec3Dot( &vDiff, &m_Boids[i].vDir ) > 0.0f )
|
||||
continue;
|
||||
|
||||
FLOAT fDist = D3DXVec3Length( &vDiff ) - fObRadius;
|
||||
|
||||
if( fDist < g_fInfluenceRadius )
|
||||
{
|
||||
if( ( lastobj != j ) && ( fDist < 5.0f ) )
|
||||
{
|
||||
lastobj = j;
|
||||
g_Music.Transition();
|
||||
}
|
||||
vDiff /= fDist; // normalize
|
||||
|
||||
fDist -= fObRadius;
|
||||
if( fDist < 0.01f )
|
||||
fDist = 0.01f;
|
||||
|
||||
m_Boids[i].vObstacleForce += vDiff;
|
||||
}
|
||||
}
|
||||
|
||||
// Find cohesion force
|
||||
if( m_Boids[i].dwNumNeighbors )
|
||||
{
|
||||
m_Boids[i].vCohesionForce /= (FLOAT)m_Boids[i].dwNumNeighbors; // Find average location of neighbors
|
||||
D3DXVECTOR3 vDiff = m_Boids[i].vCohesionForce - m_Boids[i].vPos; // Find delta to center of flock
|
||||
FLOAT fMag = D3DXVec3Length( &vDiff );
|
||||
|
||||
if( fMag > 0.0f)
|
||||
m_Boids[i].vCohesionForce = vDiff/fMag; // normalized
|
||||
else
|
||||
m_Boids[i].vCohesionForce = D3DXVECTOR3( 0.0f, 0.0f, 0.0f );
|
||||
}
|
||||
|
||||
// Find the alignment force
|
||||
if( m_Boids[i].dwNumNeighbors != 0 )
|
||||
{
|
||||
m_Boids[i].vAlignmentForce /= (FLOAT)m_Boids[i].dwNumNeighbors;
|
||||
FLOAT fMag = D3DXVec3Length( &m_Boids[i].vAlignmentForce );
|
||||
|
||||
if( fMag > 0.0f )
|
||||
{
|
||||
m_Boids[i].vAlignmentForce /= fMag; // normalize
|
||||
|
||||
D3DXVECTOR3 vDiff = m_Boids[i].vAlignmentForce - m_Boids[i].vDir;
|
||||
|
||||
m_Boids[i].vAlignmentForce = vDiff / fMag;
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, the migratory force
|
||||
m_Boids[i].vMigratoryForce = m_vGoal - m_Boids[i].vPos;
|
||||
D3DXVec3Normalize( &m_Boids[i].vMigratoryForce, &m_Boids[i].vMigratoryForce );
|
||||
}
|
||||
|
||||
// Update the boids
|
||||
for( i=0; i<m_dwNumBoids; i++ )
|
||||
{
|
||||
// Sum all the forces
|
||||
D3DXVECTOR3 vForce( 0.0f, 0.0f, 0.0f );
|
||||
if( !g_bObstacle ) vForce += m_Boids[i].vObstacleForce;
|
||||
if( !g_bSeparation ) vForce += m_Boids[i].vSeparationForce;
|
||||
if( !g_bAlignment ) vForce += m_Boids[i].vAlignmentForce * fAlignmentScale;
|
||||
if( !g_bCohesion ) vForce += m_Boids[i].vCohesionForce;
|
||||
if( !g_bMigratory ) vForce += m_Boids[i].vMigratoryForce;
|
||||
|
||||
// Ok, now we have a final force to apply to the boid.
|
||||
// Normalize it if too big.
|
||||
FLOAT mag = D3DXVec3Length( &vForce );
|
||||
if( mag > 1.0f )
|
||||
vForce /= mag;
|
||||
|
||||
// first deal with pitch changes
|
||||
if( vForce.y > 0.01f )
|
||||
{ // we're too low
|
||||
m_Boids[i].pitch += AngleTweak;
|
||||
if (m_Boids[i].pitch > 0.8f)
|
||||
m_Boids[i].pitch = 0.8f;
|
||||
}
|
||||
else if( vForce.y < -0.01f )
|
||||
{ // we're too high
|
||||
m_Boids[i].pitch -= AngleTweak;
|
||||
if (m_Boids[i].pitch < -0.8f)
|
||||
m_Boids[i].pitch = -0.8f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// add damping
|
||||
m_Boids[i].pitch *= 0.98f;
|
||||
}
|
||||
|
||||
// speed up or slow down depending on angle of attack
|
||||
m_Boids[i].speed -= m_Boids[i].pitch * g_fPitchToSpeedRatio;
|
||||
// damp back to normal
|
||||
m_Boids[i].speed = (m_Boids[i].speed-g_fNormalSpeed)*0.99f + g_fNormalSpeed;
|
||||
|
||||
// limit speed changes to +- 50% from normal
|
||||
if( m_Boids[i].speed < g_fNormalSpeed/2 )
|
||||
m_Boids[i].speed = g_fNormalSpeed/2;
|
||||
if( m_Boids[i].speed > g_fNormalSpeed*5 )
|
||||
m_Boids[i].speed = g_fNormalSpeed*5;
|
||||
|
||||
// now figure out yaw changes
|
||||
D3DXVECTOR3 vOffset = vForce;
|
||||
vOffset.y = 0.0f;
|
||||
D3DXVECTOR3 vDelta = m_Boids[i].vDir;
|
||||
|
||||
if( D3DXVec3Length( &vOffset ) > 0.0f )
|
||||
D3DXVec3Normalize( &vOffset, &vOffset );
|
||||
|
||||
float dot = D3DXVec3Dot( &vOffset, &vDelta );
|
||||
// speed up slightly if not turning much
|
||||
if (dot > 0.7f)
|
||||
{
|
||||
dot -= 0.7f;
|
||||
m_Boids[i].speed += dot * 0.005f;
|
||||
}
|
||||
D3DXVec3Cross( &vOffset, &vOffset, &vDelta );
|
||||
// D3DXVec3Cross( &vOffset, &vDelta, &vOffset );
|
||||
dot = (1.0f-dot)/2.0f * 0.07f;
|
||||
if( vOffset.y > 0.05f )
|
||||
{
|
||||
m_Boids[i].dyaw = (m_Boids[i].dyaw*19.0f + dot) * 0.05f;
|
||||
}
|
||||
else if( vOffset.y < -0.05f )
|
||||
{
|
||||
m_Boids[i].dyaw = (m_Boids[i].dyaw*19.0f - dot) * 0.05f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Boids[i].dyaw *= 0.98f; // damp it
|
||||
}
|
||||
m_Boids[i].yaw += m_Boids[i].dyaw;
|
||||
m_Boids[i].roll = -m_Boids[i].dyaw * 20.0f;
|
||||
|
||||
// Take new info and create a new world matrix
|
||||
// First translate into place, then set orientation, then scale (if needed)
|
||||
D3DXMATRIX matTrans, matRotateX, matRotateY, matRotateZ, matTemp1, matTemp2;
|
||||
D3DXMatrixTranslation( &matTrans, m_Boids[i].vPos.x, m_Boids[i].vPos.y, m_Boids[i].vPos.z );
|
||||
D3DXMatrixRotationX( &matRotateX, -m_Boids[i].pitch );
|
||||
D3DXMatrixRotationY( &matRotateY, -m_Boids[i].yaw );
|
||||
D3DXMatrixRotationZ( &matRotateZ, -m_Boids[i].roll );
|
||||
D3DXMatrixMultiply( &matTemp1, &matRotateX, &matRotateY );
|
||||
D3DXMatrixMultiply( &matTemp2, &matRotateZ, &matTemp1 );
|
||||
D3DXMatrixMultiply( &m_Boids[i].matWorld, &matTemp2, &matTrans );
|
||||
|
||||
// Now extract the boid's direction out of the matrix
|
||||
m_Boids[i].vDir.x = m_Boids[i].matWorld._31;
|
||||
m_Boids[i].vDir.y = m_Boids[i].matWorld._32;
|
||||
m_Boids[i].vDir.z = m_Boids[i].matWorld._33;
|
||||
|
||||
// And update the boid's location
|
||||
m_Boids[i].vPos += m_Boids[i].vDir * m_Boids[i].speed * 100 * fElapsedTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
1115
Library/dxx8/samples/Multimedia/Demos/DMBoids/music.cpp
Normal file
1115
Library/dxx8/samples/Multimedia/Demos/DMBoids/music.cpp
Normal file
File diff suppressed because it is too large
Load Diff
116
Library/dxx8/samples/Multimedia/Demos/DMBoids/music.h
Normal file
116
Library/dxx8/samples/Multimedia/Demos/DMBoids/music.h
Normal file
@@ -0,0 +1,116 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// File: Music.h
|
||||
//
|
||||
// Desc:
|
||||
//
|
||||
// Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved.
|
||||
//-----------------------------------------------------------------------------
|
||||
#ifndef MUSIC_H
|
||||
#define MUSIC_H
|
||||
|
||||
#include <windows.h>
|
||||
#include <dmusicc.h>
|
||||
#include <dmusici.h>
|
||||
|
||||
interface IDirectMusicStyle;
|
||||
interface IDirectMusicChordMap;
|
||||
interface IDirectMusicPerformance;
|
||||
interface IDirectMusicSegment;
|
||||
interface IDirectMusicComposer;
|
||||
interface IDirectMusicLoader;
|
||||
interface IDirectMusicGraph;
|
||||
interface IDirectMusicBand;
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
class CTool : public IDirectMusicTool
|
||||
{
|
||||
public:
|
||||
CTool();
|
||||
~CTool();
|
||||
|
||||
public:
|
||||
// IUnknown
|
||||
virtual STDMETHODIMP QueryInterface(const IID &iid, void **ppv);
|
||||
virtual STDMETHODIMP_(ULONG) AddRef();
|
||||
virtual STDMETHODIMP_(ULONG) Release();
|
||||
|
||||
// IDirectMusicTool
|
||||
HRESULT STDMETHODCALLTYPE Init(IDirectMusicGraph* pGraph) ;
|
||||
HRESULT STDMETHODCALLTYPE GetMsgDeliveryType(DWORD* pdwDeliveryType ) ;
|
||||
HRESULT STDMETHODCALLTYPE GetMediaTypeArraySize(DWORD* pdwNumElements ) ;
|
||||
HRESULT STDMETHODCALLTYPE GetMediaTypes(DWORD** padwMediaTypes, DWORD dwNumElements) ;
|
||||
HRESULT STDMETHODCALLTYPE ProcessPMsg(IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG) ;
|
||||
HRESULT STDMETHODCALLTYPE Flush(IDirectMusicPerformance* pPerf, DMUS_PMSG* pPMSG, REFERENCE_TIME rt) ;
|
||||
|
||||
long m_cRef;
|
||||
DWORD m_dwRatio;
|
||||
DWORD m_dwEcho;
|
||||
DWORD m_dwDelay;
|
||||
DWORD m_dwStartRatio;
|
||||
IDirectMusicPerformance * m_pPerformance;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Name:
|
||||
// Desc:
|
||||
//-----------------------------------------------------------------------------
|
||||
class BoidMusic
|
||||
{
|
||||
public:
|
||||
BoidMusic();
|
||||
~BoidMusic();
|
||||
HRESULT LoadMusic( HWND hWnd );
|
||||
BOOL LoadChordMap();
|
||||
BOOL LoadStyle();
|
||||
BOOL LoadSegment();
|
||||
HRESULT LoadDLS();
|
||||
BOOL LoadTemplate(DWORD dwIndex, WCHAR * pszName);
|
||||
BOOL GetMotif(DWORD dwIndex, WCHAR * pszName);
|
||||
void ComposeSegment(DWORD dwIndex);
|
||||
void EndMusic();
|
||||
void StartMusic();
|
||||
void Transition();
|
||||
void Collapse();
|
||||
void Expand();
|
||||
void Migrate();
|
||||
void HandleNotifies();
|
||||
void SetDistance(double fDistance);
|
||||
BOOL GetSearchPath(WCHAR path[MAX_PATH]);
|
||||
void Activate(BOOL bActive);
|
||||
IDirectMusicStyle* m_pStyle;
|
||||
IDirectMusicChordMap* m_pChordMap;
|
||||
IDirectMusicSegment* m_pTemplateSegments[6];
|
||||
IDirectMusicSegment* m_pPrimarySegments[6];
|
||||
IDirectMusicSegment* m_pTransitionSegment;
|
||||
IDirectMusicSegment* m_pMotifSegments[6];
|
||||
IDirectMusicSegment* m_pSegment;
|
||||
IDirectMusicComposer* m_pComposer;
|
||||
IDirectMusicLoader* m_pLoader;
|
||||
IDirectMusicPerformance* m_pPerformance;
|
||||
IDirectMusicGraph* m_pGraph;
|
||||
IDirectMusicPort* m_pPort;
|
||||
IDirectMusicBand* m_pBand;
|
||||
IDirectMusic* m_pDMusic;
|
||||
DWORD m_dwIndex;
|
||||
HANDLE m_hNotify;
|
||||
DWORD m_dwLevel;
|
||||
CTool m_Tool;
|
||||
BOOL m_dwBeatsSinceLastMotif;
|
||||
BOOL m_fCollapsed;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
58
Library/dxx8/samples/Multimedia/Demos/DMBoids/readme.txt
Normal file
58
Library/dxx8/samples/Multimedia/Demos/DMBoids/readme.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Sample Name: DMBoids Sample
|
||||
//
|
||||
// Copyright <20> 1999-2001 Microsoft Corp. All Rights Reserved.
|
||||
//
|
||||
// GM/GS<47> Sound Set Copyright <20>1996, Roland Corporation U.S.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Description
|
||||
===========
|
||||
DMBoids is a version of Boids that adds DirectMusic support. As objects fly
|
||||
over a simple landscape, the music responds to user input and events on the
|
||||
screen.
|
||||
|
||||
Path
|
||||
====
|
||||
Source: DXSDK\Samples\Multimedia\Dmusic\DMBoids
|
||||
|
||||
Executable: DXSDK\Samples\Multimedia\DMusic\Bin
|
||||
|
||||
User's Guide
|
||||
============
|
||||
Press F10 to access the main menu. The Drivers menu allows you to change the
|
||||
driver, device, and video mode. The application runs only in full-screen
|
||||
modes.
|
||||
|
||||
The A (alignment), C (cohesion) and O (obstacle) keys alter behavior of the
|
||||
boids in various ways as long as they are held down.
|
||||
|
||||
Hold down the S key or the spacebar and the birds flock in closer. Release
|
||||
the key and they spread apart. Note the use of motifs to track this
|
||||
behavior.
|
||||
|
||||
Hold down the M key and the birds wander off their path. Notice that the
|
||||
music completely changes. Release and the birds will eventually get back on
|
||||
the path.
|
||||
|
||||
Press the ESC key to quit.
|
||||
|
||||
Programming Notes
|
||||
=================
|
||||
DirectMusic features illustrated include the following:
|
||||
Software synthesis with DLS. In addition to the musical instruments
|
||||
from the GS sound set, the application uses custom downloadable sounds
|
||||
such as the voices that appear to come from the planets.
|
||||
|
||||
Composing and performing style-based segments.
|
||||
|
||||
Musical transitions using style-based motifs and segment cues.
|
||||
|
||||
Echo/articulation tool coded that uses the proximity of the birds to
|
||||
adjust the echoes and note durations of the music as it plays.
|
||||
|
||||
|
||||
40
Library/dxx8/samples/Multimedia/Demos/DMBoids/resource.h
Normal file
40
Library/dxx8/samples/Multimedia/Demos/DMBoids/resource.h
Normal file
@@ -0,0 +1,40 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by WinMain.rc
|
||||
//
|
||||
#define IDI_MAIN_ICON 101
|
||||
#define IDR_MAIN_ACCEL 113
|
||||
#define IDR_MENU 141
|
||||
#define IDR_POPUP 142
|
||||
#define IDD_ABOUT 143
|
||||
#define IDD_CHANGEDEVICE 144
|
||||
#define IDD_SELECTDEVICE 144
|
||||
#define IDC_DEVICE_COMBO 1000
|
||||
#define IDC_MODE_COMBO 1001
|
||||
#define IDC_ADAPTER_COMBO 1002
|
||||
#define IDC_FULLSCREENMODES_COMBO 1003
|
||||
#define IDC_STEREOMODES_COMBO 1004
|
||||
#define IDC_WINDOWED_CHECKBOX 1012
|
||||
#define IDC_STEREO_CHECKBOX 1013
|
||||
#define IDC_FULLSCREEN_TEXT 1014
|
||||
#define IDC_WINDOW 1016
|
||||
#define IDC_STEREO 1017
|
||||
#define IDC_FULLSCREEN 1018
|
||||
#define IDM_ABOUT 40001
|
||||
#define IDM_CHANGEDEVICE 40002
|
||||
#define IDM_TOGGLEFULLSCREEN 40003
|
||||
#define IDM_TOGGLESTART 40004
|
||||
#define IDM_SINGLESTEP 40005
|
||||
#define IDM_EXIT 40006
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_3D_CONTROLS 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 146
|
||||
#define _APS_NEXT_COMMAND_VALUE 40011
|
||||
#define _APS_NEXT_CONTROL_VALUE 1027
|
||||
#define _APS_NEXT_SYMED_VALUE 102
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user