charcoal/OpenGLEngine/Camera2D.h

34 lines
678 B
C
Raw Normal View History

#pragma once
#include "Camera.h"
#include <glm/glm.hpp>
2018-09-12 21:03:46 +00:00
namespace charcoal
{
2018-09-12 21:03:46 +00:00
using namespace glm;
class Camera2D : public Camera
{
public:
Camera2D(const vec2& size, const vec2& position = vec2(0.0f, 0.0f));
Camera2D(const vec3& size = vec3(2.0f, 2.0f, 2.0f), const vec3& position = vec3(0.0f, 0.0f, 0.0f));
2018-09-12 21:03:46 +00:00
void update_size(const vec3& size);
void update_position(const vec3& position);
2018-09-12 21:03:46 +00:00
void translate(const vec2& translation);
void translate(const vec3& translation);
2018-09-12 21:03:46 +00:00
void prerender();
2018-09-12 13:46:55 +00:00
2018-09-12 21:03:46 +00:00
const vec3& get_size() const { return m_size; }
const vec3& get_position() const { return m_position; }
2018-09-12 21:03:46 +00:00
private:
void update_scale();
2018-09-12 21:03:46 +00:00
vec3 m_size;
};
}