Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
meteor::MTexRenderCmd Class Reference

This a RenderCommand that draws an image on to the screen. More...

#include <texrendercmd.h>

Inheritance diagram for meteor::MTexRenderCmd:

Public Member Functions

 MTexRenderCmd (ERenderLayer layer, uint8_t sortingOrder)
 Constructor.
 
void bindTexture (MTexture *tex)
 Bind a texture to draw.
 
void updateRect (SRect rect)
 Update the Rect for rendering.
 
void updateSrcRect (SRect rect)
 Update the Rect for image. Src Rect is the rect used for rendering specific parts of the texture.
 
void updateScale (SVector2 scale)
 Update the scale of image during render.
 
void updatePivot (SVector2 pivot)
 Update the pivot of image during render.
 
void updateRotation (float rotation)
 Update rotation of the img during render.
 
void useSourceRect (bool useSrcRect)
 Set to true if a part of the texture needs to be rendererd.
 
void render () override
 Renders the image to screen.
 
bool isValid () override
 
- Public Member Functions inherited from meteor::MRenderCommand
 MRenderCommand (ERenderLayer layer, uint8_t sortingOrder)
 
ERenderLayer getLayer ()
 
uint8_t getSortingOrder ()
 
void setRenderCore (SDL_Renderer *rendererCore)
 
- Public Member Functions inherited from meteor::MEntity
virtual bool equals (MEntity *other)
 Checks equality between two entities.
 
std::string getName ()
 
void setName (std::string name)
 Sets name of entity.
 
virtual std::string toString ()
 Get this object as a string.
 

Additional Inherited Members

- Protected Attributes inherited from meteor::MRenderCommand
SDL_Renderer * renderCore = NULL
 
- Protected Attributes inherited from meteor::MEntity
std::string name
 

Detailed Description

This a RenderCommand that draws an image on to the screen.

Constructor & Destructor Documentation

◆ MTexRenderCmd()

meteor::MTexRenderCmd::MTexRenderCmd ( ERenderLayer layer,
uint8_t sortingOrder )

Constructor.

Parameters
layerlayer for rendering
sortingOrdersorting order within the layer

Member Function Documentation

◆ bindTexture()

void meteor::MTexRenderCmd::bindTexture ( MTexture * tex)

Bind a texture to draw.

Parameters
texTexture reference

◆ isValid()

bool meteor::MTexRenderCmd::isValid ( )
overridevirtual
Returns
true if rendercommand is valid.

Reimplemented from meteor::MRenderCommand.

◆ render()

void meteor::MTexRenderCmd::render ( )
overridevirtual

Renders the image to screen.

Reimplemented from meteor::MRenderCommand.

◆ updatePivot()

void meteor::MTexRenderCmd::updatePivot ( SVector2 pivot)
inline

Update the pivot of image during render.

Parameters
pivotNormalized Vector2 defining pivot

◆ updateRotation()

void meteor::MTexRenderCmd::updateRotation ( float rotation)
inline

Update rotation of the img during render.

Parameters
rotation

◆ updateScale()

void meteor::MTexRenderCmd::updateScale ( SVector2 scale)
inline

Update the scale of image during render.

Parameters
scaleVector2 defining scale

◆ updateSrcRect()

void meteor::MTexRenderCmd::updateSrcRect ( SRect rect)
inline

Update the Rect for image. Src Rect is the rect used for rendering specific parts of the texture.

Parameters
rectSrc Rect.

◆ useSourceRect()

void meteor::MTexRenderCmd::useSourceRect ( bool useSrcRect)
inline

Set to true if a part of the texture needs to be rendererd.

Parameters
useSrcRect