#include "pch.h"
#include "Camera.h"

Camera::Camera() : m_Position { 0, 0 }, m_Scale { 1.0f } {
}
Camera::Camera(const Point2f& position, const float scale) : m_Position { position }, m_Scale { scale } {
}
Camera::~Camera() {
}

void Camera::BeginRendering() const {
	glPushMatrix();
	glTranslatef(m_Position.x, m_Position.y, 0);
	glScalef(m_Scale, m_Scale, 1);
}

void Camera::EndRendering() const {
	glPopMatrix();
}
Point2f Camera::TransformMouse(const Point2f& mousePos) const {
	const Point2f translatedPosition = Point2f{ mousePos.x - m_Position.x, Viewport.height - mousePos.y - m_Position.y};
	return translatedPosition;
}
