Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Class definition -------------------------------------------------------------------
- class Window
- {
- public:
- // Describes a Window object
- struct Description
- {
- // Window defaults
- String caption = "Window";
- UInt width = 640;
- UInt height = 480;
- Float near = 0.01f;
- Float far = 1000.0f;
- Texture::Format format = Texture::Format::RGBA8UNorm;
- bool fullscreen = 0;
- bool vsync = 0;
- };
- // Constructors
- Window();
- Window(const Window&) {};
- ~Window() {};
- //Methods
- bool Create(Window::Description);
- void Set();
- void Shutdown();
- //--//
- bool Resize(Float, Float);
- void Clear(Float4);
- inline void Clear(Float red, Float green, Float blue, Float alpha) { Clear(Float4(red, green, blue, alpha)); };
- void Finish();
- // Methods
- const Matrix& GetProjectionMatrix();
- const Matrix& GetOrthoMatrix();
- //--//
- void GetVideoCardInfo(char*, Int&);
- // Window stuff
- Matrix Projection;
- UInt Width, Height;
- // D3D stuff
- Device* Device;
- DeviceContext* DeviceContext;
- // Global singleton module handle
- static Window* Singleton;
- private:
- bool mVsyncEnabled;
- bool mFullscreen;
- UInt mWindowWidth, mWindowHeight;
- //--//
- HINSTANCE mHINSTANCE;
- String mApplicationName;
- HWND mHWND;
- //--//
- IDXGISwapChain* mSwapChain;
- ID3D11RenderTargetView* mRenderTargetView;
- ID3D11Texture2D* mDepthStencilBuffer;
- ID3D11DepthStencilState* mDepthStencilState;
- ID3D11DepthStencilView* mDepthStencilView;
- ID3D11RasterizerState* mRasterState;
- UInt mVideoCardMemory;
- char mVideoCardDescription[128];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement