1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/inc/graphics/sprite.hpp
2024-05-18 21:14:56 -03:00

55 lines
2.3 KiB
C++

#ifndef XNA_GRAPHICS_SPRITE_HPP
#define XNA_GRAPHICS_SPRITE_HPP
#include "../default.hpp"
#include "../common/numerics.hpp"
#include "common/color.hpp"
namespace xna {
class SpriteBatch {
public:
SpriteBatch(GraphicsDevice& device);
~SpriteBatch();
void Begin(
SpriteSortMode sortMode = SpriteSortMode::Deferred,
BlendState* blendState = nullptr,
SamplerState* samplerState = nullptr,
DepthStencilState* depthStencil = nullptr,
RasterizerState* rasterizerState = nullptr,
//Effect
Matrix const& transformMatrix = Matrix::Identity()
);
void End();
void Draw(Texture2D& texture, Vector2 const& position, Color const& color);
void Draw(Texture2D& texture, Vector2 const& position, Rectangle const* sourceRectangle, Color const& color);
void Draw(Texture2D& texture, Vector2 const& position, Rectangle const* sourceRectangle, Color const& color,
float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth);
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);
void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Color const& color);
void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Rectangle const* sourceRectangle, Color const& color);
void Draw(Texture2D& texture, Rectangle const& destinationRectangle, Rectangle const* sourceRectangle, Color const& color,
float rotation, Vector2 const& origin, SpriteEffects effects, float layerDepth);
void Viewport(xna::Viewport const& value);
void DrawString(SpriteFont& spriteFont, String const& text, Vector2 const& position, Color const& color);
void DrawString(SpriteFont& spriteFont, String const& text, Vector2 const& position, Color const& color,
float rotation, Vector2 const& origin, float scale, SpriteEffects effects, float layerDepth);
private:
struct PlatformImplementation;
uptr<PlatformImplementation> implementation = nullptr;
};
class SpriteFont {
public:
SpriteFont(GraphicsDevice& device, String const& fontFileName);
~SpriteFont();
Vector2 MeasureString(String const& text, bool ignoreWhiteSpace = true);
private:
struct PlatformImplementation;
uptr<PlatformImplementation> implementation = nullptr;
};
}
#endif