1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/framework/platform/spritebatch-dx.hpp

55 lines
2.6 KiB
C++
Raw Normal View History

2024-04-14 16:11:15 -03:00
#ifndef XNA_PLATFORM_SPRITEBATCH_DX_HPP
#define XNA_PLATFORM_SPRITEBATCH_DX_HPP
2024-04-14 21:23:09 -03:00
#include "../common/color.hpp"
#include "../common/rectangle.hpp"
#include "../common/vectors.hpp"
2024-04-14 16:11:15 -03:00
#include "../graphics/spritebatch.hpp"
2024-04-14 21:23:09 -03:00
#include "../graphics/viewport.hpp"
2024-04-14 16:11:15 -03:00
#include "SpriteBatch.h"
2024-04-14 21:23:09 -03:00
#include "spritefont-dx.hpp"
2024-04-14 16:11:15 -03:00
namespace xna {
class SpriteBatch : public ISpriteBatch {
public:
SpriteBatch(GraphicsDevice& device);
virtual ~SpriteBatch() override {}
virtual void Begin(
SpriteSortMode sortMode = SpriteSortMode::Deferred,
BlendState* blendState = nullptr,
SamplerState* samplerState = nullptr,
DepthStencilState* depthStencil = nullptr,
2024-04-14 16:11:15 -03:00
RasterizerState* rasterizerState = nullptr,
//Effect
Matrix const& transformMatrix = Matrix::Identity()
2024-04-14 16:11:15 -03:00
) override;
virtual void End() override;
virtual void Draw(Texture2D& texture, Vector2 const& position, Color const& color) override;
virtual void Draw(Texture2D& texture, Vector2 const& position, Rectangle const * sourceRectangle, Color const& color) override;
virtual void Draw(Texture2D& texture, Vector2 const& position, Rectangle const* sourceRectangle, Color const& color,
float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth) override;
virtual void Draw(Texture2D& texture, Vector2 const& position, Rectangle const* sourceRectangle, Color const& color,
float rotation, Vector2 const& origin, Vector2 const& scale, SpriteEffects effects, float layerDepth) override;
virtual void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Color const& color) override;
virtual void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Rectangle const* sourceRectangle, Color const& color) override;
virtual void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Rectangle const* sourceRectangle, Color const& color,
float rotation, Vector2 const& origin, SpriteEffects effects, float layerDepth) override;
2024-04-14 21:23:09 -03:00
virtual void Viewport(xna::Viewport const& value) override;
virtual void DrawString(SpriteFont& spriteFont, String const& text, Vector2 const& position, Color const& color) override;
virtual void DrawString(SpriteFont& spriteFont, String const& text, Vector2 const& position, Color const& color,
float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth) override;
2024-04-14 16:11:15 -03:00
public:
static constexpr void ConvertSpriteSort(SpriteSortMode value, DirectX::SpriteSortMode& target) {
2024-04-25 14:51:33 -03:00
target = static_cast<DirectX::SpriteSortMode>(static_cast<int>(value));
2024-04-14 16:11:15 -03:00
}
2024-04-14 21:23:09 -03:00
public:
sptr<DirectX::SpriteBatch> _dxspriteBatch = nullptr;
2024-04-14 16:11:15 -03:00
};
}
#endif