feat ✨ added working text renderer
This commit is contained in:
18
src/game/systems/TextRenderer.hpp
Normal file
18
src/game/systems/TextRenderer.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "FontManager.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <string>
|
||||
|
||||
/*
|
||||
By Utilizing the existing Renderer this class creates and renders text to the screen
|
||||
*/
|
||||
class TextRenderer {
|
||||
public:
|
||||
TextRenderer(SDL_Renderer* renderer, FontManager* fontMgr);
|
||||
|
||||
SDL_Texture* RenderText(const std::string& fontID, const std::string& text, int fontSize, SDL_Color color, int& outWidth, int& outHeight);
|
||||
|
||||
private:
|
||||
SDL_Renderer* renderer;
|
||||
FontManager* fontManager;
|
||||
};
|
||||
Reference in New Issue
Block a user