home *** CD-ROM | disk | FTP | other *** search
- /*
- Company: Sensaura
- Copyright: (C) 1999
-
- Software Project: Sensaura DirectSound3D Demo
- File Name: dxworld.h
- File Description: Header file for definition of DirectXWorld class
- Author: Adam Philp
- File Version: 1.02.000
- Last Update: 11-FEB-99
-
- Target Compiler: Microsoft Visual C++ Version 5.0
- */
-
- #ifndef __dxworld_h // Sentry, use file only if it's not already included
- #define __dxworld_h
-
- /////////////////////// Included files ////////////////////////////////////////////////////////////
-
- #include "cd3drm.h" // Direct3DRM support class
- #include "cdsnd3d.h" // DirectSound3D support class
- #include "cdinput.h" // DirectInput support class
-
- /////////////////////// Constants /////////////////////////////////////////////////////////////////
-
- /////////////////////// Class declarations ////////////////////////////////////////////////////////
-
- /*
- Class: DirectXWorld
- Description: The main DirectX part of the application. The DirectXWorld class itself
- implements the logic of the demo - when objects are created, how they move
- around etc, what happens when the user does something etc. To support
- different bits of DirectX, use the appropriate DirectXXXXObject class as a
- base class
- */
-
- class DirectXWorld :
- public Direct3DRMObject, // We want Direct3DRM support for the graphics
- public DirectSound3DObject, // We want DirectSound3D support for the audio
- public DirectInputObject // We want DirectInput support for the keyboard
- {
- public: // Public constructor & destructor
- DirectXWorld(HINSTANCE);
- virtual ~DirectXWorld();
-
- public: // Public member functions
- bool Create(HWND);
- bool Update();
- bool Resize(int, int);
- bool SetDirectSound(DIRECTSOUND3DTYPE);
- bool SetSpeakerConfig(DWORD);
- bool CreateObject(DWORD);
- void DestroyObject(DWORD);
-
- public: // Public data members
- LPDIRECT3DRMFRAME2 m_pCamera;
- LPDIRECT3DRMVIEWPORT m_pView;
- D3DRMObjectList m_Objects;
- D3DVALUE m_FrameRate;
- DWORD m_dwFlags;
- D3DVALUE m_XTurnVelocity;
- D3DVALUE m_YVelocity;
- D3DVALUE m_ZVelocity;
-
- protected: // Protected data members
- HINSTANCE m_hInstance;
- DWORD m_dwTime;
- bool m_bFirstUpdate;
-
- private: // Private member functions
- bool LoadDirectXObjects();
- void ReleaseDirectXObjects();
-
- bool CreateViewer();
- bool CreateLights();
- bool CreateEnvironment();
- bool CreateObjects();
- bool Reset();
- void DestroyObjects();
-
- bool CreateGlobe();
- bool CreateSaucer();
- bool CreateMeteor();
- bool CreateExplosion(LPD3DVECTOR, DWORD);
- void DestroyExplosion(DWORD);
-
- D3DVALUE UpdateTime();
- bool UpdateScene(D3DVALUE);
- bool UpdateInput();
- bool UpdateObjects(D3DVALUE);
- bool DestroyDeadObjects();
- bool CheckCollisions(D3DVALUE);
- bool MoveObjects(D3DVALUE);
- bool UpdateViewer(D3DVALUE);
-
- void TurnX(D3DVALUE);
- void MoveY(D3DVALUE);
- void MoveZ(D3DVALUE);
- bool Fire();
-
- bool HitCamera(LPD3DRMOBJECT, D3DVALUE);
- LPD3DRMNODE HitObject(LPD3DRMOBJECT, D3DVALUE);
-
- private: // Private data members
- LPDIRECT3DRMMESHBUILDER2 m_pGlobeBuilder;
- LPDIRECT3DRMMESHBUILDER2 m_pSaucerBuilder;
- LPDIRECT3DRMMESHBUILDER2 m_pMeteorBuilder;
- LPDIRECT3DRMMESHBUILDER2 m_pBulletBuilder;
- LPDIRECT3DRMMESHBUILDER2 m_pExplosionBuilder;
- };
-
- typedef DirectXWorld* LPDIRECTXWORLD;
-
- #endif // End of sentry __dxworld_h
-