caramia-0.7.2.2: High-level OpenGL bindings

Safe HaskellNone
LanguageHaskell2010

Graphics.Caramia.Internal.ContextLocalData

Synopsis

Documentation

newtype ContextID Source

The type of a Caramia context ID.

Constructors

ContextID Int 

currentContextID :: MonadIO m => m (Maybe ContextID) Source

Returns the current Caramia context ID.

The context ID is unique between different calls to giveContext.

Returns Nothing if there is no context active.

storeContextLocalData :: (MonadIO m, Typeable a) => a -> m () Source

Stores a context local value.

The type of the given value is used as a key. This means that if a value of the same type was stored before, that value is thrown away and replaced with this new value you just gave.

The value is evaluated to WHNF.

You don't need this function to work with context local data. retrieveContextLocalData is sufficient as it also lets you set a default value in case a value was not already set.

Context local data is wiped to oblivion once giveContext ends.

retrieveContextLocalData Source

Arguments

:: (MonadIO m, Typeable a) 
=> m a

Default value generating action; not evaluated if there was already a value stored.

-> m a 

Retrieves a context local value.

See storeContextLocalData.