From 32646973035dcb3f35c7501d0654607dfaeec091 Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Fri, 29 Jan 2016 15:25:49 +0100 Subject: simplify Mesh data add some missing function --- src/LambdaCube/GL/Data.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/LambdaCube/GL/Data.hs') diff --git a/src/LambdaCube/GL/Data.hs b/src/LambdaCube/GL/Data.hs index 4ebe33c..3e0f963 100644 --- a/src/LambdaCube/GL/Data.hs +++ b/src/LambdaCube/GL/Data.hs @@ -23,6 +23,9 @@ import LambdaCube.GL.Type import LambdaCube.GL.Util -- Buffer +disposeBuffer :: Buffer -> IO () +disposeBuffer (Buffer _ bo) = withArray [bo] $ glDeleteBuffers 1 + compileBuffer :: [Array] -> IO Buffer compileBuffer arrs = do let calcDesc (offset,setters,descs) (Array arrType cnt setter) = @@ -55,6 +58,8 @@ arrayType :: Buffer -> Int -> ArrayType arrayType buf arrIdx = arrType $! bufArrays buf V.! arrIdx -- Texture +disposeTexture :: TextureData -> IO () +disposeTexture (TextureData to) = withArray [to] $ glDeleteTextures 1 -- FIXME: Temporary implemenation uploadTexture2DToGPU :: DynamicImage -> IO TextureData -- cgit v1.2.3