-- This file was automatically generated.
{-# LANGUAGE CPP, ScopedTypeVariables, PatternSynonyms #-}
module Graphics.GL.Ext.NV.Fence (
  -- * Extension Support
    gl_NV_fence

  -- * GL_NV_fence
  , glDeleteFencesNV
  , glFinishFenceNV
  , glGenFencesNV
  , glGetFenceivNV
  , glIsFenceNV
  , glSetFenceNV
  , glTestFenceNV
  , pattern GL_ALL_COMPLETED_NV
  , pattern GL_FENCE_CONDITION_NV
  , pattern GL_FENCE_STATUS_NV
) 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/NV/NV_fence.txt GL_NV_fence> extension is available.

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

-- | Usage: @'glDeleteFencesNV' n fences@
--
-- The parameter @fences@ is a @FenceNV@.
--
-- The length of @fences@ should be @n@.


glDeleteFencesNV :: MonadIO m => GLsizei -> Ptr GLuint -> m ()
glDeleteFencesNV :: GLsizei -> Ptr GLuint -> m ()
glDeleteFencesNV = FunPtr (GLsizei -> Ptr GLuint -> IO ())
-> GLsizei -> Ptr GLuint -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLsizei -> Ptr GLuint -> IO ())
-> GLsizei -> Ptr GLuint -> m ()
ffisizeiPtruintIOV FunPtr (GLsizei -> Ptr GLuint -> IO ())
glDeleteFencesNVFunPtr

glDeleteFencesNVFunPtr :: FunPtr (GLsizei -> Ptr GLuint -> IO ())
glDeleteFencesNVFunPtr :: FunPtr (GLsizei -> Ptr GLuint -> IO ())
glDeleteFencesNVFunPtr = IO (FunPtr (GLsizei -> Ptr GLuint -> IO ()))
-> FunPtr (GLsizei -> Ptr GLuint -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLsizei -> Ptr GLuint -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glDeleteFencesNV")

{-# NOINLINE glDeleteFencesNVFunPtr #-}

-- | Usage: @'glFinishFenceNV' fence@
--
-- The parameter @fence@ is a @FenceNV@.


glFinishFenceNV :: MonadIO m => GLuint -> m ()
glFinishFenceNV :: GLuint -> m ()
glFinishFenceNV = FunPtr (GLuint -> IO ()) -> GLuint -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLuint -> IO ()) -> GLuint -> m ()
ffiuintIOV FunPtr (GLuint -> IO ())
glFinishFenceNVFunPtr

glFinishFenceNVFunPtr :: FunPtr (GLuint -> IO ())
glFinishFenceNVFunPtr :: FunPtr (GLuint -> IO ())
glFinishFenceNVFunPtr = IO (FunPtr (GLuint -> IO ())) -> FunPtr (GLuint -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLuint -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glFinishFenceNV")

{-# NOINLINE glFinishFenceNVFunPtr #-}

-- | Usage: @'glGenFencesNV' n fences@
--
-- The parameter @fences@ is a @FenceNV@.
--
-- The length of @fences@ should be @n@.


glGenFencesNV :: MonadIO m => GLsizei -> Ptr GLuint -> m ()
glGenFencesNV :: GLsizei -> Ptr GLuint -> m ()
glGenFencesNV = FunPtr (GLsizei -> Ptr GLuint -> IO ())
-> GLsizei -> Ptr GLuint -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLsizei -> Ptr GLuint -> IO ())
-> GLsizei -> Ptr GLuint -> m ()
ffisizeiPtruintIOV FunPtr (GLsizei -> Ptr GLuint -> IO ())
glGenFencesNVFunPtr

glGenFencesNVFunPtr :: FunPtr (GLsizei -> Ptr GLuint -> IO ())
glGenFencesNVFunPtr :: FunPtr (GLsizei -> Ptr GLuint -> IO ())
glGenFencesNVFunPtr = IO (FunPtr (GLsizei -> Ptr GLuint -> IO ()))
-> FunPtr (GLsizei -> Ptr GLuint -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLsizei -> Ptr GLuint -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glGenFencesNV")

{-# NOINLINE glGenFencesNVFunPtr #-}

-- | Usage: @'glGetFenceivNV' fence pname params@
--
-- The parameter @fence@ is a @FenceNV@.
--
-- The parameter @pname@ is a @FenceParameterNameNV@.
--
-- The length of @params@ should be @COMPSIZE(pname)@.


glGetFenceivNV :: MonadIO m => GLuint -> GLenum -> Ptr GLint -> m ()
glGetFenceivNV :: GLuint -> GLuint -> Ptr GLsizei -> m ()
glGetFenceivNV = FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ())
-> GLuint -> GLuint -> Ptr GLsizei -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ())
-> GLuint -> GLuint -> Ptr GLsizei -> m ()
ffiuintenumPtrintIOV FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ())
glGetFenceivNVFunPtr

glGetFenceivNVFunPtr :: FunPtr (GLuint -> GLenum -> Ptr GLint -> IO ())
glGetFenceivNVFunPtr :: FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ())
glGetFenceivNVFunPtr = IO (FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ()))
-> FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLuint -> GLuint -> Ptr GLsizei -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glGetFenceivNV")

{-# NOINLINE glGetFenceivNVFunPtr #-}

-- | Usage: @'glIsFenceNV' fence@
--
-- The parameter @fence@ is a @FenceNV@.


glIsFenceNV :: MonadIO m => GLuint -> m GLboolean
glIsFenceNV :: GLuint -> m GLboolean
glIsFenceNV = FunPtr (GLuint -> IO GLboolean) -> GLuint -> m GLboolean
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLuint -> IO GLboolean) -> GLuint -> m GLboolean
ffiuintIOboolean FunPtr (GLuint -> IO GLboolean)
glIsFenceNVFunPtr

glIsFenceNVFunPtr :: FunPtr (GLuint -> IO GLboolean)
glIsFenceNVFunPtr :: FunPtr (GLuint -> IO GLboolean)
glIsFenceNVFunPtr = IO (FunPtr (GLuint -> IO GLboolean))
-> FunPtr (GLuint -> IO GLboolean)
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLuint -> IO GLboolean))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glIsFenceNV")

{-# NOINLINE glIsFenceNVFunPtr #-}

-- | Usage: @'glSetFenceNV' fence condition@
--
-- The parameter @fence@ is a @FenceNV@.
--
-- The parameter @condition@ is a @FenceConditionNV@.


glSetFenceNV :: MonadIO m => GLuint -> GLenum -> m ()
glSetFenceNV :: GLuint -> GLuint -> m ()
glSetFenceNV = FunPtr (GLuint -> GLuint -> IO ()) -> GLuint -> GLuint -> m ()
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLuint -> GLuint -> IO ()) -> GLuint -> GLuint -> m ()
ffiuintenumIOV FunPtr (GLuint -> GLuint -> IO ())
glSetFenceNVFunPtr

glSetFenceNVFunPtr :: FunPtr (GLuint -> GLenum -> IO ())
glSetFenceNVFunPtr :: FunPtr (GLuint -> GLuint -> IO ())
glSetFenceNVFunPtr = IO (FunPtr (GLuint -> GLuint -> IO ()))
-> FunPtr (GLuint -> GLuint -> IO ())
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLuint -> GLuint -> IO ()))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glSetFenceNV")

{-# NOINLINE glSetFenceNVFunPtr #-}

-- | Usage: @'glTestFenceNV' fence@
--
-- The parameter @fence@ is a @FenceNV@.


glTestFenceNV :: MonadIO m => GLuint -> m GLboolean
glTestFenceNV :: GLuint -> m GLboolean
glTestFenceNV = FunPtr (GLuint -> IO GLboolean) -> GLuint -> m GLboolean
forall (m :: * -> *).
MonadIO m =>
FunPtr (GLuint -> IO GLboolean) -> GLuint -> m GLboolean
ffiuintIOboolean FunPtr (GLuint -> IO GLboolean)
glTestFenceNVFunPtr

glTestFenceNVFunPtr :: FunPtr (GLuint -> IO GLboolean)
glTestFenceNVFunPtr :: FunPtr (GLuint -> IO GLboolean)
glTestFenceNVFunPtr = IO (FunPtr (GLuint -> IO GLboolean))
-> FunPtr (GLuint -> IO GLboolean)
forall a. IO a -> a
unsafePerformIO ([Char] -> IO (FunPtr (GLuint -> IO GLboolean))
forall a. [Char] -> IO (FunPtr a)
getProcAddress "glTestFenceNV")

{-# NOINLINE glTestFenceNVFunPtr #-}

pattern $bGL_ALL_COMPLETED_NV :: a
$mGL_ALL_COMPLETED_NV :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_ALL_COMPLETED_NV = 0x84F2

pattern $bGL_FENCE_CONDITION_NV :: a
$mGL_FENCE_CONDITION_NV :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_FENCE_CONDITION_NV = 0x84F4

pattern $bGL_FENCE_STATUS_NV :: a
$mGL_FENCE_STATUS_NV :: forall r a. (Eq a, Num a) => a -> (Void# -> r) -> (Void# -> r) -> r
GL_FENCE_STATUS_NV = 0x84F3