Avionics
Dropship Simulator
Sprite Class Reference

#include <Sprite.h>

Collaboration diagram for Sprite:
[legend]

Public Member Functions

void Initialize (Logger *prmLogger, Bus *prmBus, DEVICE_OBJECT *prmpDevice, int prmScreenHeight, int prmElementX, int prmElementY, bool prmFlip)
 
void Update ()
 
void Draw ()
 
 Sprite ()
 
 ~Sprite ()
 

Public Attributes

D3D10_TEXTURE2D_DESC desc
 
int x = 0
 
int y = 0
 
int width = 0
 
int height = 0
 
float z = 1.0f
 
std::string pathAndFilename
 
std::string elementName
 
D3DXCOLOR color = 0xFFFFFFFF
 
float rotate = 0.0f
 
bool normallyHidden = false
 
D3DXVECTOR2 texCoord = D3DXVECTOR2(0, 0)
 
D3DXVECTOR2 texSize = D3DXVECTOR2(1, 1)
 

Private Attributes

ID3DX10Sprite * pSprite = nullptr
 
D3DX10_SPRITE dxSprite
 
int elementX = 0
 
int elementY = 0
 
int screenHeight = 0
 
Loggerlogger = nullptr
 
Busbus = nullptr
 
bool flip = false
 

Detailed Description

Constructor & Destructor Documentation

◆ Sprite()

Sprite::Sprite ( )
inline

Definition at line 80 of file Sprite.h.

◆ ~Sprite()

Sprite::~Sprite ( )
inline

memory leak? not really sure what to do here... I can't release the SRV from here but don't need the reference anymore

Definition at line 85 of file Sprite.h.

Member Function Documentation

◆ Draw()

void Sprite::Draw ( )
inline

Definition at line 64 of file Sprite.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Initialize()

void Sprite::Initialize ( Logger prmLogger,
Bus prmBus,
DEVICE_OBJECT prmpDevice,
int  prmScreenHeight,
int  prmElementX,
int  prmElementY,
bool  prmFlip 
)
inline

we are offset by screen location using the projection matrix this works for sprites but not fonts apparently for some reason

Definition at line 26 of file Sprite.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Update()

void Sprite::Update ( )
inline

Definition at line 50 of file Sprite.h.

Here is the caller graph for this function:

Member Data Documentation

◆ bus

Bus* Sprite::bus = nullptr
private

Definition at line 11 of file Sprite.h.

◆ color

D3DXCOLOR Sprite::color = 0xFFFFFFFF

Definition at line 20 of file Sprite.h.

◆ desc

D3D10_TEXTURE2D_DESC Sprite::desc

Definition at line 15 of file Sprite.h.

◆ dxSprite

D3DX10_SPRITE Sprite::dxSprite
private

Definition at line 8 of file Sprite.h.

◆ elementName

std::string Sprite::elementName

Definition at line 19 of file Sprite.h.

◆ elementX

int Sprite::elementX = 0
private

Definition at line 9 of file Sprite.h.

◆ elementY

int Sprite::elementY = 0
private

Definition at line 9 of file Sprite.h.

◆ flip

bool Sprite::flip = false
private

Definition at line 12 of file Sprite.h.

◆ height

int Sprite::height = 0

Definition at line 16 of file Sprite.h.

◆ logger

Logger* Sprite::logger = nullptr
private

Definition at line 10 of file Sprite.h.

◆ normallyHidden

bool Sprite::normallyHidden = false

Definition at line 22 of file Sprite.h.

◆ pathAndFilename

std::string Sprite::pathAndFilename

Definition at line 18 of file Sprite.h.

◆ pSprite

ID3DX10Sprite* Sprite::pSprite = nullptr
private

Definition at line 7 of file Sprite.h.

◆ rotate

float Sprite::rotate = 0.0f

Definition at line 21 of file Sprite.h.

◆ screenHeight

int Sprite::screenHeight = 0
private

Definition at line 9 of file Sprite.h.

◆ texCoord

D3DXVECTOR2 Sprite::texCoord = D3DXVECTOR2(0, 0)

Definition at line 23 of file Sprite.h.

◆ texSize

D3DXVECTOR2 Sprite::texSize = D3DXVECTOR2(1, 1)

Definition at line 24 of file Sprite.h.

◆ width

int Sprite::width = 0

Definition at line 16 of file Sprite.h.

◆ x

int Sprite::x = 0

Definition at line 16 of file Sprite.h.

◆ y

int Sprite::y = 0

Definition at line 16 of file Sprite.h.

◆ z

float Sprite::z = 1.0f

Definition at line 17 of file Sprite.h.


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