#ifndef XNA_GRAPHICS_DEVICE_HPP #define XNA_GRAPHICS_DEVICE_HPP #include "../default.hpp" #include "presentparams.hpp" namespace xna { //Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. class GraphicsDevice : public std::enable_shared_from_this { public: GraphicsDevice(); GraphicsDevice(GraphicsDeviceInformation const& info); GraphicsDevice(sptr const& adapter, GraphicsProfile const& graphicsProfile, sptr const& presentationParameters); //Gets the graphics adapter. sptr Adapter() const; //Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque. sptr BlendState() const; //Gets or sets a system-defined instance of a blend state object initialized for alpha blending. The default value is BlendState.Opaque. void BlendState(sptr const& value); //Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default. sptr DepthStencilState() const; //Gets or sets a system-defined instance of a depth-stencil state object. The default value is DepthStencilState.Default. void DepthStencilState(sptr const& value); //Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise. sptr RasterizerState() const; //Gets or sets rasterizer state. The default value is RasterizerState.CullCounterClockwise. void RasterizerState(sptr const& value); //Retrieves a collection of SamplerState objects for the current GraphicsDevice. sptr SamplerStates() const; //Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff). Int MultiSampleMask() const; //Gets or sets a bitmask controlling modification of the samples in a multisample render target. The default value is -1 (0xffffffff). void MultiSampleMask(Int value); constexpr GraphicsProfile Profile() const { return GraphicsProfile::HiDef; } constexpr PresentationParameters PresentParameters() const { return PresentationParameters(); } void Clear(Color const& color); void Clear(ClearOptions options, Color const& color, float depth, Int stencil); void Clear(ClearOptions options, Vector4 const& color, float depth, Int stencil); bool Initialize(); bool Present(); void Reset(sptr const& presentationParameters, sptr const& graphicsAdapter); xna::Viewport Viewport() const; void Viewport(xna::Viewport const& viewport); void UseVSync(bool use); //void DrawPrimitives(PrimitiveType primitiveType, Int startVertex, Int primitiveCount); public: struct PlatformImplementation; uptr impl = nullptr; }; using PGraphicsDevice = sptr; } #endif