// ---------------------------------------------------------------- // From Game Programming in C++ by Sanjay Madhav // Copyright (C) 2017 Sanjay Madhav. All rights reserved. // // Released under the BSD License // See LICENSE in root directory for full details. // ---------------------------------------------------------------- #pragma once #include "Component.h" #include "SDL/SDL.h" class SpriteComponent : public Component { public: // (Lower draw order corresponds with further back) SpriteComponent(class Actor* owner, int drawOrder = 100); ~SpriteComponent(); virtual void Draw(class Shader* shader); virtual void SetTexture(class Texture* texture); int GetDrawOrder() const { return mDrawOrder; } int GetTexHeight() const { return mTexHeight; } int GetTexWidth() const { return mTexWidth; } protected: class Texture* mTexture; int mDrawOrder; int mTexWidth; int mTexHeight; };