summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lambdacube-gl.cabal2
-rw-r--r--src/LambdaCube/GL/Data.hs18
2 files changed, 5 insertions, 15 deletions
diff --git a/lambdacube-gl.cabal b/lambdacube-gl.cabal
index 2d62216..eb6aca9 100644
--- a/lambdacube-gl.cabal
+++ b/lambdacube-gl.cabal
@@ -1,5 +1,5 @@
1name: lambdacube-gl 1name: lambdacube-gl
2version: 0.5.0.0 2version: 0.5.0.1
3synopsis: OpenGL 3.3 Core Profile backend for LambdaCube 3D 3synopsis: OpenGL 3.3 Core Profile backend for LambdaCube 3D
4description: OpenGL 3.3 Core Profile backend for LambdaCube 3D 4description: OpenGL 3.3 Core Profile backend for LambdaCube 3D
5homepage: http://lambdacube3d.com 5homepage: http://lambdacube3d.com
diff --git a/src/LambdaCube/GL/Data.hs b/src/LambdaCube/GL/Data.hs
index c1e2737..56955d1 100644
--- a/src/LambdaCube/GL/Data.hs
+++ b/src/LambdaCube/GL/Data.hs
@@ -68,20 +68,10 @@ uploadTexture2DToGPU = uploadTexture2DToGPU' True False True False
68uploadTexture2DToGPU' :: Bool -> Bool -> Bool -> Bool -> DynamicImage -> IO TextureData 68uploadTexture2DToGPU' :: Bool -> Bool -> Bool -> Bool -> DynamicImage -> IO TextureData
69uploadTexture2DToGPU' isFiltered isSRGB isMip isClamped bitmap' = do 69uploadTexture2DToGPU' isFiltered isSRGB isMip isClamped bitmap' = do
70 let bitmap = case bitmap' of 70 let bitmap = case bitmap' of
71 ImageRGB8 i@(Image w h _) -> bitmap' -- pixelFoldMap (\(PixelRGB8 r g b) -> [PixelRGBA8 r g b maxBound]) i 71 ImageRGB8 i@(Image w h _) -> bitmap'
72 ImageRGBA8 i@(Image w h _) -> bitmap' -- pixelFoldMap (\(PixelRGBA8 r g b a) -> [PixelRGBA8 r g b a]) i 72 ImageRGBA8 i@(Image w h _) -> bitmap'
73 ImageYCbCr8 i@(Image w h _) -> ImageRGB8 $ convertImage i -- $ Image w h $ SV.fromList $ pixelFoldMap (\p -> let PixelRGB8 r g b = convertPixel p in [PixelRGBA8 r g b maxBound]) i 73 ImageYCbCr8 i@(Image w h _) -> ImageRGB8 $ convertImage i
74 ImageCMYK16 _ -> error "uploadTexture2DToGPU: ImageCMYK16" 74 di -> ImageRGBA8 $ convertRGBA8 di
75 ImageCMYK8 _ -> error "uploadTexture2DToGPU: ImageCMYK8"
76 ImageRGBA16 _ -> error "uploadTexture2DToGPU: ImageRGBA16"
77 ImageRGBF _ -> error "uploadTexture2DToGPU: ImageRGBF"
78 ImageRGB16 _ -> error "uploadTexture2DToGPU: ImageRGB16"
79 ImageYA16 _ -> error "uploadTexture2DToGPU: ImageYA16"
80 ImageYA8 _ -> error "uploadTexture2DToGPU: ImageYA8"
81 ImageYF _ -> error "uploadTexture2DToGPU: ImageYF"
82 ImageY16 _ -> error "uploadTexture2DToGPU: ImageY16"
83 ImageY8 _ -> error "uploadTexture2DToGPU: ImageY8"
84 _ -> error "uploadTexture2DToGPU: unknown image"
85 75
86 glPixelStorei GL_UNPACK_ALIGNMENT 1 76 glPixelStorei GL_UNPACK_ALIGNMENT 1
87 to <- alloca $! \pto -> glGenTextures 1 pto >> peek pto 77 to <- alloca $! \pto -> glGenTextures 1 pto >> peek pto