-- GENERATED by C->Haskell Compiler, version 0.28.3 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/NanoVG/Internal/GLES3.chs" #-}
module NanoVG.Internal.GLES3 where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp



import qualified Data.Set as S
import           Data.Word
import           Foreign.C.Types

import           NanoVG.Internal.CreateContext
import           NanoVG.Internal.Types
import           NanoVG.Internal.Context
import           NanoVG.Internal.FFIHelpers

-- For now only the GL3 and GLES3 backends are supported

-- We need to include this to define GLuint




createGLES3 :: (S.Set CreateFlags) -> IO ((Context))
createGLES3 a1 =
  let {a1' = bitMask a1} in
  createGLES3'_ a1' >>= \res ->
  let {res' = fromPointer res} in
  return (res')

{-# LINE 24 "src/NanoVG/Internal/GLES3.chs" #-}

deleteGLES3 :: (Context) -> IO ((Context))
deleteGLES3 a1 =
  let {a1' = toPointer a1} in
  deleteGLES3'_ a1' >>
  let {a1'' = fromPointer  a1'} in
  return (a1'')

{-# LINE 26 "src/NanoVG/Internal/GLES3.chs" #-}


createImageFromHandleGLES3 :: (Context) -> (GLuint) -> (CInt) -> (CInt) -> (CreateFlags) -> IO ((Image), (Context), (CreateFlags))
createImageFromHandleGLES3 a1 a2 a3 a4 a5 =
  let {a1' = toPointer a1} in
  let {a2' = fromIntegral a2} in
  let {a3' = fromIntegral a3} in
  let {a4' = fromIntegral a4} in
  let {a5' = toCInt a5} in
  createImageFromHandleGLES3'_ a1' a2' a3' a4' a5' >>= \res ->
  let {res' = Image res} in
  let {a1'' = fromPointer  a1'} in
  let {a5'' = fromCInt  a5'} in
  return (res', a1'', a5'')

{-# LINE 34 "src/NanoVG/Internal/GLES3.chs" #-}


imageHandleGLES3 :: (Context) -> (Image) -> IO ((GLuint), (Context))
imageHandleGLES3 a1 a2 =
  let {a1' = toPointer a1} in
  let {a2' = imageHandle a2} in
  imageHandleGLES3'_ a1' a2' >>= \res ->
  let {res' = fromIntegral res} in
  let {a1'' = fromPointer  a1'} in
  return (res', a1'')

{-# LINE 39 "src/NanoVG/Internal/GLES3.chs" #-}


foreign import ccall unsafe "NanoVG/Internal/GLES3.chs.h nvgCreateGLES3"
  createGLES3'_ :: (C2HSImp.CInt -> (IO (C2HSImp.Ptr ())))

foreign import ccall unsafe "NanoVG/Internal/GLES3.chs.h nvgDeleteGLES3"
  deleteGLES3'_ :: ((C2HSImp.Ptr ()) -> (IO ()))

foreign import ccall unsafe "NanoVG/Internal/GLES3.chs.h nvglCreateImageFromHandleGLES3"
  createImageFromHandleGLES3'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CUInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (C2HSImp.CInt -> (IO C2HSImp.CInt))))))

foreign import ccall unsafe "NanoVG/Internal/GLES3.chs.h nvglImageHandleGLES3"
  imageHandleGLES3'_ :: ((C2HSImp.Ptr ()) -> (C2HSImp.CInt -> (IO C2HSImp.CUInt)))