diff options
Diffstat (limited to 'src/LambdaCube/GL/Data.hs')
-rw-r--r-- | src/LambdaCube/GL/Data.hs | 18 |
1 files changed, 4 insertions, 14 deletions
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 | |||
68 | uploadTexture2DToGPU' :: Bool -> Bool -> Bool -> Bool -> DynamicImage -> IO TextureData | 68 | uploadTexture2DToGPU' :: Bool -> Bool -> Bool -> Bool -> DynamicImage -> IO TextureData |
69 | uploadTexture2DToGPU' isFiltered isSRGB isMip isClamped bitmap' = do | 69 | uploadTexture2DToGPU' 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 |