-- This file was automatically generated.
{-# LANGUAGE CPP, ScopedTypeVariables, PatternSynonyms #-}
module Graphics.GL.Ext.EXT.MapBufferRange (
  -- * Extension Support
    gl_EXT_map_buffer_range

  -- * GL_EXT_map_buffer_range
  , glFlushMappedBufferRangeEXT
  , glMapBufferRangeEXT
  , pattern GL_MAP_FLUSH_EXPLICIT_BIT_EXT
  , pattern GL_MAP_INVALIDATE_BUFFER_BIT_EXT
  , pattern GL_MAP_INVALIDATE_RANGE_BIT_EXT
  , pattern GL_MAP_READ_BIT_EXT
  , pattern GL_MAP_UNSYNCHRONIZED_BIT_EXT
  , pattern GL_MAP_WRITE_BIT_EXT
) where

import Control.Monad.IO.Class
import Data.Set
import Foreign.Ptr
import Graphics.GL.Internal.FFI
import Graphics.GL.Internal.Proc
import Graphics.GL.Types
import System.IO.Unsafe

-- | Checks that the <https://www.khronos.org/registry/gles/extensions/EXT/EXT_map_buffer_range.txt GL_EXT_map_buffer_range> extension is available.

gl_EXT_map_buffer_range :: Bool
gl_EXT_map_buffer_range :: Bool
gl_EXT_map_buffer_range = [Char] -> Set [Char] -> Bool
forall a. Ord a => a -> Set a -> Bool
member "GL_EXT_map_buffer_range" Set [Char]
extensions
{-# NOINLINE gl_EXT_map_buffer_range #-}

-- | Usage: @'glFlushMappedBufferRangeEXT' target offset length@
--
-- This command is an alias for 'Graphics.GL.Internal.Shared.glFlushMappedBufferRange'.


glFlushMappedBufferRangeEXT :: MonadIO m => GLenum -> GLintptr -> GLsizeiptr -> m ()
glFlushMappedBufferRangeEXT :: GLenum -> GLintptr -> GLintptr -> m ()
glFlushMappedBufferRangeEXT = FunPtr (GLenum -> GLintptr -> GLintptr -> IO ())
-> GLenum -> GLintptr -> GLintptr -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLenum -> GLintptr -> GLintptr -> IO ())
-> GLenum -> GLintptr -> GLintptr -> m ()
ffienumintptrsizeiptrIOV FunPtr (GLenum -> GLintptr -> GLintptr -> IO ())
glFlushMappedBufferRangeEXTFunPtr

glFlushMappedBufferRangeEXTFunPtr :: FunPtr (GLenum -> GLintptr -> GLsizeiptr -> IO ())
glFlushMappedBufferRangeEXTFunPtr :: FunPtr (GLenum -> GLintptr -> GLintptr -> IO ())
glFlushMappedBufferRangeEXTFunPtr = IO (FunPtr (GLenum -> GLintptr -> GLintptr -> IO ()))
-> FunPtr (GLenum -> GLintptr -> GLintptr -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLenum -> GLintptr -> GLintptr -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glFlushMappedBufferRangeEXT")

{-# NOINLINE glFlushMappedBufferRangeEXTFunPtr #-}

-- | Usage: @'glMapBufferRangeEXT' target offset length access@
--
-- This command is an alias for 'Graphics.GL.Internal.Shared.glMapBufferRange'.


glMapBufferRangeEXT :: MonadIO m => GLenum -> GLintptr -> GLsizeiptr -> GLbitfield -> m (Ptr ())
glMapBufferRangeEXT :: GLenum -> GLintptr -> GLintptr -> GLenum -> m (Ptr ())
glMapBufferRangeEXT = FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ()))
-> GLenum -> GLintptr -> GLintptr -> GLenum -> m (Ptr ())
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ()))
-> GLenum -> GLintptr -> GLintptr -> GLenum -> m (Ptr ())
ffienumintptrsizeiptrbitfieldIOPtrV FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ()))
glMapBufferRangeEXTFunPtr

glMapBufferRangeEXTFunPtr :: FunPtr (GLenum -> GLintptr -> GLsizeiptr -> GLbitfield -> IO (Ptr ()))
glMapBufferRangeEXTFunPtr :: FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ()))
glMapBufferRangeEXTFunPtr = IO
  (FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ())))
-> FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ()))
forall a. IO a -> a
unsafePerformIO ([Char]
-> IO
     (FunPtr (GLenum -> GLintptr -> GLintptr -> GLenum -> IO (Ptr ())))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glMapBufferRangeEXT")

{-# NOINLINE glMapBufferRangeEXTFunPtr #-}

pattern $bGL_MAP_FLUSH_EXPLICIT_BIT_EXT :: a
$mGL_MAP_FLUSH_EXPLICIT_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_FLUSH_EXPLICIT_BIT_EXT = 0x0010

pattern $bGL_MAP_INVALIDATE_BUFFER_BIT_EXT :: a
$mGL_MAP_INVALIDATE_BUFFER_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_INVALIDATE_BUFFER_BIT_EXT = 0x0008

pattern $bGL_MAP_INVALIDATE_RANGE_BIT_EXT :: a
$mGL_MAP_INVALIDATE_RANGE_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_INVALIDATE_RANGE_BIT_EXT = 0x0004

pattern $bGL_MAP_READ_BIT_EXT :: a
$mGL_MAP_READ_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_READ_BIT_EXT = 0x0001

pattern $bGL_MAP_UNSYNCHRONIZED_BIT_EXT :: a
$mGL_MAP_UNSYNCHRONIZED_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_UNSYNCHRONIZED_BIT_EXT = 0x0020

pattern $bGL_MAP_WRITE_BIT_EXT :: a
$mGL_MAP_WRITE_BIT_EXT :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_MAP_WRITE_BIT_EXT = 0x0002