From 962e52502bac77e36b04d88021a9d5c5970f3139 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Wed, 12 Apr 2023 15:47:22 +0200 Subject: [PATCH] Add ortho projection --- src/GPUFontAtlasLayerCombo.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/GPUFontAtlasLayerCombo.h b/src/GPUFontAtlasLayerCombo.h index 5d52583..1231128 100644 --- a/src/GPUFontAtlasLayerCombo.h +++ b/src/GPUFontAtlasLayerCombo.h @@ -20,6 +20,9 @@ class GPUFontAtlasLayerCombo : public AtlasLayerCombo { glm::mat4 getProjectionMatrix(float aspect){ return glm::perspective( /* fovy = */ glm::radians(60.0f), aspect, 0.002f, 12.000f); } + glm::mat4 getOrthoProjectionMatrix(float w, float h){ + return glm::ortho(-(w * 0.5f), (w * 0.5f), -(h * 0.5f), (h * 0.5f), 0.002f, 12.000f); + } glm::mat4 getViewMatrix(){ auto translation = glm::translate(position);