mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Added the Grid, Camera, Level system
Basic player Started (Barely) on the TextureManager And other fixes
This commit is contained in:
@@ -1,2 +1,21 @@
|
||||
#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 } {
|
||||
}
|
||||
|
||||
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 = mousePos + m_Position;
|
||||
return translatedPosition;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user