remove glm dependency
This commit is contained in:
@@ -39,6 +39,8 @@ void Renderer::InitShaders() {
|
||||
UpdateIsometricView();
|
||||
}
|
||||
|
||||
// TODO : change loader check
|
||||
|
||||
bool Renderer::Init() {
|
||||
#if __has_include(<glbinding/glbinding.h>)
|
||||
glbinding::initialize();
|
||||
@@ -110,13 +112,13 @@ void Renderer::SetZoom(float zoom) {
|
||||
m_EntityShader->SetZoom(zoom);
|
||||
}
|
||||
|
||||
void Renderer::SetCamMovement(const glm::vec2& mov) {
|
||||
void Renderer::SetCamMovement(const Vec2f& mov) {
|
||||
m_CamPos.x += mov.x * (1 - m_IsometricView) + (0.5 * mov.x - mov.y) * m_IsometricView;
|
||||
m_CamPos.y += -mov.y * (1 - m_IsometricView) + (-0.5 * mov.x - mov.y) * m_IsometricView;
|
||||
SetCamPos(m_CamPos);
|
||||
}
|
||||
|
||||
void Renderer::SetCamPos(const glm::vec2& newPos) {
|
||||
void Renderer::SetCamPos(const Vec2f& newPos) {
|
||||
m_CamPos = newPos;
|
||||
m_WorldShader->Start();
|
||||
m_WorldShader->SetCamPos(newPos);
|
||||
@@ -128,7 +130,7 @@ void Renderer::SetIsometricView(bool isometric) {
|
||||
m_IsometricView = isometric;
|
||||
}
|
||||
|
||||
glm::vec2 Renderer::GetCursorWorldPos(const glm::vec2& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight) {
|
||||
Vec2f Renderer::GetCursorWorldPos(const Vec2f& cursorPos, float aspectRatio, float zoom, float windowWidth, float windowHeight) {
|
||||
float isometricEased = utils::EaseInOutExpo(m_IsometricShade);
|
||||
|
||||
float relativeX = (cursorPos.x / windowWidth * 2) - 1;
|
||||
|
||||
Reference in New Issue
Block a user