3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Graphics.SpriteBatch Class Reference

A SpriteBatch renders 2D sprites with a specified order. More...

#include <SpriteBatch.hpp>

Inheritance diagram for Engine3DRadSpace.Graphics.SpriteBatch:
Collaboration diagram for Engine3DRadSpace.Graphics.SpriteBatch:

Public Member Functions

 SpriteBatch (IntPtr handle)
 SpriteBatch (IGraphicsDevice device)
void Begin (SpriteBatchSortMode mode)
unsafe void DrawNormalized (ITexture2D texture, RectangleF coords, RectangleF source, Math.Color color, float rotation, FlipMode flipMode, float depth)
unsafe void DrawNormalized (ITexture2D texture, RectangleF coords, Rectangle source, Math.Color color, float rotation, FlipMode flipMode, float depth)
unsafe void Draw (ITexture2D texture, Rectangle coords, Rectangle source, Math.Color color, float rotation, FlipMode flipMode, float depth)
unsafe void Draw (ITexture2D texture, Rectangle coords, Math.Color color, float rotation, FlipMode flipMode, float depth)
unsafe void DrawString (Font font, string text, Point pos, float size, Math.Color color, float rotation, FlipMode flipMode, float depth)
unsafe void DrawString (Font font, string text, System.Numerics.Vector2 pos, float size, Math.Color color, float rotation, FlipMode flipMode, float depth)
void End ()
 SpriteBatch (IGraphicsDevice *device)
 Constructs a sprite batch.
 SpriteBatch (SpriteBatch &)=delete
 SpriteBatch (SpriteBatch &&) noexcept=default
SpriteBatch & operator= (SpriteBatch &)=delete
SpriteBatch & operator= (SpriteBatch &&) noexcept=default
void Begin (SpriteBatchSortMode sortingMode=SpriteBatchSortMode::Immediate)
 Begins a sprite batch with the specified sorting mode.
void Begin (SpriteBatchSortMode sortingMode, std::unique_ptr< ISamplerState > &&samplerState)
 Begins a sprite batch with the specified sorting mode and sampler state.
void DrawNormalized (ITexture2D *texture, const Math::RectangleF &coords, const Math::RectangleF &source=Math::RectangleF(0.0f, 0.0f, 1.0f, 1.0f), const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a sprite with normalized coordinates and source rectangle.
void DrawNormalized (ITexture2D *texture, const Math::RectangleF &coords, const Math::Rectangle &source, const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a sprite with normalized coordinates and source rectangle.
void Draw (ITexture2D *texture, const Math::Rectangle &coords, const Math::Rectangle &source, const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a sprite with pixel screen coordinates and source rectangle.
void Draw (ITexture2D *texture, const Math::Rectangle &coords, const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a sprite with pixel screen coordinates and no source rectangle.
void DrawString (Font *font, const std::string &text, const Math::Vector2 &pos, float size, const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a string using the specified font, position, size, and other parameters.
void DrawString (Font *font, const std::string &text, const Math::Point &pos, float size, const Math::Color &tintColor=Math::Colors::White, float rotation=0.0f, FlipMode flipMode=FlipMode::None, float depth=0)
 Draws a string using the specified font, position, size, and other parameters.
void End ()
 Stop receiving draw commands, submit all data to the GPU then flush the internal data of this instance.
 ~SpriteBatch () override=default
Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
virtual void Dispose ()
Public Member Functions inherited from Engine3DRadSpace.IService
IGame * GetOwner () const noexcept
 Gets the owner of this instance.
virtual ~IService ()=default

Additional Inherited Members

Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
 NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy)
 NatPtrWrapper (Action< IntPtr > fnDestroy)
void Reset (IntPtr newObj)
void Dispose (bool disposing)
Protected Member Functions inherited from Engine3DRadSpace.IService
 IService ()
 IService (IGame *owner)
 IService (const IService &)=delete
IService & operator= (const IService &)=delete
 IService (IService &&) noexcept=default
IService & operator= (IService &&) noexcept=default
Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr _handle
bool _disposed
Protected Attributes inherited from Engine3DRadSpace.IService
IGame * _owner = nullptr
Properties inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr Handle [get]
Properties inherited from Engine3DRadSpace.IService
IGame Owner [get]

Detailed Description

A SpriteBatch renders 2D sprites with a specified order.

Constructor & Destructor Documentation

◆ SpriteBatch() [1/5]

Engine3DRadSpace.Graphics.SpriteBatch.SpriteBatch ( IntPtr handle)
inline

◆ SpriteBatch() [2/5]

Engine3DRadSpace.Graphics.SpriteBatch.SpriteBatch ( IGraphicsDevice device)
inline

◆ SpriteBatch() [3/5]

Constructs a sprite batch.

Parameters
deviceGraphics device

◆ SpriteBatch() [4/5]

◆ SpriteBatch() [5/5]

◆ ~SpriteBatch()

Engine3DRadSpace.Graphics.SpriteBatch.~SpriteBatch ( )
overridedefault

Member Function Documentation

◆ Begin() [1/3]

void SpriteBatch.Begin ( SpriteBatchSortMode mode)
inline

◆ Begin() [2/3]

void SpriteBatch::Begin ( SpriteBatchSortMode sortingMode,
std::unique_ptr< ISamplerState > && samplerState )

Begins a sprite batch with the specified sorting mode and sampler state.

Parameters
sortingModeThe sorting mode to use for the sprite batch.
samplerStateThe sampler state to use for the sprite batch.

◆ Begin() [3/3]

Begins a sprite batch with the specified sorting mode.

Parameters
sortingModeThe sorting mode to use for the sprite batch.

◆ Draw() [1/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.Draw ( ITexture2D texture,
Rectangle coords,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ Draw() [2/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.Draw ( ITexture2D texture,
Rectangle coords,
Rectangle source,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ Draw() [3/4]

void Engine3DRadSpace.Graphics.SpriteBatch.Draw ( ITexture2D * texture,
const Math::Rectangle & coords,
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a sprite with pixel screen coordinates and no source rectangle.

Parameters
textureThe texture to draw.
coordsThe pixel screen coordinates of the sprite.
tintColorThe tint color to apply to the sprite.
rotationThe rotation of the sprite in radians.
flipModeThe flip mode to apply to the sprite.
depthThe depth of the sprite.

◆ Draw() [4/4]

void Engine3DRadSpace.Graphics.SpriteBatch.Draw ( ITexture2D * texture,
const Math::Rectangle & coords,
const Math::Rectangle & source,
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a sprite with pixel screen coordinates and source rectangle.

Parameters
textureThe texture to draw.
coordsThe pixel screen coordinates of the sprite.
sourceThe source rectangle of the texture.
tintColorThe tint color to apply to the sprite.
rotationThe rotation of the sprite in radians.
flipModeThe flip mode to apply to the sprite.
depthThe depth of the sprite.

◆ DrawNormalized() [1/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.DrawNormalized ( ITexture2D texture,
RectangleF coords,
Rectangle source,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ DrawNormalized() [2/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.DrawNormalized ( ITexture2D texture,
RectangleF coords,
RectangleF source,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ DrawNormalized() [3/4]

void Engine3DRadSpace.Graphics.SpriteBatch.DrawNormalized ( ITexture2D * texture,
const Math::RectangleF & coords,
const Math::Rectangle & source,
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a sprite with normalized coordinates and source rectangle.

Parameters
textureThe texture to draw.
coordsThe normalized coordinates of the sprite.
sourceThe source rectangle of the texture.
tintColorThe tint color to apply to the sprite.
rotationThe rotation of the sprite in radians.
flipModeThe flip mode to apply to the sprite.
depthThe depth of the sprite.

◆ DrawNormalized() [4/4]

void Engine3DRadSpace.Graphics.SpriteBatch.DrawNormalized ( ITexture2D * texture,
const Math::RectangleF & coords,
const Math::RectangleF & source = Math::RectangleF(0.0f, 0.0f, 1.0f, 1.0f),
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a sprite with normalized coordinates and source rectangle.

Parameters
textureThe texture to draw.
coordsThe normalized coordinates of the sprite.
sourceThe source rectangle of the texture.
tintColorThe tint color to apply to the sprite.
rotationThe rotation of the sprite in radians.
flipModeThe flip mode to apply to the sprite.
depthThe depth of the sprite.

◆ DrawString() [1/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.DrawString ( Font font,
string text,
Point pos,
float size,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ DrawString() [2/4]

unsafe void Engine3DRadSpace.Graphics.SpriteBatch.DrawString ( Font font,
string text,
System.Numerics.Vector2 pos,
float size,
Math.Color color,
float rotation,
FlipMode flipMode,
float depth )
inline

◆ DrawString() [3/4]

void Engine3DRadSpace.Graphics.SpriteBatch.DrawString ( Font * font,
const std::string & text,
const Math::Point & pos,
float size,
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a string using the specified font, position, size, and other parameters.

Parameters
fontThe font to use for drawing the text.
textThe text to draw.
posThe position to draw the text.
sizeThe size of the text.
tintColorThe tint color to apply to the text.
rotationThe rotation of the text in radians.
flipModeThe flip mode to apply to the text.
depthThe depth of the text.

◆ DrawString() [4/4]

void Engine3DRadSpace.Graphics.SpriteBatch.DrawString ( Font * font,
const std::string & text,
const Math::Vector2 & pos,
float size,
const Math::Color & tintColor = Math::Colors::White,
float rotation = 0.0f,
FlipMode flipMode = FlipMode::None,
float depth = 0 )

Draws a string using the specified font, position, size, and other parameters.

Parameters
fontThe font to use for drawing the text.
textThe text to draw.
posThe position to draw the text.
sizeThe size of the text.
tintColorThe tint color to apply to the text.
rotationThe rotation of the text in radians.
flipModeThe flip mode to apply to the text.
depthThe depth of the text.

◆ End() [1/2]

void SpriteBatch.End ( )
inline

◆ End() [2/2]

Stop receiving draw commands, submit all data to the GPU then flush the internal data of this instance.

◆ operator=() [1/2]

SpriteBatch & Engine3DRadSpace.Graphics.SpriteBatch.operator= ( SpriteBatch && )
defaultnoexcept

◆ operator=() [2/2]

SpriteBatch & Engine3DRadSpace.Graphics.SpriteBatch.operator= ( SpriteBatch & )
delete

The documentation for this class was generated from the following files: