Changes to games.hpp

There are a few additional changes we will need to make to our game.hpp file. In addition to our UIButton class, we will need to add a UISprite class definition file. The UISprite is just a plain, ordinary image drawn in canvas space. It will not have any functionality on top of just being a sprite rendered as a UI element. Here is what the definition looks like:

class UISprite {
public:
bool m_Active;
SDL_Texture *m_SpriteTexture;
SDL_Rect m_dest = {.x = 0, .y = 0, .w = 128, .h = 32 };
UISprite( int x, int y, char* file_name );
void RenderUI();
};

Like the button, it has an active state that's represented by the m_Active attribute. If this value is false, the sprite will not render. It also has a sprite texture and a destination attribute that tells the renderer what to draw and where to draw it:

SDL_Texture *m_SpriteTexture;
SDL_Rect m_dest = {.x = 0, .y = 0, .w = 128, .h = 32 };

It has a simple constructor that takes in the x and y coordinates where we will render the sprite on the canvas, and the file name of the image in the virtual filesystem from which we will load the sprite:

UISprite( int x, int y, char* file_name );

Finally, it has a render function called RenderUI that will render the sprite to the canvas:

void RenderUI();