module GI.Gdk.Objects.GLContext
(
GLContext(..) ,
IsGLContext ,
toGLContext ,
noGLContext ,
gLContextClearCurrent ,
gLContextGetCurrent ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetDebugEnabledMethodInfo ,
#endif
gLContextGetDebugEnabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetDisplayMethodInfo ,
#endif
gLContextGetDisplay ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetForwardCompatibleMethodInfo ,
#endif
gLContextGetForwardCompatible ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetRequiredVersionMethodInfo ,
#endif
gLContextGetRequiredVersion ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetSharedContextMethodInfo ,
#endif
gLContextGetSharedContext ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetUseEsMethodInfo ,
#endif
gLContextGetUseEs ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetVersionMethodInfo ,
#endif
gLContextGetVersion ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextGetWindowMethodInfo ,
#endif
gLContextGetWindow ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextIsLegacyMethodInfo ,
#endif
gLContextIsLegacy ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextMakeCurrentMethodInfo ,
#endif
gLContextMakeCurrent ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextRealizeMethodInfo ,
#endif
gLContextRealize ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextSetDebugEnabledMethodInfo ,
#endif
gLContextSetDebugEnabled ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextSetForwardCompatibleMethodInfo ,
#endif
gLContextSetForwardCompatible ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextSetRequiredVersionMethodInfo ,
#endif
gLContextSetRequiredVersion ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextSetUseEsMethodInfo ,
#endif
gLContextSetUseEs ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextDisplayPropertyInfo ,
#endif
constructGLContextDisplay ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
gLContextDisplay ,
#endif
getGLContextDisplay ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextSharedContextPropertyInfo ,
#endif
constructGLContextSharedContext ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
gLContextSharedContext ,
#endif
getGLContextSharedContext ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
GLContextWindowPropertyInfo ,
#endif
constructGLContextWindow ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
gLContextWindow ,
#endif
getGLContextWindow ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Objects.Window as Gdk.Window
newtype GLContext = GLContext (ManagedPtr GLContext)
foreign import ccall "gdk_gl_context_get_type"
c_gdk_gl_context_get_type :: IO GType
instance GObject GLContext where
gobjectType _ = c_gdk_gl_context_get_type
class GObject o => IsGLContext o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError GLContext a) =>
IsGLContext a
#endif
instance IsGLContext GLContext
instance GObject.Object.IsObject GLContext
toGLContext :: (MonadIO m, IsGLContext o) => o -> m GLContext
toGLContext = liftIO . unsafeCastTo GLContext
noGLContext :: Maybe GLContext
noGLContext = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveGLContextMethod (t :: Symbol) (o :: *) :: * where
ResolveGLContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveGLContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveGLContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveGLContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveGLContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveGLContextMethod "isLegacy" o = GLContextIsLegacyMethodInfo
ResolveGLContextMethod "makeCurrent" o = GLContextMakeCurrentMethodInfo
ResolveGLContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveGLContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveGLContextMethod "realize" o = GLContextRealizeMethodInfo
ResolveGLContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveGLContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveGLContextMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveGLContextMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveGLContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveGLContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveGLContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveGLContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveGLContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveGLContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveGLContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveGLContextMethod "getDebugEnabled" o = GLContextGetDebugEnabledMethodInfo
ResolveGLContextMethod "getDisplay" o = GLContextGetDisplayMethodInfo
ResolveGLContextMethod "getForwardCompatible" o = GLContextGetForwardCompatibleMethodInfo
ResolveGLContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveGLContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveGLContextMethod "getRequiredVersion" o = GLContextGetRequiredVersionMethodInfo
ResolveGLContextMethod "getSharedContext" o = GLContextGetSharedContextMethodInfo
ResolveGLContextMethod "getUseEs" o = GLContextGetUseEsMethodInfo
ResolveGLContextMethod "getVersion" o = GLContextGetVersionMethodInfo
ResolveGLContextMethod "getWindow" o = GLContextGetWindowMethodInfo
ResolveGLContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveGLContextMethod "setDebugEnabled" o = GLContextSetDebugEnabledMethodInfo
ResolveGLContextMethod "setForwardCompatible" o = GLContextSetForwardCompatibleMethodInfo
ResolveGLContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveGLContextMethod "setRequiredVersion" o = GLContextSetRequiredVersionMethodInfo
ResolveGLContextMethod "setUseEs" o = GLContextSetUseEsMethodInfo
ResolveGLContextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGLContextMethod t GLContext, O.MethodInfo info GLContext p) => O.IsLabelProxy t (GLContext -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveGLContextMethod t GLContext, O.MethodInfo info GLContext p) => O.IsLabel t (GLContext -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
getGLContextDisplay :: (MonadIO m, IsGLContext o) => o -> m (Maybe Gdk.Display.Display)
getGLContextDisplay obj = liftIO $ getObjectPropertyObject obj "display" Gdk.Display.Display
constructGLContextDisplay :: (IsGLContext o, Gdk.Display.IsDisplay a) => a -> IO (GValueConstruct o)
constructGLContextDisplay val = constructObjectPropertyObject "display" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextDisplayPropertyInfo
instance AttrInfo GLContextDisplayPropertyInfo where
type AttrAllowedOps GLContextDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint GLContextDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrBaseTypeConstraint GLContextDisplayPropertyInfo = IsGLContext
type AttrGetType GLContextDisplayPropertyInfo = (Maybe Gdk.Display.Display)
type AttrLabel GLContextDisplayPropertyInfo = "display"
type AttrOrigin GLContextDisplayPropertyInfo = GLContext
attrGet _ = getGLContextDisplay
attrSet _ = undefined
attrConstruct _ = constructGLContextDisplay
attrClear _ = undefined
#endif
getGLContextSharedContext :: (MonadIO m, IsGLContext o) => o -> m (Maybe GLContext)
getGLContextSharedContext obj = liftIO $ getObjectPropertyObject obj "shared-context" GLContext
constructGLContextSharedContext :: (IsGLContext o, IsGLContext a) => a -> IO (GValueConstruct o)
constructGLContextSharedContext val = constructObjectPropertyObject "shared-context" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextSharedContextPropertyInfo
instance AttrInfo GLContextSharedContextPropertyInfo where
type AttrAllowedOps GLContextSharedContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint GLContextSharedContextPropertyInfo = IsGLContext
type AttrBaseTypeConstraint GLContextSharedContextPropertyInfo = IsGLContext
type AttrGetType GLContextSharedContextPropertyInfo = (Maybe GLContext)
type AttrLabel GLContextSharedContextPropertyInfo = "shared-context"
type AttrOrigin GLContextSharedContextPropertyInfo = GLContext
attrGet _ = getGLContextSharedContext
attrSet _ = undefined
attrConstruct _ = constructGLContextSharedContext
attrClear _ = undefined
#endif
getGLContextWindow :: (MonadIO m, IsGLContext o) => o -> m (Maybe Gdk.Window.Window)
getGLContextWindow obj = liftIO $ getObjectPropertyObject obj "window" Gdk.Window.Window
constructGLContextWindow :: (IsGLContext o, Gdk.Window.IsWindow a) => a -> IO (GValueConstruct o)
constructGLContextWindow val = constructObjectPropertyObject "window" (Just val)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextWindowPropertyInfo
instance AttrInfo GLContextWindowPropertyInfo where
type AttrAllowedOps GLContextWindowPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint GLContextWindowPropertyInfo = Gdk.Window.IsWindow
type AttrBaseTypeConstraint GLContextWindowPropertyInfo = IsGLContext
type AttrGetType GLContextWindowPropertyInfo = (Maybe Gdk.Window.Window)
type AttrLabel GLContextWindowPropertyInfo = "window"
type AttrOrigin GLContextWindowPropertyInfo = GLContext
attrGet _ = getGLContextWindow
attrSet _ = undefined
attrConstruct _ = constructGLContextWindow
attrClear _ = undefined
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList GLContext
type instance O.AttributeList GLContext = GLContextAttributeList
type GLContextAttributeList = ('[ '("display", GLContextDisplayPropertyInfo), '("sharedContext", GLContextSharedContextPropertyInfo), '("window", GLContextWindowPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
gLContextDisplay :: AttrLabelProxy "display"
gLContextDisplay = AttrLabelProxy
gLContextSharedContext :: AttrLabelProxy "sharedContext"
gLContextSharedContext = AttrLabelProxy
gLContextWindow :: AttrLabelProxy "window"
gLContextWindow = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList GLContext = GLContextSignalList
type GLContextSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_gl_context_get_debug_enabled" gdk_gl_context_get_debug_enabled ::
Ptr GLContext ->
IO CInt
gLContextGetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetDebugEnabled context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_debug_enabled context'
let result' = (/= 0) result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetDebugEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetDebugEnabledMethodInfo a signature where
overloadedMethod _ = gLContextGetDebugEnabled
#endif
foreign import ccall "gdk_gl_context_get_display" gdk_gl_context_get_display ::
Ptr GLContext ->
IO (Ptr Gdk.Display.Display)
gLContextGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe Gdk.Display.Display)
gLContextGetDisplay context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_display context'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gdk.Display.Display) result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetDisplayMethodInfo
instance (signature ~ (m (Maybe Gdk.Display.Display)), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetDisplayMethodInfo a signature where
overloadedMethod _ = gLContextGetDisplay
#endif
foreign import ccall "gdk_gl_context_get_forward_compatible" gdk_gl_context_get_forward_compatible ::
Ptr GLContext ->
IO CInt
gLContextGetForwardCompatible ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetForwardCompatible context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_forward_compatible context'
let result' = (/= 0) result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetForwardCompatibleMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetForwardCompatibleMethodInfo a signature where
overloadedMethod _ = gLContextGetForwardCompatible
#endif
foreign import ccall "gdk_gl_context_get_required_version" gdk_gl_context_get_required_version ::
Ptr GLContext ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
gLContextGetRequiredVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ((Int32, Int32))
gLContextGetRequiredVersion context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
major <- allocMem :: IO (Ptr Int32)
minor <- allocMem :: IO (Ptr Int32)
gdk_gl_context_get_required_version context' major minor
major' <- peek major
minor' <- peek minor
touchManagedPtr context
freeMem major
freeMem minor
return (major', minor')
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetRequiredVersionMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetRequiredVersionMethodInfo a signature where
overloadedMethod _ = gLContextGetRequiredVersion
#endif
foreign import ccall "gdk_gl_context_get_shared_context" gdk_gl_context_get_shared_context ::
Ptr GLContext ->
IO (Ptr GLContext)
gLContextGetSharedContext ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe GLContext)
gLContextGetSharedContext context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_shared_context context'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject GLContext) result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetSharedContextMethodInfo
instance (signature ~ (m (Maybe GLContext)), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetSharedContextMethodInfo a signature where
overloadedMethod _ = gLContextGetSharedContext
#endif
foreign import ccall "gdk_gl_context_get_use_es" gdk_gl_context_get_use_es ::
Ptr GLContext ->
IO CInt
gLContextGetUseEs ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextGetUseEs context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_use_es context'
let result' = (/= 0) result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetUseEsMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetUseEsMethodInfo a signature where
overloadedMethod _ = gLContextGetUseEs
#endif
foreign import ccall "gdk_gl_context_get_version" gdk_gl_context_get_version ::
Ptr GLContext ->
Ptr Int32 ->
Ptr Int32 ->
IO ()
gLContextGetVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ((Int32, Int32))
gLContextGetVersion context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
major <- allocMem :: IO (Ptr Int32)
minor <- allocMem :: IO (Ptr Int32)
gdk_gl_context_get_version context' major minor
major' <- peek major
minor' <- peek minor
touchManagedPtr context
freeMem major
freeMem minor
return (major', minor')
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetVersionMethodInfo
instance (signature ~ (m ((Int32, Int32))), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetVersionMethodInfo a signature where
overloadedMethod _ = gLContextGetVersion
#endif
foreign import ccall "gdk_gl_context_get_window" gdk_gl_context_get_window ::
Ptr GLContext ->
IO (Ptr Gdk.Window.Window)
gLContextGetWindow ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m (Maybe Gdk.Window.Window)
gLContextGetWindow context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_get_window context'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gdk.Window.Window) result'
return result''
touchManagedPtr context
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextGetWindowMethodInfo
instance (signature ~ (m (Maybe Gdk.Window.Window)), MonadIO m, IsGLContext a) => O.MethodInfo GLContextGetWindowMethodInfo a signature where
overloadedMethod _ = gLContextGetWindow
#endif
foreign import ccall "gdk_gl_context_is_legacy" gdk_gl_context_is_legacy ::
Ptr GLContext ->
IO CInt
gLContextIsLegacy ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m Bool
gLContextIsLegacy context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
result <- gdk_gl_context_is_legacy context'
let result' = (/= 0) result
touchManagedPtr context
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextIsLegacyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGLContext a) => O.MethodInfo GLContextIsLegacyMethodInfo a signature where
overloadedMethod _ = gLContextIsLegacy
#endif
foreign import ccall "gdk_gl_context_make_current" gdk_gl_context_make_current ::
Ptr GLContext ->
IO ()
gLContextMakeCurrent ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ()
gLContextMakeCurrent context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gdk_gl_context_make_current context'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextMakeCurrentMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextMakeCurrentMethodInfo a signature where
overloadedMethod _ = gLContextMakeCurrent
#endif
foreign import ccall "gdk_gl_context_realize" gdk_gl_context_realize ::
Ptr GLContext ->
Ptr (Ptr GError) ->
IO CInt
gLContextRealize ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> m ()
gLContextRealize context = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
onException (do
_ <- propagateGError $ gdk_gl_context_realize context'
touchManagedPtr context
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextRealizeMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextRealizeMethodInfo a signature where
overloadedMethod _ = gLContextRealize
#endif
foreign import ccall "gdk_gl_context_set_debug_enabled" gdk_gl_context_set_debug_enabled ::
Ptr GLContext ->
CInt ->
IO ()
gLContextSetDebugEnabled ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Bool
-> m ()
gLContextSetDebugEnabled context enabled = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
let enabled' = (fromIntegral . fromEnum) enabled
gdk_gl_context_set_debug_enabled context' enabled'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextSetDebugEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextSetDebugEnabledMethodInfo a signature where
overloadedMethod _ = gLContextSetDebugEnabled
#endif
foreign import ccall "gdk_gl_context_set_forward_compatible" gdk_gl_context_set_forward_compatible ::
Ptr GLContext ->
CInt ->
IO ()
gLContextSetForwardCompatible ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Bool
-> m ()
gLContextSetForwardCompatible context compatible = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
let compatible' = (fromIntegral . fromEnum) compatible
gdk_gl_context_set_forward_compatible context' compatible'
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextSetForwardCompatibleMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextSetForwardCompatibleMethodInfo a signature where
overloadedMethod _ = gLContextSetForwardCompatible
#endif
foreign import ccall "gdk_gl_context_set_required_version" gdk_gl_context_set_required_version ::
Ptr GLContext ->
Int32 ->
Int32 ->
IO ()
gLContextSetRequiredVersion ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Int32
-> Int32
-> m ()
gLContextSetRequiredVersion context major minor = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gdk_gl_context_set_required_version context' major minor
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextSetRequiredVersionMethodInfo
instance (signature ~ (Int32 -> Int32 -> m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextSetRequiredVersionMethodInfo a signature where
overloadedMethod _ = gLContextSetRequiredVersion
#endif
foreign import ccall "gdk_gl_context_set_use_es" gdk_gl_context_set_use_es ::
Ptr GLContext ->
Int32 ->
IO ()
gLContextSetUseEs ::
(B.CallStack.HasCallStack, MonadIO m, IsGLContext a) =>
a
-> Int32
-> m ()
gLContextSetUseEs context useEs = liftIO $ do
context' <- unsafeManagedPtrCastPtr context
gdk_gl_context_set_use_es context' useEs
touchManagedPtr context
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data GLContextSetUseEsMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsGLContext a) => O.MethodInfo GLContextSetUseEsMethodInfo a signature where
overloadedMethod _ = gLContextSetUseEs
#endif
foreign import ccall "gdk_gl_context_clear_current" gdk_gl_context_clear_current ::
IO ()
gLContextClearCurrent ::
(B.CallStack.HasCallStack, MonadIO m) =>
m ()
gLContextClearCurrent = liftIO $ do
gdk_gl_context_clear_current
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
foreign import ccall "gdk_gl_context_get_current" gdk_gl_context_get_current ::
IO (Ptr GLContext)
gLContextGetCurrent ::
(B.CallStack.HasCallStack, MonadIO m) =>
m (Maybe GLContext)
gLContextGetCurrent = liftIO $ do
result <- gdk_gl_context_get_current
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject GLContext) result'
return result''
return maybeResult
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif