Game Development Reference
In-Depth Information
XMFLOAT2 Origin;
bool Visible;
Sprite(void);
~Sprite(void);
void SetTexture(std::shared_ptr<Texture> tex);
void Draw(std::shared_ptr<SpriteBatch> sb);
XMFLOAT2 GetSize() { return
_tex->GetTextureSize(); };
};
class Texture
{
private:
std::wstring _path;
Microsoft::WRL::ComPtr<ID3D11Resource> _tex;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
_srv;
DirectX::XMFLOAT2 _size;
public:
XMFLOAT2 GetTextureSize() { return _size; }
void
Draw(std::shared_ptr<DirectX::SpriteBatch>
batch, XMFLOAT2 &pos, float rotation, XMFLOAT2
&scale, XMFLOAT2 &origin = XMFLOAT2(0, 0));
void
Load(Microsoft::WRL::ComPtr<ID3D11Device>
device);
Texture(std::wstring &path);
};
Search WWH ::




Custom Search