diff --git a/includes/xna/graphics/adapter.hpp b/includes/xna/graphics/adapter.hpp index 2d285c6..62498e7 100644 --- a/includes/xna/graphics/adapter.hpp +++ b/includes/xna/graphics/adapter.hpp @@ -1,7 +1,6 @@ #ifndef XNA_GRAPHICS_ADAPTER_HPP #define XNA_GRAPHICS_ADAPTER_HPP -#include "../platform.hpp" #include "displaymode.hpp" #include #include @@ -12,7 +11,7 @@ namespace xna { struct GraphicsAdapterImplementation; //Provides methods to retrieve and manipulate graphics adapters. - class GraphicsAdapter : public PlatformImplementation { + class GraphicsAdapter { public: //Collection of available adapters on the system. static void Adapters(std::vector>& adapters); @@ -81,6 +80,8 @@ namespace xna { int32_t& selectedMultiSampleCount ) const; + std::unique_ptr Implementation; + private: std::string description; uint32_t deviceId{0}; diff --git a/includes/xna/graphics/blendstate.hpp b/includes/xna/graphics/blendstate.hpp index d9b7bf7..c36dad3 100644 --- a/includes/xna/graphics/blendstate.hpp +++ b/includes/xna/graphics/blendstate.hpp @@ -2,7 +2,6 @@ #define XNA_GRAPHICS_BLENDSTATE_HPP #include "../common/color.hpp" -#include "../platform.hpp" #include "gresource.hpp" #include #include @@ -104,7 +103,7 @@ namespace xna { struct BlendStateImplementation; //Contains blend state for the device. - class BlendState : public GraphicsResource, public PlatformImplementation { + class BlendState : public GraphicsResource { public: BlendState(); BlendState(std::shared_ptr const& device); @@ -168,6 +167,8 @@ namespace xna { //A built-in state object with settings for blending with non-premultipled alpha, //that is blending source and destination data using alpha while assuming the color data contains no alpha information. static std::unique_ptr NonPremultiplied(); + + std::unique_ptr< BlendStateImplementation> Implementation; }; } diff --git a/includes/xna/graphics/depthstencilstate.hpp b/includes/xna/graphics/depthstencilstate.hpp index ddaa01a..aa95402 100644 --- a/includes/xna/graphics/depthstencilstate.hpp +++ b/includes/xna/graphics/depthstencilstate.hpp @@ -1,7 +1,6 @@ #ifndef XNA_GRAPHICS_DEPTHSTENCILSTATE_HPP #define XNA_GRAPHICS_DEPTHSTENCILSTATE_HPP -#include "../platform.hpp" #include "gresource.hpp" #include "shared.hpp" #include @@ -23,7 +22,7 @@ namespace xna { struct DepthStencilStateImplementation; //Contains depth-stencil state for the device. - class DepthStencilState : public GraphicsResource, public PlatformImplementation { + class DepthStencilState : public GraphicsResource { public: DepthStencilState(); DepthStencilState(std::shared_ptr const& device); @@ -104,6 +103,8 @@ namespace xna { bool Initialize(); bool Apply(); + + std::unique_ptr Implementation; }; } diff --git a/includes/xna/graphics/device.hpp b/includes/xna/graphics/device.hpp index 49d0de7..928474a 100644 --- a/includes/xna/graphics/device.hpp +++ b/includes/xna/graphics/device.hpp @@ -1,7 +1,6 @@ #ifndef XNA_GRAPHICS_DEVICE_HPP #define XNA_GRAPHICS_DEVICE_HPP -#include "../platform.hpp" #include "presentparams.hpp" #include "viewport.hpp" #include @@ -10,10 +9,10 @@ namespace xna { struct GraphicsDeviceImplementation; //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 PlatformImplementation { + class GraphicsDevice : public std::enable_shared_from_this { public: GraphicsDevice(); - + GraphicsDevice( std::shared_ptr const& adapter, GraphicsProfile const& graphicsProfile, @@ -42,9 +41,9 @@ namespace xna { //Clears resource buffers. void Clear(Color const& color) const; //Clears resource buffers. - void Clear(ClearOptions options, Color const& color, float depth, Int stencil) const; + void Clear(ClearOptions options, Color const& color, float depth, Int stencil) const; //Presents the display with the contents of the next buffer in the sequence of back buffers owned by the GraphicsDevice. - bool Present() const; + bool Present() const; //Resets the presentation parameters for the current GraphicsDevice. void Reset(std::shared_ptr const& presentationParameters, std::shared_ptr const& graphicsAdapter); //Gets or sets a viewport identifying the portion of the render target to receive draw calls. @@ -56,6 +55,8 @@ namespace xna { void Initialize(); + std::unique_ptr Implementation; + private: std::shared_ptr adapter{ nullptr }; std::shared_ptr blendState{ nullptr }; @@ -65,7 +66,7 @@ namespace xna { std::shared_ptr presentationParameters{ nullptr }; std::shared_ptr renderTarget{ nullptr }; GraphicsProfile graphicsProfile{ GraphicsProfile::HiDef }; - xna::Viewport viewport{}; + xna::Viewport viewport{}; }; } diff --git a/includes/xna/graphics/rasterizerstate.hpp b/includes/xna/graphics/rasterizerstate.hpp index cc5eebd..d4c73be 100644 --- a/includes/xna/graphics/rasterizerstate.hpp +++ b/includes/xna/graphics/rasterizerstate.hpp @@ -2,7 +2,6 @@ #define XNA_GRAPHICS_RASTERIZER_HPP #include "gresource.hpp" -#include "../platform.hpp" namespace xna { @@ -28,7 +27,7 @@ namespace xna { struct RasterizerStateImplementation; //Contains rasterizer state, which determines how to convert vector data (shapes) into raster data (pixels). - class RasterizerState : public GraphicsResource, public PlatformImplementation { + class RasterizerState : public GraphicsResource { public: RasterizerState(); RasterizerState(std::shared_ptr const& device); @@ -75,6 +74,8 @@ namespace xna { bool Initialize(); bool Apply(); + + std::unique_ptr Implementation; }; } diff --git a/includes/xna/graphics/samplerstate.hpp b/includes/xna/graphics/samplerstate.hpp index bfc5324..bd6c64b 100644 --- a/includes/xna/graphics/samplerstate.hpp +++ b/includes/xna/graphics/samplerstate.hpp @@ -1,7 +1,6 @@ #ifndef XNA_GRAPHICS_SAMPLERSTATE_HPP #define XNA_GRAPHICS_SAMPLERSTATE_HPP -#include "../platform.hpp" #include "gresource.hpp" #include "shared.hpp" #include @@ -50,7 +49,7 @@ namespace xna { struct SamplerStateImplementation; //Contains sampler state, which determines how to sample texture data. - class SamplerState : public GraphicsResource, public PlatformImplementation { + class SamplerState : public GraphicsResource { public: SamplerState(); SamplerState(std::shared_ptr const& device); @@ -109,6 +108,8 @@ namespace xna { bool Initialize(); bool Apply(); + + std::unique_ptr Implementation; }; //Collection of SamplerState objects. diff --git a/includes/xna/graphics/sprite.hpp b/includes/xna/graphics/sprite.hpp index b0aeafd..47525c2 100644 --- a/includes/xna/graphics/sprite.hpp +++ b/includes/xna/graphics/sprite.hpp @@ -4,7 +4,6 @@ #include "../common/color.hpp" #include "../common/numerics.hpp" #include "../graphics/gresource.hpp" -#include "../platform.hpp" #include #include #include @@ -35,7 +34,7 @@ namespace xna { struct SpriteBatchImplementation; //Enables a group of sprites to be drawn using the same settings. - class SpriteBatch : public GraphicsResource, public PlatformImplementation { + class SpriteBatch : public GraphicsResource { public: SpriteBatch(std::shared_ptr const& device); @@ -147,12 +146,14 @@ namespace xna { float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth) { DrawString(*spriteFont, text, position, color, rotation, origin, scale, effects, layerDepth); } void DrawString(SpriteFont& spriteFont, std::string const& text, Vector2 const& position, Color const& color, float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth); + + std::unique_ptr Implementation; }; struct SpriteFontImplementation; //Represents a font texture. - class SpriteFont : public PlatformImplementation { + class SpriteFont { public: SpriteFont( std::shared_ptr const& texture, @@ -177,6 +178,8 @@ namespace xna { int32_t LineSpacing() const; //Gets or sets the vertical distance (in pixels) between the base lines of two consecutive lines of text void LineSpacing(float value); + + std::unique_ptr Implementation; }; } diff --git a/includes/xna/graphics/texture.hpp b/includes/xna/graphics/texture.hpp index 09c5fb6..19de646 100644 --- a/includes/xna/graphics/texture.hpp +++ b/includes/xna/graphics/texture.hpp @@ -2,7 +2,6 @@ #define XNA_GRAPHICS_TEXTURE_HPP #include "../csharp/stream.hpp" -#include "../platform.hpp" #include "gresource.hpp" #include "shared.hpp" #include @@ -24,7 +23,7 @@ namespace xna { struct Texture2DImplementation; //Represents a 2D grid of texels. - class Texture2D : public Texture, public PlatformImplementation { + class Texture2D : public Texture { public: Texture2D(); Texture2D(std::shared_ptr const& device); @@ -60,6 +59,8 @@ namespace xna { void Initialize(); + std::unique_ptr Implementation; + protected: SurfaceFormat surfaceFormat{ SurfaceFormat::Color }; int32_t levelCount{ 0 }; diff --git a/includes/xna/platform.hpp b/includes/xna/platform.hpp deleted file mode 100644 index 9f7ac82..0000000 --- a/includes/xna/platform.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef XNA_PLATFORM_HPP -#define XNA_PLATFORM_HPP - -#include - -namespace xna { - template struct PlatformImplementation { - virtual ~PlatformImplementation() {} - - std::unique_ptr Implementation; - }; -} - -#endif \ No newline at end of file