Pre Point2f Nuke

Fixed drawing,
Added general optimisations
This commit is contained in:
Bram Verhulst
2024-04-16 14:08:41 +02:00
parent f50597d1a5
commit 64e96ab209
13 changed files with 228 additions and 177 deletions

View File

@@ -1,23 +1,22 @@
#include "pch.h"
#include "Screen.h"
Screen::Screen(const std::string& filePath, Point2f pos, Point2f size,TextureManager* manager): m_Position(pos), m_Size(size)
{
Screen::Screen(const std::string& filePath, Point2f pos, Point2f size, TextureManager* manager): m_Position(pos), m_Size(size) {
m_Background = manager->GetTexture(filePath);
}
Screen::~Screen() {
}
void Screen::Update(float elapsedSecs) {
for(Button* b : m_Buttons) {
for (Button* b : m_Buttons) {
b->Update(elapsedSecs);
}
}
void Screen::Draw() const {
Rectf dest = Rectf(m_Position, m_Size);
Rectf src = Rectf(0,0, m_Background->GetWidth(), m_Background->GetHeight());
Rectf src = Rectf(0, 0, m_Background->GetWidth(), m_Background->GetHeight());
m_Background->Draw(dest, src, false);
for(Button* b: m_Buttons) {
for (Button* b : m_Buttons) {
b->Draw();
}
}