packages feed

luminance 0.8.2.1 → 0.9

raw patch · 17 files changed

+122/−122 lines, 17 files

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.9++- Dropped `gl32` for `gl33`.+ ### 0.8.2.1  - Removed the `MonadIO` constraint on `createGeometry` as it’s already brought by `MonadResource`.
luminance.cabal view
@@ -1,5 +1,5 @@ name:                luminance-version:             0.8.2.1+version:             0.9 synopsis:            Type-safe, type-level and stateless graphics framework description:         This package exposes several modules to work with /GPUs/ in a stateless and                      type-safe way. Currently, it uses OpenGL as backend hardware technology but@@ -20,10 +20,6 @@                      .                      This library doesn’t expose any architectural patterns or designs. It’s up to                      you to design your program as you want and following your own plans.-                     .-                     In the end, as many people has asked me since the beginning of the development,-                     the OpenGL version – current is 4.5 – will be lowered. You’ll be able to choose-                     the backend to use through compilation flags. license:             BSD3 license-file:        LICENSE author:              Dimitri Sabadie <dimitri.sabadie@gmail.com>@@ -56,8 +52,8 @@   default:             False   manual:              True -flag gl32-  description:         Compile with the OpenGL 3.2 backend+flag gl33+  description:         Compile with the OpenGL 3.3 backend   default:             True   manual:              True @@ -73,8 +69,8 @@   if flag(gl45-bindless-textures)     cpp-options:       -D__GL45 -D__GL_BINDLESS_TEXTURES -  if flag(gl32)-    cpp-options:       -D__GL32+  if flag(gl33)+    cpp-options:       -D__GL33    exposed-modules:     Graphics.Luminance                      , Graphics.Luminance.Batch
src/Graphics/Luminance/Core/Buffer.hs view
@@ -51,7 +51,7 @@     pure (bid,mapped)   _ <- register . with bid $ glDeleteBuffers 1   pure (Buffer bid,mapped)-#elif defined(__GL32)+#elif defined(__GL33) mkBuffer flags size = do   (bid,mapped) <- liftIO . alloca $ \p -> do     glGenBuffers 1 p@@ -71,7 +71,7 @@     pure ptr   where     bytes = fromIntegral size-#elif defined(__GL32)+#elif defined(__GL33) createStorage bid _ size = do     glBindBuffer GL_ARRAY_BUFFER bid     glBufferData GL_ARRAY_BUFFER bytes nullPtr GL_STREAM_DRAW@@ -126,7 +126,7 @@ persistentCoherentBits :: GLbitfield #ifdef __GL45 persistentCoherentBits = GL_MAP_PERSISTENT_BIT .|. GL_MAP_COHERENT_BIT-#elif defined(__GL32)+#elif defined(__GL33) persistentCoherentBits = 0 #endif @@ -138,7 +138,7 @@   , regionSize :: Int -- number of elements living in that region   , regionBuffer :: Buffer -- buffer the region lays in   } deriving (Eq,Show)-#elif defined(__GL32)+#elif defined(__GL33) -- OpenGL 3.2 doesn’t have any support for persistent/coherent buffers, so we don’t need to store -- the pointer, as we will ask for it each time we want to do something with the buffer. data Region rw a = Region {@@ -166,7 +166,7 @@       , regionSize = fromIntegral size       , regionBuffer = buffer       }-#elif defined(__GL32)+#elif defined(__GL33)     (buffer,_) <- ask     pure $ Region {         regionOffset = offset@@ -179,7 +179,7 @@ readWhole :: (MonadIO m,Readable r,Storable a) => Region r a -> m [a] #ifdef __GL45 readWhole r = liftIO $ peekArray (regionSize r) (regionPtr r)-#elif defined(__GL32)+#elif defined(__GL33) readWhole r = liftIO $ do   glBindBuffer GL_ARRAY_BUFFER (bufferID $ regionBuffer r)   p <- glMapBufferRange GL_ARRAY_BUFFER (fromIntegral $ regionOffset r) (fromIntegral $ regionSize r) GL_MAP_READ_BIT@@ -196,7 +196,7 @@            -> m () #ifdef __GL45 writeWhole r values = liftIO . pokeArray (regionPtr r) . take (regionSize r) $ toList values-#elif defined(__GL32)+#elif defined(__GL33) writeWhole r values = liftIO $ do   glBindBuffer GL_ARRAY_BUFFER (bufferID $ regionBuffer r)   p <- glMapBufferRange GL_ARRAY_BUFFER (fromIntegral $ regionOffset r) (fromIntegral $ regionSize r) GL_MAP_WRITE_BIT@@ -218,7 +218,7 @@ (@!) :: (MonadIO m,Storable a,Readable r) => Region r a -> Word32 -> m a #ifdef __GL45 r @! i = liftIO $ peekElemOff (regionPtr r) (fromIntegral i)-#elif defined(__GL32)+#elif defined(__GL33) r @! i = liftIO $ do   glBindBuffer GL_ARRAY_BUFFER (bufferID $ regionBuffer r)   p <- glMapBufferRange GL_ARRAY_BUFFER (fromIntegral $ regionOffset r) (fromIntegral $ regionSize r) GL_MAP_READ_BIT@@ -237,7 +237,7 @@ writeAt' :: (MonadIO m,Storable a,Writable w) => Region w a -> Word32 -> a -> m () #ifdef __GL45 writeAt' r i a = liftIO $ pokeElemOff (regionPtr r) (fromIntegral i) a-#elif defined(__GL32)+#elif defined(__GL33) writeAt' r i a = liftIO $ do   glBindBuffer GL_ARRAY_BUFFER (bufferID $ regionBuffer r)   p <- glMapBufferRange GL_ARRAY_BUFFER (fromIntegral $ regionOffset r) (fromIntegral $ regionSize r) GL_MAP_WRITE_BIT
src/Graphics/Luminance/Core/Cubemap.hs view
@@ -15,12 +15,12 @@ module Graphics.Luminance.Core.Cubemap where  import Data.Proxy ( Proxy(..) )-#ifdef __GL32+#ifdef __GL33 import Data.Foldable ( for_ ) #endif import Data.Vector.Storable ( unsafeWith ) import Foreign.Ptr ( castPtr )-#ifdef __GL32+#ifdef __GL33 import Foreign.Ptr ( nullPtr ) #endif import Graphics.Luminance.Core.Texture ( BaseTexture(..), Texture(..) )@@ -64,7 +64,7 @@   textureStorage _ tid levels s =     glTextureStorage2D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral s)       (fromIntegral s)-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels s = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -78,7 +78,7 @@       unsafeWith texels $ glTextureSubImage3D tid 0 (fromIntegral x) (fromIntegral y)         (fromCubeFace f) (fromIntegral s) (fromIntegral s) 1 fmt         typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid (x,y,f) s texels = do       glBindTexture GL_TEXTURE_CUBE_MAP tid       unsafeWith texels $ glTexSubImage3D GL_TEXTURE_CUBE_MAP 0 (fromIntegral x) (fromIntegral y)@@ -98,6 +98,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid o w filling = transferTexelsSub p tid o w filling #endif
src/Graphics/Luminance/Core/CubemapArray.hs view
@@ -46,7 +46,7 @@   textureStorage _ tid levels s =     glTextureStorage3D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral s)       (fromIntegral s) (fromIntegral $ natVal (Proxy :: Proxy n))-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ _ _ = pure () #endif #ifdef __GL45@@ -58,7 +58,7 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ _ _ _ _ = pure () #endif #ifdef __GL45@@ -70,6 +70,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub _ _ _ _ _ = pure () #endif
src/Graphics/Luminance/Core/Framebuffer.hs view
@@ -92,7 +92,7 @@   if      | status == GL_FRAMEBUFFER_COMPLETE -> pure $ Framebuffer fid (Output colorTexs depthTex)     | otherwise -> throwError . fromFramebufferError . IncompleteFramebuffer $ translateFramebufferStatus status-#elif defined(__GL32)+#elif defined(__GL33) createFramebuffer w h mipmaps = do   fid <- liftIO . alloca $ \p -> do     debugGL $ glGenFramebuffers 1 p@@ -181,7 +181,7 @@     debugGL $ glNamedFramebufferDrawBuffer fid GL_NONE     debugGL $ glNamedFramebufferReadBuffer fid GL_NONE   _ -> setFramebufferColorRW fid colorOutputNb (Proxy :: Proxy rw)-#elif defined(__GL32)+#elif defined(__GL33) setColorBuffers fid colorOutputNb _ = case colorOutputNb of   0 -> do     -- disable color outputs@@ -220,7 +220,7 @@   renderbuffer <- createRenderbuffer w h (Proxy :: Proxy Depth32F)   debugGL $ glNamedFramebufferRenderbuffer fid (fromAttachment DepthAttachment) GL_RENDERBUFFER     (renderbufferID renderbuffer)-#elif defined(__GL32)+#elif defined(__GL33) setDepthRenderbuffer _ w h = do   renderbuffer <- createRenderbuffer w h (Proxy :: Proxy Depth32F)   debugGL $ glFramebufferRenderbuffer GL_FRAMEBUFFER (fromAttachment DepthAttachment) GL_RENDERBUFFER@@ -239,7 +239,7 @@   setFramebufferColorRW fid nb _ = liftIO $ do     withArrayLen (colorAttachmentsFromMax nb) $ \n buffers ->       debugGL $ glNamedFramebufferDrawBuffers fid (fromIntegral n) buffers-#elif defined(__GL32)+#elif defined(__GL33)   setFramebufferColorRW _ nb _ = liftIO $ do     withArrayLen (colorAttachmentsFromMax nb) $ \n buffers ->       debugGL $ glDrawBuffers (fromIntegral n) buffers@@ -250,7 +250,7 @@   setFramebufferColorRW fid nb _ = liftIO $ do     withArrayLen (colorAttachmentsFromMax nb) $ \n buffers ->       debugGL $ glNamedFramebufferDrawBuffers fid (fromIntegral n) buffers-#elif defined(__GL32)+#elif defined(__GL33)   setFramebufferColorRW _ nb _ = liftIO $ do     withArrayLen (colorAttachmentsFromMax nb) $ \n buffers ->       debugGL $ glDrawBuffers (fromIntegral n) buffers@@ -290,7 +290,7 @@   debugGL . liftIO $ glNamedFramebufferTexture fid (fromAttachment ca)     (baseTextureID $ texture2DBase tex) 0   pure tex-#elif defined(__GL32)+#elif defined(__GL33) addOutput _ ca w h mipmaps _ = do   tex :: Texture2D p <- createTexture (w,h) mipmaps defaultSampling   debugGL . liftIO $ glFramebufferTexture GL_FRAMEBUFFER (fromAttachment ca)@@ -345,7 +345,7 @@ framebufferBlit src dst srcX srcY srcW srcH dstX dstY dstW dstH mask flt = liftIO . debugGL $     glBlitNamedFramebuffer (framebufferID src) (framebufferID dst) srcX0 srcY0 srcX1 srcY1 dstX0       dstY0 dstX1 dstY1 (fromFramebufferBlitMask mask) (fromFilter flt)-#elif defined(__GL32)+#elif defined(__GL33) framebufferBlit src dst srcX srcY srcW srcH dstX dstY dstW dstH mask flt =     liftIO . debugGL $ do       glBindFramebuffer GL_READ_FRAMEBUFFER (framebufferID src)
src/Graphics/Luminance/Core/Geometry.hs view
@@ -102,7 +102,7 @@   where     vertNb = length vertices     mode'  = fromGeometryMode mode-#elif defined(__GL32)+#elif defined(__GL33) createGeometry vertices indices mode = do     -- create the vertex array object (OpenGL-side)     vid <- liftIO . alloca $ \p -> do
src/Graphics/Luminance/Core/Renderbuffer.hs view
@@ -34,7 +34,7 @@     pure rid   _ <- register $ with rid (glDeleteRenderbuffers 1)   pure (Renderbuffer rid)-#elif defined(__GL32)+#elif defined(__GL33) createRenderbuffer w h depthProxy = do   rid <- liftIO . alloca $ \p -> do     glGenRenderbuffers 1 p
src/Graphics/Luminance/Core/Shader/Program.hs view
@@ -273,7 +273,7 @@ instance Uniform Int32 where #ifdef __GL45   toU prog l = pure $ U (glProgramUniform1i prog l)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure $ U (glUniform1i l) #endif @@ -281,14 +281,14 @@ instance Uniform (Int32,Int32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y) -> glProgramUniform2i prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y) -> glUniform2i l x y #endif  instance Uniform (V2 Int32) where #ifdef __GL45   toU prog l = pure . U $ \(V2 x y) -> glProgramUniform2i prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V2 x y) -> glUniform2i l x y #endif @@ -297,7 +297,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y] -> glProgramUniform2i prog l x y     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y] -> glUniform2i l x y     _ -> pure ()@@ -307,14 +307,14 @@ instance Uniform (Int32,Int32,Int32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z) -> glProgramUniform3i prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z) -> glUniform3i l x y z #endif  instance Uniform (V3 Int32) where #ifdef __GL45   toU prog l = pure . U $ \(V3 x y z) -> glProgramUniform3i prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V3 x y z) -> glUniform3i l x y z #endif @@ -323,7 +323,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glProgramUniform3i prog l x y z     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glUniform3i l x y z     _ -> pure ()@@ -333,14 +333,14 @@ instance Uniform (Int32,Int32,Int32,Int32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z,w) -> glProgramUniform4i prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z,w) -> glUniform4i l x y z w #endif  instance Uniform (V4 Int32) where #ifdef __GL45   toU prog l = pure . U $ \(V4 x y z w) -> glProgramUniform4i prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V4 x y z w) -> glUniform4i l x y z w #endif @@ -349,7 +349,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glProgramUniform4i prog l x y z w     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glUniform4i l x y z w     _ -> pure ()@@ -359,7 +359,7 @@ instance Uniform [Int32] where #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ glProgramUniform1iv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ glUniform1iv l . fromIntegral #endif @@ -368,7 +368,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glProgramUniform2iv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glUniform2iv l . fromIntegral #endif@@ -377,7 +377,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2iv l (fromIntegral size) (castPtr p) #endif@@ -386,7 +386,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2iv l (fromIntegral size) (castPtr p) #endif@@ -396,7 +396,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glProgramUniform3iv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glUniform3iv l . fromIntegral #endif@@ -405,7 +405,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3iv l (fromIntegral size) (castPtr p) #endif@@ -414,7 +414,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3iv l (fromIntegral size) (castPtr p) #endif@@ -424,7 +424,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glProgramUniform4iv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glUniform4iv l . fromIntegral #endif@@ -433,7 +433,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4iv l (fromIntegral size) (castPtr p) #endif@@ -442,7 +442,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4iv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4iv l (fromIntegral size) (castPtr p) #endif@@ -454,7 +454,7 @@ instance Uniform Word32 where #ifdef __GL45   toU prog l = pure . U $ glProgramUniform1ui prog l-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ glUniform1ui l #endif @@ -462,14 +462,14 @@ instance Uniform (Word32,Word32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y) -> glProgramUniform2ui prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y) -> glUniform2ui l x y #endif  instance Uniform (V2 Word32) where #ifdef __GL45   toU prog l = pure . U $ \(V2 x y) -> glProgramUniform2ui prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V2 x y) -> glUniform2ui l x y #endif @@ -478,7 +478,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y] -> glProgramUniform2ui prog l x y     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y] -> glUniform2ui l x y     _ -> pure ()@@ -488,14 +488,14 @@ instance Uniform (Word32,Word32,Word32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z) -> glProgramUniform3ui prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z) -> glUniform3ui l x y z #endif  instance Uniform (V3 Word32) where #ifdef __GL45   toU prog l = pure . U $ \(V3 x y z) -> glProgramUniform3ui prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V3 x y z) -> glUniform3ui l x y z #endif @@ -504,7 +504,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glProgramUniform3ui prog l x y z     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glUniform3ui l x y z     _ -> pure ()@@ -514,14 +514,14 @@ instance Uniform (Word32,Word32,Word32,Word32) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z,w) -> glProgramUniform4ui prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z,w) -> glUniform4ui l x y z w #endif  instance Uniform (V4 Word32) where #ifdef __GL45   toU prog l = pure . U $ \(V4 x y z w) -> glProgramUniform4ui prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V4 x y z w) -> glUniform4ui l x y z w #endif @@ -530,7 +530,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glProgramUniform4ui prog l x y z w     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glUniform4ui l x y z w     _ -> pure ()@@ -541,7 +541,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $     glProgramUniform1uiv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $     glUniform1uiv l . fromIntegral #endif@@ -551,7 +551,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glProgramUniform2uiv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glUniform2uiv l . fromIntegral #endif@@ -560,7 +560,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2uiv l (fromIntegral size) (castPtr p) #endif@@ -569,7 +569,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2uiv l (fromIntegral size) (castPtr p) #endif@@ -579,7 +579,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glProgramUniform3uiv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glUniform3uiv l . fromIntegral #endif@@ -588,7 +588,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3uiv l (fromIntegral size) (castPtr p) #endif@@ -597,7 +597,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3uiv l (fromIntegral size) (castPtr p) #endif@@ -607,7 +607,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glProgramUniform4uiv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glUniform4uiv l . fromIntegral #endif@@ -616,7 +616,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4uiv l (fromIntegral size) (castPtr p) #endif@@ -625,7 +625,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4uiv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4uiv l (fromIntegral size) (castPtr p) #endif@@ -637,7 +637,7 @@ instance Uniform Float where #ifdef __GL45   toU prog l = pure . U $ glProgramUniform1f prog l-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ glUniform1f l #endif @@ -645,14 +645,14 @@ instance Uniform (Float,Float) where #ifdef __GL45   toU prog l = pure . U $ \(x,y) -> glProgramUniform2f prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y) -> glUniform2f l x y #endif  instance Uniform (V2 Float) where #ifdef __GL45   toU prog l = pure . U $ \(V2 x y) -> glProgramUniform2f prog l x y-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V2 x y) -> glUniform2f l x y #endif @@ -661,7 +661,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y] -> glProgramUniform2f prog l x y     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y] -> glUniform2f l x y     _ -> pure ()@@ -671,14 +671,14 @@ instance Uniform (Float,Float,Float) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z) -> glProgramUniform3f prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z) -> glUniform3f l x y z #endif  instance Uniform (V3 Float) where #ifdef __GL45   toU prog l = pure . U $ \(V3 x y z) -> glProgramUniform3f prog l x y z-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V3 x y z) -> glUniform3f l x y z #endif @@ -687,7 +687,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glProgramUniform3f prog l x y z     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z] -> glUniform3f l x y z     _ -> pure ()@@ -697,14 +697,14 @@ instance Uniform (Float,Float,Float,Float) where #ifdef __GL45   toU prog l = pure . U $ \(x,y,z,w) -> glProgramUniform4f prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(x,y,z,w) -> glUniform4f l x y z w #endif  instance Uniform (V4 Float) where #ifdef __GL45   toU prog l = pure . U $ \(V4 x y z w) -> glProgramUniform4f prog l x y z w-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V4 x y z w) -> glUniform4f l x y z w #endif @@ -713,7 +713,7 @@   toU prog l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glProgramUniform4f prog l x y z w     _ -> pure ()-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \(V v) -> case toList v of     [x,y,z,w] -> glUniform4f l x y z w     _ -> pure ()@@ -724,7 +724,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $     glProgramUniform1fv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $     glUniform1fv l . fromIntegral #endif@@ -734,7 +734,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glProgramUniform2fv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unPair v) $     glUniform2fv l . fromIntegral #endif@@ -743,7 +743,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2fv l (fromIntegral size) (castPtr p) #endif@@ -752,7 +752,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform2fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform2fv l (fromIntegral size) (castPtr p) #endif@@ -762,7 +762,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glProgramUniform3fv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unTriple v) $     glUniform3fv l . fromIntegral #endif@@ -771,7 +771,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3fv l (fromIntegral size) (castPtr p) #endif@@ -780,7 +780,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform3fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform3fv l (fromIntegral size) (castPtr p) #endif@@ -790,7 +790,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glProgramUniform4fv prog l . fromIntegral-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen (concatMap unQuad v) $     glUniform4fv l . fromIntegral #endif@@ -799,7 +799,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4fv l (fromIntegral size) (castPtr p) #endif@@ -808,7 +808,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniform4fv prog l (fromIntegral size) (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniform4fv l (fromIntegral size) (castPtr p) #endif@@ -818,7 +818,7 @@ instance Uniform (M44 Float) where #ifdef __GL45   toU prog l = pure . U $ \v -> with v $ glProgramUniformMatrix4fv prog l 1 GL_FALSE . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> with v $ glUniformMatrix4fv l 1 GL_FALSE . castPtr #endif @@ -826,7 +826,7 @@ #ifdef __GL45   toU prog l = pure . U $ \v -> withArrayLen v $ \size p ->     glProgramUniformMatrix4fv prog l (fromIntegral size) GL_FALSE (castPtr p)-#elif defined(__GL32)+#elif defined(__GL33)   toU _ l = pure . U $ \v -> withArrayLen v $ \size p ->     glUniformMatrix4fv l (fromIntegral size) GL_FALSE (castPtr p) #endif@@ -846,7 +846,7 @@  instance Uniform (Cubemap f) where   toU prog l = pure . U $ glProgramUniformHandleui64ARB prog l . baseTextureHnd . cubemapBase-#elif defined(__GL32)+#elif defined(__GL33) instance (Pixel f) => Uniform (Texture1D f) where   toU = toUTex   
src/Graphics/Luminance/Core/Shader/Stage.hs view
@@ -110,8 +110,8 @@ prependGLSLPragma src = #if defined(__GL45)      "#version 450 core\n"-#elif defined(__GL32)-     "#version 150 core\n"+#elif defined(__GL33)+     "#version 330 core\n" #endif #if defined(__GL_BINDLESS_TEXTURES)   ++ "#extension GL_ARB_bindless_texture : require\n"
src/Graphics/Luminance/Core/Texture.hs view
@@ -131,7 +131,7 @@     baseTextureID  :: GLuint   , baseTextureHnd :: GLuint64   } deriving (Eq,Show)-#elif defined(__GL32)+#elif defined(__GL33) newtype BaseTexture = BaseTexture {     baseTextureID  :: GLuint   } deriving (Eq,Show)@@ -160,7 +160,7 @@     debugGL $ glMakeTextureHandleNonResidentARB texH     with tid (glDeleteTextures 1)   pure $ fromBaseTexture (BaseTexture tid texH) size-#elif defined(__GL32)+#elif defined(__GL33) createTexture size levels sampling = do     tid <- liftIO . alloca $ \p -> do       debugGL $ glGenTextures 1 p@@ -233,7 +233,7 @@ setTextureSampling :: (MonadIO m) => GLenum -> Sampling -> m () #ifdef __GL45 setTextureSampling = setSampling glTextureParameteri-#elif defined(__GL32)+#elif defined(__GL33) setTextureSampling = setSampling glTexParameteri #endif @@ -276,7 +276,7 @@     transferTexelsSub (Proxy :: Proxy t) tid offset size texels #ifdef __GL45     debugGL . when autolvl $ glGenerateTextureMipmap tid-#elif defined(__GL32)+#elif defined(__GL33)     debugGL . when autolvl $ glGenerateMipmap (textureTypeEnum (Proxy :: Proxy t)) #endif   where@@ -294,7 +294,7 @@     fillTextureSub (Proxy :: Proxy t) tid offset size filling #ifdef __GL45     debugGL . when autolvl $ glGenerateTextureMipmap tid-#elif defined(__GL32)+#elif defined(__GL33)     debugGL . when autolvl $ glGenerateMipmap (textureTypeEnum (Proxy :: Proxy t)) #endif   where
src/Graphics/Luminance/Core/Texture1D.hs view
@@ -39,7 +39,7 @@ #ifdef __GL45   textureStorage _ tid levels w =     glTextureStorage1D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral w)-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels w = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -51,7 +51,7 @@   transferTexelsSub _ tid x w texels =       unsafeWith texels $ glTextureSubImage1D tid 0 (fromIntegral x) (fromIntegral w) fmt         typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid x w texels = do       glBindTexture GL_TEXTURE_1D tid       unsafeWith texels $ glTexSubImage1D GL_TEXTURE_1D 0 (fromIntegral x) (fromIntegral w) fmt@@ -69,6 +69,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid x w filling = transferTexelsSub p tid x w filling #endif
src/Graphics/Luminance/Core/Texture1DArray.hs view
@@ -44,7 +44,7 @@   textureStorage _ tid levels w =     glTextureStorage2D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral w)       (fromIntegral $ natVal (Proxy :: Proxy n))-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels w = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -57,7 +57,7 @@   transferTexelsSub _ tid (layer,x) w texels =       unsafeWith texels $ glTextureSubImage2D tid 0 (fromIntegral x) (fromIntegral w) (fromIntegral layer) 1 fmt         typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid (layer,x) w texels = do       glBindTexture GL_TEXTURE_1D_ARRAY tid       unsafeWith texels $ glTexSubImage2D GL_TEXTURE_1D_ARRAY 0 (fromIntegral x) (fromIntegral w) (fromIntegral layer) 1 fmt@@ -75,6 +75,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid o w filling = transferTexelsSub p tid o w filling #endif
src/Graphics/Luminance/Core/Texture2D.hs view
@@ -41,7 +41,7 @@ #if defined(__GL45)   textureStorage _ tid levels (w,h) =     debugGL $ glTextureStorage2D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral w) (fromIntegral h)-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels (w,h) = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -54,7 +54,7 @@   transferTexelsSub _ tid (x,y) (w,h) texels =       debugGL . unsafeWith texels $ glTextureSubImage2D tid 0 (fromIntegral x) (fromIntegral y)         (fromIntegral w) (fromIntegral h) fmt typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid (x,y) (w,h) texels = do       debugGL $ glBindTexture GL_TEXTURE_2D tid       debugGL . unsafeWith texels $ glTexSubImage2D GL_TEXTURE_2D 0 (fromIntegral x) (fromIntegral y)@@ -72,6 +72,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid o w filling = transferTexelsSub p tid o w filling #endif
src/Graphics/Luminance/Core/Texture2DArray.hs view
@@ -45,7 +45,7 @@   textureStorage _ tid levels (w,h) =     glTextureStorage3D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral w)       (fromIntegral h) (fromIntegral $ natVal (Proxy :: Proxy n))-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels (w,h) = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -58,7 +58,7 @@   transferTexelsSub _ tid (layer,x,y) (w,h) texels =       unsafeWith texels $ glTextureSubImage3D tid 0 (fromIntegral x) (fromIntegral y)         (fromIntegral layer) (fromIntegral w) (fromIntegral h) 1 fmt typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid (layer,x,y) (w,h) texels = do       glBindTexture GL_TEXTURE_2D_ARRAY tid       unsafeWith texels $ glTexSubImage3D GL_TEXTURE_2D_ARRAY 0 (fromIntegral x) (fromIntegral y)@@ -76,6 +76,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid o w filling = transferTexelsSub p tid o w filling #endif
src/Graphics/Luminance/Core/Texture3D.hs view
@@ -42,7 +42,7 @@   textureStorage _ tid levels (w,h,d) =     glTextureStorage3D tid levels (pixelIFormat (Proxy :: Proxy f)) (fromIntegral w)       (fromIntegral h) (fromIntegral d)-#elif defined(__GL32)+#elif defined(__GL33)   textureStorage _ _ levels (w,h,d) = do       for_ [0..levels-1] $ \lvl -> do         let divisor = 2 ^ lvl@@ -55,7 +55,7 @@   transferTexelsSub _ tid (x,y,z) (w,h,d) texels =       unsafeWith texels $ glTextureSubImage3D tid 0 (fromIntegral x) (fromIntegral y)         (fromIntegral z) (fromIntegral w) (fromIntegral h) (fromIntegral d) fmt typ . castPtr-#elif defined(__GL32)+#elif defined(__GL33)   transferTexelsSub _ tid (x,y,z) (w,h,d) texels = do       glBindTexture GL_TEXTURE_3D tid       unsafeWith texels $ glTexSubImage3D GL_TEXTURE_3D 0 (fromIntegral x) (fromIntegral y)@@ -73,6 +73,6 @@       proxy = Proxy :: Proxy f       fmt = pixelFormat proxy       typ = pixelType proxy-#elif defined(__GL32)+#elif defined(__GL33)   fillTextureSub p tid o w filling = transferTexelsSub p tid o w filling #endif
src/Graphics/Luminance/Core/Vertex.hs view
@@ -31,7 +31,7 @@ import Data.Proxy ( Proxy(..) ) import Data.Word ( Word32 ) import Foreign.Storable ( Storable(sizeOf) )-#ifdef __GL32+#ifdef __GL33 import Foreign.Ptr ( nullPtr ) #endif import GHC.TypeLits ( KnownNat, natVal )@@ -80,7 +80,7 @@     glVertexArrayAttribFormat vid index (fromIntegral $ natVal (Proxy :: Proxy n)) (vertexGLType (Proxy :: Proxy a)) GL_FALSE offset     glVertexArrayAttribBinding vid index vertexBindingIndex     glEnableVertexArrayAttrib vid index-#elif defined(__GL32)+#elif defined(__GL33)   setFormatV _ index offset _ = do     glVertexAttribPointer index (fromIntegral $ natVal (Proxy :: Proxy n)) (vertexGLType (Proxy :: Proxy a)) GL_FALSE (fromIntegral offset) nullPtr     glEnableVertexAttribArray index