This commit is contained in:
Bram Verhulst
2024-06-09 22:03:29 +02:00
parent d7389411f5
commit 5f1dcd5788
76 changed files with 1532 additions and 385 deletions

View File

@@ -1,6 +1,9 @@
#include "pch.h"
#include "Screen.h"
#include "colors.h"
#include "utils.h"
Screen::Screen(const std::string& filePath, Vector2f pos, Vector2f size, TextureManager* manager): m_Position(pos), m_Size(size) {
if (!filePath.empty()) {
m_Background = manager->GetTexture(filePath);
@@ -23,6 +26,7 @@ void Screen::Update(float elapsedSecs) {
}
}
void Screen::Draw() const {
utils::SetColor(Colors::WHITE);
if (m_Background != nullptr) { //Incase there is no background
Rectf dest = Rectf(m_Position, m_Size);
Rectf src = Rectf(0, 0, m_Background->GetWidth(), m_Background->GetHeight());