From cf520852d06ba699527c184169dd4ca1b94ae7bb Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 17 Oct 2020 01:52:22 +0200 Subject: [PATCH] extract size alongside data when reding in textures --- src/Texture.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Texture.hs b/src/Texture.hs index de8dd60..fd14f42 100644 --- a/src/Texture.hs +++ b/src/Texture.hs @@ -19,7 +19,7 @@ import Foreign.Ptr import Classes.Bindable import Types.Texture -newTexture :: FilePath -> GL.GLuint -> IO Texture +newTexture :: FilePath -> GL.GLuint -> IO (V2 Word, Texture) newTexture fp slot = do -- read in image from filesystem @@ -56,7 +56,7 @@ newTexture fp slot = do -- free (texData tex) -- pass texture object out - return tex + return (fmap fromIntegral dimensions, tex) loadTexture :: Texture -> V2 GL.GLsizei -> Ptr () -> IO () loadTexture tex dimensions data_ =