#ifndef DEVICE_H_ #define DEVICE_H_ #include #include #include #define RELEASE(x) if(x != 0){ x->Release(); x = 0; } class Shader; class RenderUnit; /* CLASS Device */ class Device { protected: ID3D10Device* pDevice; private: ID3D10RenderTargetView* pRenderTargetView; ID3D10DepthStencilView* pDepthStencilView; IDXGISwapChain* pSwapChain; BOOL bDeviceActive; struct _states { BOOL bReady; BOOL bCleared; } sStates; public: Device ( void ); ~Device ( void ); void Invalidate ( void ); bool Create ( HWND hOutput, HINSTANCE hInstance, unsigned uiWidth, unsigned uiHeight ); void Destroy ( void ); void Render ( void ); /* RENDER TARGET OPTIONS */ void RTClear ( float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 0.0f ); void RTPresent ( void ); /* PROTECTED CLASSES */ Shader* LoadShader ( LPCSTR Filename ); RenderUnit* CreateRenderUnit ( void ); protected: bool CreateDS ( void ); bool CreateRT ( void ); void SetViewport ( float min_depth, float max_depth, unsigned uiWidth, unsigned uiHeight ); } /* class Device */; #endif /* DEVICE_H_ */