Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #ifndef __SP_RENDERCONTEXT_DIRECT3D11_H__
00009 #define __SP_RENDERCONTEXT_DIRECT3D11_H__
00010 
00011 
00012 #include "Base/spStandard.hpp"
00013 
00014 #if defined(SP_COMPILE_WITH_DIRECT3D11)
00015 
00016 
00017 #include "RenderSystem/spDesktopRenderContext.hpp"
00018 
00019 #include <d3d11.h>
00020 #include <d3dx11.h>
00021 
00022 
00023 namespace sp
00024 {
00025 namespace video
00026 {
00027 
00028 
00030 class SP_EXPORT Direct3D11RenderContext : public DesktopRenderContext
00031 {
00032     
00033     public:
00034         
00035         Direct3D11RenderContext();
00036         ~Direct3D11RenderContext();
00037         
00038         
00039         
00040         bool openGraphicsScreen(
00041             void* ParentWindow, const dim::size2di &Resolution, const io::stringc &Title,
00042             s32 ColorDepth, bool isFullscreen, const SDeviceFlags &Flags
00043         );
00044         void closeGraphicsScreen();
00045         
00046         void flipBuffers();
00047         
00048         void setVsync(bool Enable);
00049         
00050     private:
00051         
00052         
00053         
00054         bool createRenderContext();
00055         void releaseRenderContext();
00056         
00057         
00058         
00059         IDXGISwapChain* SwapChain_;
00060         ID3D11Texture2D* BackBuffer_;
00061         
00062         ID3D11Device* D3DDevice_;
00063         ID3D11DeviceContext* D3DDeviceContext_;
00064         
00065         ID3D11RenderTargetView* RenderTargetView_;
00066         ID3D11Texture2D* DepthStencil_;
00067         ID3D11DepthStencilView* DepthStencilView_;
00068         
00069         u32 SyncInterval_;
00070         
00071 };
00072 
00073 
00074 } 
00075 
00076 } 
00077 
00078 
00079 #endif
00080 
00081 #endif
00082 
00083 
00084 
00085