Advertisement
Ember

wiundowblxah

May 15th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.73 KB | None | 0 0
  1. // Class definition -------------------------------------------------------------------
  2. class Window
  3. {
  4. public:
  5.     // Describes a Window object
  6.     struct Description
  7.     {
  8.         // Window defaults
  9.         String caption = "Window";
  10.         UInt width = 640;
  11.         UInt height = 480;
  12.         Float near = 0.01f;
  13.         Float far = 1000.0f;
  14.         Texture::Format format = Texture::Format::RGBA8UNorm;
  15.         bool fullscreen = 0;
  16.         bool vsync = 0;
  17.     };
  18.  
  19.     // Constructors
  20.     Window();
  21.     Window(const Window&) {};
  22.     ~Window() {};
  23.  
  24.     //Methods
  25.     bool Create(Window::Description);
  26.     void Set();
  27.     void Shutdown();
  28.     //--//
  29.     bool Resize(Float, Float);
  30.     void Clear(Float4);
  31.     inline void Clear(Float red, Float green, Float blue, Float alpha) { Clear(Float4(red, green, blue, alpha)); };
  32.     void Finish();
  33.  
  34.     // Methods
  35.     const Matrix& GetProjectionMatrix();
  36.     const Matrix& GetOrthoMatrix();
  37.     //--//
  38.     void GetVideoCardInfo(char*, Int&);
  39.  
  40.     // Window stuff
  41.     Matrix Projection;
  42.     UInt Width, Height;
  43.     // D3D stuff
  44.     Device* Device;
  45.     DeviceContext* DeviceContext;
  46.     // Global singleton module handle
  47.     static Window* Singleton;
  48.  
  49. private:
  50.     bool mVsyncEnabled;
  51.     bool mFullscreen;
  52.     UInt mWindowWidth, mWindowHeight;
  53.     //--//
  54.     HINSTANCE mHINSTANCE;
  55.     String mApplicationName;
  56.     HWND mHWND;
  57.     //--//
  58.     IDXGISwapChain* mSwapChain;
  59.     ID3D11RenderTargetView* mRenderTargetView;
  60.     ID3D11Texture2D* mDepthStencilBuffer;
  61.     ID3D11DepthStencilState* mDepthStencilState;
  62.     ID3D11DepthStencilView* mDepthStencilView;
  63.     ID3D11RasterizerState* mRasterState;
  64.     UInt mVideoCardMemory;
  65.     char mVideoCardDescription[128];
  66. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement