[1378] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | #include<vector> // Standard-Vektor einschließen
|
---|
| 4 | #include "GameScene.h"
|
---|
| 5 | #include "MenueScene.h"
|
---|
| 6 | #include <string>
|
---|
| 7 | #include "PhysXOutputStream.h"
|
---|
| 8 | #include "UserAllocator.h"
|
---|
| 9 | #include "ResourceManager.h"
|
---|
| 10 |
|
---|
| 11 | using namespace std;
|
---|
| 12 |
|
---|
| 13 | class Scene;
|
---|
| 14 | class Node;
|
---|
| 15 |
|
---|
| 16 | #define SPTR boost::shared_ptr
|
---|
| 17 |
|
---|
| 18 | class GameManager
|
---|
| 19 | {
|
---|
| 20 | public:
|
---|
| 21 | GameManager(void);
|
---|
| 22 | ~GameManager(void);
|
---|
| 23 |
|
---|
| 24 | int init(void);
|
---|
| 25 |
|
---|
| 26 | void printToConsole (std::string output);
|
---|
| 27 | void addScene(Scene &newScene);
|
---|
| 28 | void removeScene (Scene &oldScene);
|
---|
| 29 | void setActiveScene(Scene &aScene);
|
---|
| 30 | void switchToMenueScene();
|
---|
| 31 | void switchToGameScene();
|
---|
| 32 |
|
---|
| 33 | void keyPressed(UINT nChar, bool bKeyDown, bool bAltDown, void* pUserContext);
|
---|
| 34 | void setMouseStatus(bool bLeftButtonDown, bool bRightButtonDown,bool bMiddleButtonDown,
|
---|
| 35 | bool bSideButton1Down, bool bSideButton2Down, int nMouseWheelDelta,
|
---|
| 36 | int xPos, int yPos);
|
---|
| 37 |
|
---|
| 38 | void updateGame(float fElapsedTime);
|
---|
| 39 | void initGame();
|
---|
[1389] | 40 |
|
---|
| 41 | std::wstring HelpScreenString_Get();
|
---|
| 42 |
|
---|
[1378] | 43 | ID3DXEffect* getEffect(UINT id);
|
---|
| 44 | ID3DXEffect* loadEffect(UINT id, LPCWSTR filename);
|
---|
| 45 | void releaseEffect(ID3DXEffect* effect);
|
---|
| 46 |
|
---|
| 47 | void OnLostDevice( void* pUserContext );
|
---|
| 48 | void OnDestroyDevice( void* pUserContext );
|
---|
| 49 | HRESULT OnCreateDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext );
|
---|
| 50 | HRESULT OnResetDevice( IDirect3DDevice9* pd3dDevice, const D3DSURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext );
|
---|
| 51 | void OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext );
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | //PhysicSDK
|
---|
| 55 | NxPhysicsSDK* pPhysicsSDK;
|
---|
| 56 | UserAllocator* pAllocator;
|
---|
| 57 |
|
---|
| 58 | void setScreenDimension(int width, int height);
|
---|
| 59 |
|
---|
| 60 | ResourceManager resManager;
|
---|
| 61 |
|
---|
| 62 | int screenWidth;
|
---|
| 63 | int screenHeight;
|
---|
| 64 |
|
---|
| 65 | MenueScene ms; // Menue Scene
|
---|
| 66 | GameScene gs; // GameScene
|
---|
| 67 |
|
---|
| 68 | //EffectConstants
|
---|
| 69 | static const UINT EFFECT_FADE = 0;
|
---|
| 70 | static const UINT EFFECT_RAYTRACE = 1;
|
---|
| 71 | static const UINT EFFECT_DEPTHIMP = 2;
|
---|
| 72 | static const UINT EFFECT_SIMPLEMESH = 3;
|
---|
| 73 | static const UINT EFFECT_TERRAIN = 4;
|
---|
| 74 | static const UINT EFFECT_OCEAN = 5;
|
---|
| 75 |
|
---|
| 76 | friend class Scene;
|
---|
| 77 | protected:
|
---|
| 78 | Scene* activeScene;
|
---|
| 79 | std::vector<Scene *> sceneVector;
|
---|
| 80 | bool consoleStarted;
|
---|
| 81 | HANDLE outputHandle;
|
---|
| 82 |
|
---|
| 83 | PhysXOutputStream pOutputStream;
|
---|
| 84 |
|
---|
| 85 | //Effect vector
|
---|
| 86 | static const int NB_EFFECTS = 100;
|
---|
| 87 | ID3DXEffect* effectList[NB_EFFECTS];
|
---|
| 88 | int effectReleaseCount[NB_EFFECTS];
|
---|
| 89 |
|
---|
| 90 | bool firstFrame;
|
---|
| 91 | IDirect3DSurface9* finalRenderTarget;
|
---|
| 92 | IDirect3DDevice9* device;
|
---|
| 93 | ID3DXEffect* fadeEffect;
|
---|
| 94 | };
|
---|