2D_Game_Engine
Loading...
Searching...
No Matches
textqueue.cpp
Go to the documentation of this file.
1#include <pch.hpp>
2#include <textqueue.hpp>
3
4void TextQueue::Push(TextRenderer *renderer,const std::string &text,float x,float y,float scale,Vec3 color,int layer){
5 m_TextQueue.push({renderer,text,x,y,scale,color,layer});
6}
7
8void TextQueue::Render(int layer){
9 while(!m_TextQueue.empty() && (m_TextQueue.top().layer!=std::numeric_limits<int>::max()-1 || layer==std::numeric_limits<int>::max()-1) && m_TextQueue.top().layer<=layer){
10 auto &data=m_TextQueue.top();
11 data.renderer->_DrawText(data.text,data.x,data.y,data.scale,data.color);
12 m_TextQueue.pop();
13 }
14}
void Render(int layer)
Definition textqueue.cpp:8
void Push(TextRenderer *renderer, const std::string &text, float x, float y, float scale, Vec3 color, int layer)
Definition textqueue.cpp:4
YAML::Node data