packages feed

OpenGL 2.4.0.2 → 2.5.0.0

raw patch · 6 files changed

+18/−70 lines, 6 filesdep ~StateVardep ~Tensordep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: StateVar, Tensor, base

API changes (from Hackage documentation)

- Graphics.Rendering.OpenGL.GL.Evaluators: instance (Eq d, Domain d) => Eq (MapDescriptor d)
- Graphics.Rendering.OpenGL.GL.Evaluators: instance (Ord d, Domain d) => Ord (MapDescriptor d)
- Graphics.Rendering.OpenGL.GL.Evaluators: instance (Show d, Domain d) => Show (MapDescriptor d)
+ Graphics.Rendering.OpenGL.GL.Evaluators: instance Eq d => Eq (MapDescriptor d)
+ Graphics.Rendering.OpenGL.GL.Evaluators: instance Ord d => Ord (MapDescriptor d)
+ Graphics.Rendering.OpenGL.GL.Evaluators: instance Show d => Show (MapDescriptor d)
- Graphics.Rendering.OpenGL.GL.CoordTrans: class Matrix m
+ Graphics.Rendering.OpenGL.GL.CoordTrans: class Matrix m where withNewMatrix order act = allocaArray 16 $ \ p -> do { act p; components <- peekArray 16 p; newMatrix order components } withMatrix mat act = do { components <- getMatrixComponents ColumnMajor mat; withArray components $ act ColumnMajor } newMatrix order components = withNewMatrix order $ flip pokeArray (take 16 components) getMatrixComponents desiredOrder mat = withMatrix mat $ \ order p -> if desiredOrder == order then peekArray 16 p else mapM (peekElemOff p) [0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15]
- Graphics.Rendering.OpenGL.GL.Evaluators: class Map1 m
+ Graphics.Rendering.OpenGL.GL.Evaluators: class Map1 m where withNewMap1 descriptor@(MapDescriptor domain _ _ _) act = do { allocaArray (totalComponents1 descriptor) $ \ ptr -> do { act ptr; controlPoints <- peekControlPoints1 descriptor ptr; newMap1 domain controlPoints } } withMap1 m act = do { (domain, controlPoints) <- getMap1Components m; let stride = numComponents (head controlPoints) order = genericLength controlPoints descriptor = MapDescriptor domain stride order (fromIntegral stride); allocaArray (totalComponents1 descriptor) $ \ ptr -> do { pokeControlPoints1 descriptor ptr controlPoints; act descriptor ptr } } newMap1 domain controlPoints = do { let stride = numComponents (head controlPoints) order = genericLength controlPoints descriptor = MapDescriptor domain stride order (fromIntegral stride); withNewMap1 descriptor $ \ ptr -> pokeControlPoints1 descriptor ptr controlPoints } getMap1Components m = withMap1 m $ \ descriptor@(MapDescriptor domain _ _ _) ptr -> do { controlPoints <- peekControlPoints1 descriptor ptr; return (domain, controlPoints) }
- Graphics.Rendering.OpenGL.GL.Evaluators: class Map2 m
+ Graphics.Rendering.OpenGL.GL.Evaluators: class Map2 m where withNewMap2 uDescriptor@(MapDescriptor uDomain _ _ _) vDescriptor@(MapDescriptor vDomain _ _ _) act = allocaArray (totalComponents2 uDescriptor vDescriptor) $ \ ptr -> do { act ptr; controlPoints <- peekControlPoints2 uDescriptor vDescriptor ptr; newMap2 uDomain vDomain controlPoints } withMap2 m act = do { (uDomain, vDomain, controlPoints) <- getMap2Components m; let vStride = numComponents (head (head controlPoints)) vOrder = genericLength (head controlPoints) uStride = vStride * fromIntegral vOrder uOrder = genericLength controlPoints numComp = fromIntegral vStride uDescriptor = MapDescriptor uDomain uStride uOrder numComp vDescriptor = MapDescriptor vDomain vStride vOrder numComp; allocaArray (totalComponents2 uDescriptor vDescriptor) $ \ ptr -> do { pokeControlPoints2 uDescriptor vDescriptor ptr controlPoints; act uDescriptor vDescriptor ptr } } newMap2 uDomain vDomain controlPoints = do { let vStride = numComponents (head (head controlPoints)) vOrder = genericLength (head controlPoints) uStride = vStride * fromIntegral vOrder uOrder = genericLength controlPoints numComp = fromIntegral vStride uDescriptor = MapDescriptor uDomain uStride uOrder numComp vDescriptor = MapDescriptor vDomain vStride vOrder numComp; withNewMap2 uDescriptor vDescriptor $ \ ptr -> pokeControlPoints2 uDescriptor vDescriptor ptr controlPoints } getMap2Components m = withMap2 m $ \ uDescriptor@(MapDescriptor uDomain _ _ _) vDescriptor@(MapDescriptor vDomain _ _ _) ptr -> do { controlPoints <- peekControlPoints2 uDescriptor vDescriptor ptr; return (uDomain, vDomain, controlPoints) }
- Graphics.Rendering.OpenGL.GL.Evaluators: data Domain d => MapDescriptor d
+ Graphics.Rendering.OpenGL.GL.Evaluators: data MapDescriptor d
- Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap: class PixelMap m
+ Graphics.Rendering.OpenGL.GL.PixelRectangles.PixelMap: class PixelMap m where withNewPixelMap size act = allocaArray size $ \ p -> do { act p; components <- peekArray size p; newPixelMap components } withPixelMap m act = do { components <- getPixelMapComponents m; withArrayLen components act } newPixelMap elements = withNewPixelMap (length elements) $ flip pokeArray elements getPixelMapComponents m = withPixelMap m peekArray
- Graphics.Rendering.OpenGL.GL.Polygons: class PolygonStipple s
+ Graphics.Rendering.OpenGL.GL.Polygons: class PolygonStipple s where withNewPolygonStipple act = allocaArray numPolygonStippleBytes $ \ p -> do { act p; components <- peekArray numPolygonStippleBytes p; newPolygonStipple components } withPolygonStipple s act = do { components <- getPolygonStippleComponents s; withArray components act } newPolygonStipple components = withNewPolygonStipple $ flip pokeArray (take numPolygonStippleBytes components) getPolygonStippleComponents s = withPolygonStipple s $ peekArray numPolygonStippleBytes
- Graphics.Rendering.OpenGL.GL.VertexSpec: class (Storable a, Num a) => VertexAttribComponent a
+ Graphics.Rendering.OpenGL.GL.VertexSpec: class (Storable a, Num a) => VertexAttribComponent a where vertexAttrib1 location x = vertexAttrib4 location x 0 0 1 vertexAttrib2 location x y = vertexAttrib4 location x y 0 1 vertexAttrib3 location x y z = vertexAttrib4 location x y z 1 vertexAttrib4 location x y z w = allocaArray 4 $ \ buf -> do { poke4 buf x y z w; vertexAttrib4v location buf } vertexAttrib1N location x = vertexAttrib4N location x 0 0 1 vertexAttrib2N location x y = vertexAttrib4N location x y 0 1 vertexAttrib3N location x y z = vertexAttrib4N location x y z 1 vertexAttrib4N location x y z w = allocaArray 4 $ \ buf -> do { poke4 buf x y z w; vertexAttrib4Nv location buf } vertexAttrib1I location x = vertexAttrib4I location x 0 0 1 vertexAttrib2I location x y = vertexAttrib4I location x y 0 1 vertexAttrib3I location x y z = vertexAttrib4I location x y z 1 vertexAttrib4I location x y z w = allocaArray 4 $ \ buf -> do { poke4 buf x y z w; vertexAttrib4Iv location buf } vertexAttrib1v location = peek1M $ vertexAttrib1 location vertexAttrib2v location = peek2M $ vertexAttrib2 location vertexAttrib3v location = peek3M $ vertexAttrib3 location vertexAttrib1Nv location = peek1M $ vertexAttrib1N location vertexAttrib2Nv location = peek2M $ vertexAttrib2N location vertexAttrib3Nv location = peek3M $ vertexAttrib3N location vertexAttrib1Iv location = peek1M $ vertexAttrib1I location vertexAttrib2Iv location = peek2M $ vertexAttrib2I location vertexAttrib3Iv location = peek3M $ vertexAttrib3I location

Files

Graphics/Rendering/OpenGL/GL/Evaluators.hs view
@@ -72,7 +72,7 @@  -------------------------------------------------------------------------------- -data Domain d => MapDescriptor d =+data MapDescriptor d =    MapDescriptor (d, d) Stride Order NumComponents    deriving ( Eq, Ord, Show ) 
Graphics/Rendering/OpenGL/GL/Exception.hs view
@@ -41,9 +41,9 @@ {-# INLINE unsafeBracket_ #-} unsafeBracket_ :: IO a -> IO b -> IO c -> IO c unsafeBracket_ before after thing = do-   before+   _ <- before    r <- thing-   after+   _ <- after    return r  {-# INLINE finallyRet #-}
Graphics/Rendering/OpenGL/GL/GLboolean.hs view
@@ -26,5 +26,5 @@    False -> gl_FALSE    True -> gl_TRUE -unmarshalGLboolean :: Num a => a -> Bool+unmarshalGLboolean :: (Eq a, Num a) => a -> Bool unmarshalGLboolean = (/= fromIntegral gl_FALSE)
Graphics/Rendering/OpenGL/GL/VertexAttributes.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE DeriveDataTypeable #-} -- #hide -------------------------------------------------------------------------------- -- |@@ -35,7 +36,7 @@  -- | Texture coordinates with /t/=0, /r/=0, and /q/=1. newtype TexCoord1 a = TexCoord1 a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor TexCoord1 where    fmap f (TexCoord1 x) = TexCoord1 (f x)@@ -56,12 +57,6 @@    mapM f (TexCoord1 x) = return TexCoord1 `ap` f x    sequence (TexCoord1 x) = return TexCoord1 `ap` x -instance Typeable1 TexCoord1 where-   typeOf1 _ = mkTyConApp (mkTyCon "TexCoord1") []--instance Typeable a => Typeable (TexCoord1 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (TexCoord1 a) where    sizeOf    ~(TexCoord1 s) = sizeOf s    alignment ~(TexCoord1 s) = alignment s@@ -72,7 +67,7 @@  -- | Texture coordinates with /r/=0 and /q/=1. data TexCoord2 a = TexCoord2 !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor TexCoord2 where    fmap f (TexCoord2 x y) = TexCoord2 (f x) (f y)@@ -93,12 +88,6 @@    mapM f (TexCoord2 x y) = return TexCoord2 `ap` f x `ap` f y    sequence (TexCoord2 x y) = return TexCoord2 `ap` x `ap` y -instance Typeable1 TexCoord2 where-   typeOf1 _ = mkTyConApp (mkTyCon "TexCoord2") []--instance Typeable a => Typeable (TexCoord2 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (TexCoord2 a) where    sizeOf ~(TexCoord2 x _) = 2 * sizeOf x    alignment ~(TexCoord2 x _) = alignment x@@ -109,7 +98,7 @@  -- | Texture coordinates with /q/=1. data TexCoord3 a = TexCoord3 !a !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor TexCoord3 where    fmap f (TexCoord3 x y z) = TexCoord3 (f x) (f y) (f z)@@ -130,12 +119,6 @@    mapM f (TexCoord3 x y z) = return TexCoord3 `ap` f x `ap` f y `ap` f z    sequence (TexCoord3 x y z) = return TexCoord3 `ap` x `ap` y `ap` z -instance Typeable1 TexCoord3 where-   typeOf1 _ = mkTyConApp (mkTyCon "TexCoord3") []--instance Typeable a => Typeable (TexCoord3 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (TexCoord3 a) where    sizeOf ~(TexCoord3 x _ _) = 3 * sizeOf x    alignment ~(TexCoord3 x _ _) = alignment x@@ -146,7 +129,7 @@  -- | Fully-fledged four-dimensional texture coordinates. data TexCoord4 a = TexCoord4 !a !a !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor TexCoord4 where    fmap f (TexCoord4 x y z w) = TexCoord4 (f x) (f y) (f z) (f w)@@ -167,12 +150,6 @@    mapM f (TexCoord4 x y z w) = return TexCoord4 `ap` f x `ap` f y `ap` f z `ap` f w    sequence (TexCoord4 x y z w) = return TexCoord4 `ap` x `ap` y `ap` z `ap` w -instance Typeable1 TexCoord4 where-   typeOf1 _ = mkTyConApp (mkTyCon "TexCoord4") []--instance Typeable a => Typeable (TexCoord4 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (TexCoord4 a) where    sizeOf ~(TexCoord4 x _ _ _) = 4 * sizeOf x    alignment ~(TexCoord4 x _ _ _) = alignment x@@ -183,7 +160,7 @@  -- A three-dimensional normal. data Normal3 a = Normal3 !a !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read) +   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor Normal3 where    fmap f (Normal3 x y z) = Normal3 (f x) (f y) (f z) @@ -203,12 +180,6 @@    mapM f (Normal3 x y z) = return Normal3 `ap` f x `ap` f y `ap` f z    sequence (Normal3 x y z) = return Normal3 `ap` x `ap` y `ap` z -instance Typeable1 Normal3 where-   typeOf1 _ = mkTyConApp (mkTyCon "Normal3") []--instance Typeable a => Typeable (Normal3 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (Normal3 a) where    sizeOf ~(Normal3 x _ _) = 3 * sizeOf x    alignment ~(Normal3 x _ _) = alignment x@@ -219,7 +190,7 @@  -- | A fog coordinate. newtype FogCoord1 a = FogCoord1 a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor FogCoord1 where    fmap f (FogCoord1 x) = FogCoord1 (f x)@@ -240,12 +211,6 @@    mapM f (FogCoord1 x) = return FogCoord1 `ap` f x    sequence (FogCoord1 x) = return FogCoord1 `ap` x -instance Typeable1 FogCoord1 where-   typeOf1 _ = mkTyConApp (mkTyCon "FogCoord1") []--instance Typeable a => Typeable (FogCoord1 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (FogCoord1 a) where    sizeOf    ~(FogCoord1 s) = sizeOf s    alignment ~(FogCoord1 s) = alignment s@@ -256,7 +221,7 @@  -- An RGBA color with /A/=1. data Color3 a = Color3 !a !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor Color3 where    fmap f (Color3 x y z) = Color3 (f x) (f y) (f z)@@ -277,12 +242,6 @@    mapM f (Color3 x y z) = return Color3 `ap` f x `ap` f y `ap` f z    sequence (Color3 x y z) = return Color3 `ap` x `ap` y `ap` z -instance Typeable1 Color3 where-   typeOf1 _ = mkTyConApp (mkTyCon "Color3") []--instance Typeable a => Typeable (Color3 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (Color3 a) where    sizeOf ~(Color3 x _ _) = 3 * sizeOf x    alignment ~(Color3 x _ _) = alignment x@@ -293,7 +252,7 @@  -- | A fully-fledged RGBA color. data Color4 a = Color4 !a !a !a !a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor Color4 where    fmap f (Color4 x y z w) = Color4 (f x) (f y) (f z) (f w)@@ -314,12 +273,6 @@    mapM f (Color4 x y z w) = return Color4 `ap` f x `ap` f y `ap` f z `ap` f w    sequence (Color4 x y z w) = return Color4 `ap` x `ap` y `ap` z `ap` w -instance Typeable1 Color4 where-   typeOf1 _ = mkTyConApp (mkTyCon "Color4") []--instance Typeable a => Typeable (Color4 a) where-   typeOf = typeOfDefault- instance Storable a => Storable (Color4 a) where    sizeOf ~(Color4 x _ _ _) = 4 * sizeOf x    alignment ~(Color4 x _ _ _) = alignment x@@ -330,7 +283,7 @@  -- | A color index. newtype Index1 a = Index1 a-   deriving (Eq, Ord, Ix, Bounded, Show, Read)+   deriving (Eq, Ord, Ix, Bounded, Show, Read, Typeable)  instance Functor Index1 where    fmap f (Index1 x) = Index1 (f x)@@ -350,12 +303,6 @@    sequenceA (Index1 x) =  pure Index1 <*> x    mapM f (Index1 x) = return Index1 `ap` f x    sequence (Index1 x) = return Index1 `ap` x--instance Typeable1 Index1 where-   typeOf1 _ = mkTyConApp (mkTyCon "Index1") []--instance Typeable a => Typeable (Index1 a) where-   typeOf = typeOfDefault  instance Storable a => Storable (Index1 a) where    sizeOf    ~(Index1 s) = sizeOf s
Graphics/Rendering/OpenGL/GLU/ErrorsInternal.hs view
@@ -148,7 +148,8 @@  recordErrorCode :: GLenum -> IO () recordErrorCode e = do-   getErrorCodesAux (\es -> (if null es then [e] else [], False))+   -- We don't need the return value because this calls setRecordedErrors+   _ <- getErrorCodesAux (\es -> (if null es then [e] else [], False))    return ()  recordInvalidEnum :: IO ()
OpenGL.cabal view
@@ -1,5 +1,5 @@ name: OpenGL-version: 2.4.0.2+version: 2.5.0.0 license: BSD3 license-file: LICENSE maintainer: Jason Dagit <dagitj@gmail.com>, Sven Panne <sven.panne@aedion.de>@@ -106,7 +106,7 @@    Graphics.Rendering.OpenGL.GLU.ErrorsInternal   ghc-options: -Wall   build-depends:-   base >= 3 && < 5, OpenGLRaw >= 1.1.0.0, GLURaw >= 1.1.0.0, StateVar, ObjectName, Tensor+   base >= 3 && < 5, OpenGLRaw >= 1.1.0.0, GLURaw >= 1.1.0.0, StateVar == 1.0.*, ObjectName == 1.0.*, Tensor == 1.0.*  source-repository head   type:     git