summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Data.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-01-29 15:25:49 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-01-29 15:25:49 +0100
commit32646973035dcb3f35c7501d0654607dfaeec091 (patch)
treeb92156c74372af734da74342e4a4a0a12d6a8fdf /src/LambdaCube/GL/Data.hs
parent0d46a5cda433fe1a97f3c35002c192d8050e747a (diff)
simplify Mesh data add some missing function
Diffstat (limited to 'src/LambdaCube/GL/Data.hs')
-rw-r--r--src/LambdaCube/GL/Data.hs5
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
23import LambdaCube.GL.Util 23import LambdaCube.GL.Util
24 24
25-- Buffer 25-- Buffer
26disposeBuffer :: Buffer -> IO ()
27disposeBuffer (Buffer _ bo) = withArray [bo] $ glDeleteBuffers 1
28
26compileBuffer :: [Array] -> IO Buffer 29compileBuffer :: [Array] -> IO Buffer
27compileBuffer arrs = do 30compileBuffer 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
55arrayType buf arrIdx = arrType $! bufArrays buf V.! arrIdx 58arrayType buf arrIdx = arrType $! bufArrays buf V.! arrIdx
56 59
57-- Texture 60-- Texture
61disposeTexture :: TextureData -> IO ()
62disposeTexture (TextureData to) = withArray [to] $ glDeleteTextures 1
58 63
59-- FIXME: Temporary implemenation 64-- FIXME: Temporary implemenation
60uploadTexture2DToGPU :: DynamicImage -> IO TextureData 65uploadTexture2DToGPU :: DynamicImage -> IO TextureData