diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:25:49 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-01-29 15:25:49 +0100 |
commit | 32646973035dcb3f35c7501d0654607dfaeec091 (patch) | |
tree | b92156c74372af734da74342e4a4a0a12d6a8fdf /src/LambdaCube/GL/Data.hs | |
parent | 0d46a5cda433fe1a97f3c35002c192d8050e747a (diff) |
simplify Mesh data add some missing function
Diffstat (limited to 'src/LambdaCube/GL/Data.hs')
-rw-r--r-- | src/LambdaCube/GL/Data.hs | 5 |
1 files changed, 5 insertions, 0 deletions
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 | |||
23 | import LambdaCube.GL.Util | 23 | import LambdaCube.GL.Util |
24 | 24 | ||
25 | -- Buffer | 25 | -- Buffer |
26 | disposeBuffer :: Buffer -> IO () | ||
27 | disposeBuffer (Buffer _ bo) = withArray [bo] $ glDeleteBuffers 1 | ||
28 | |||
26 | compileBuffer :: [Array] -> IO Buffer | 29 | compileBuffer :: [Array] -> IO Buffer |
27 | compileBuffer arrs = do | 30 | compileBuffer arrs = do |
28 | let calcDesc (offset,setters,descs) (Array arrType cnt setter) = | 31 | let calcDesc (offset,setters,descs) (Array arrType cnt setter) = |
@@ -55,6 +58,8 @@ arrayType :: Buffer -> Int -> ArrayType | |||
55 | arrayType buf arrIdx = arrType $! bufArrays buf V.! arrIdx | 58 | arrayType buf arrIdx = arrType $! bufArrays buf V.! arrIdx |
56 | 59 | ||
57 | -- Texture | 60 | -- Texture |
61 | disposeTexture :: TextureData -> IO () | ||
62 | disposeTexture (TextureData to) = withArray [to] $ glDeleteTextures 1 | ||
58 | 63 | ||
59 | -- FIXME: Temporary implemenation | 64 | -- FIXME: Temporary implemenation |
60 | uploadTexture2DToGPU :: DynamicImage -> IO TextureData | 65 | uploadTexture2DToGPU :: DynamicImage -> IO TextureData |