Copyright | (c) Sven Panne 2015 |
---|---|
License | BSD3 |
Maintainer | Sven Panne <svenpanne@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module offers a portable way to retrieve OpenGL functions and extension
entries, providing a portability layer upon platform-specific mechanisms
like glXGetProcAddress
, wglGetProcAddress
or NSAddressOfSymbol
.
- getProcAddress :: MonadIO m => String -> m (FunPtr a)
- getProcAddressWithSuffixes :: MonadIO m => String -> [String] -> m (FunPtr a)
- getExtension :: MonadIO m => String -> m (FunPtr a)
- getProcAddressChecked :: MonadIO m => String -> m (FunPtr a)
- getProcAddressWithSuffixesChecked :: MonadIO m => String -> [String] -> m (FunPtr a)
- getExtensionChecked :: MonadIO m => String -> m (FunPtr a)
Unchecked retrieval
getProcAddress :: MonadIO m => String -> m (FunPtr a) Source
Retrieve an OpenGL function by name. Returns nullFunPtr
when no function
with the given name was found.
getProcAddressWithSuffixes :: MonadIO m => String -> [String] -> m (FunPtr a) Source
Retrieve an OpenGL function by name, trying a list of name suffixes in the
given order. Returns nullFunPtr
when no function with the given name plus
any of the suffixes was found.
getExtension :: MonadIO m => String -> m (FunPtr a) Source
Retrieve an OpenGL function by name, additionally trying a list of all
known vendor suffixes. Returns nullFunPtr
when no function with the given
name plus any of the suffixes was found.
Checked retrieval
getProcAddressChecked :: MonadIO m => String -> m (FunPtr a) Source
Retrieve an OpenGL function by name. Throws an userError
when no function
with the given name was found.