C++ Game Framework  2013-06-04
CGF is a DirectX 11 game framework, built in C++ and DirectX 11. This is used to contain many to the DirectX functionality and wrap them into a framework to make game development easier.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
GraphicsDevice.h
Go to the documentation of this file.
1 // Filename: GraphicsDevice.h
4 
5 //Preprocessor directive designed to cause the current source file to be included only once in a single compilation
6 #pragma once
7 
8 //Includes
9 #include "D3DManager.h"
10 #include "Camera.h"
11 #include "ColorShader.h"
12 #include "TextureShader.h"
13 #include "CGFInclude.h"
14 #include "IGraphicsObject.h"
15 #include "CGFException.h"
16 #include "Texture.h"
17 #include "FontShader.h"
18 
19 //Globals
20 #define SCREEN_DEPTH 1000.0f
21 #define SCREEN_NEAR 0.1f
22 
23 namespace CGF
24 {
26  {
27  friend class GameEngine;
28 
29  public:
30  void Draw(IGraphicsObject* drawable);
31 
32  ID3D11Device* GetD3DXDevice();
33  D3DManager* GetD3DManager();
34  XMMATRIX GetProjectionMatrix();
35  XMMATRIX GetWorldMatrix();
36  XMMATRIX GetOrthoMatrix();
37  Vector2f GetScreenDimensions();
38 
39  private:
41  ~GraphicsDevice();
42 
43  bool Initialize(int screenWidth, int screenHeight, const bool isVSyncEnabled, bool isFullscreen, HWND hwnd);
44  void Shutdown();
45  bool Frame();
46 
47  private:
48  bool PreRender();
49  bool PostRender();
50 
51  private:
52  D3DManager* m_d3dManager;
53  Camera* m_camera;
55  ColorShader* m_colorShader;
56  TextureShader* m_textureShader;
57  FontShader* m_fontShader;
59  int m_screenWidth;
60  int m_screenHeight;
62  XMMATRIX m_worldMatrix;
63  XMMATRIX m_viewMatrix;
64  XMMATRIX m_projectionMatrix;
65  XMMATRIX m_baseViewMatrix;
66  };
67 }