OpenGLRaw-3.2.6.0: A raw binding for the OpenGL graphics system

Copyright(c) Sven Panne 2016
LicenseBSD3
MaintainerSven Panne <svenpanne@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.GL.GetProcAddress

Contents

Description

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.

Note that finding an OpenGL entry point doesn't mean that it's actually usable: On most platforms entry points are context-independent, so you have to check the available extensions and/or OpenGL version, too.

Synopsis

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.

getProcAddressWithSuffixesChecked :: MonadIO m => String -> [String] -> m (FunPtr a) Source #

Retrieve an OpenGL function by name, trying a list of name suffixes in the given order. Throws an userError when no function with the given name plus any of the suffixes was found.

getExtensionChecked :: MonadIO m => String -> m (FunPtr a) Source #

Retrieve an OpenGL function by name, additionally trying a list of all known vendor suffixes. Throws an userError when no function with the given name plus any of the suffixes was found.

Version info and extensions

getVersion :: MonadIO m => m (Int, Int) Source #

Retrieve the OpenGL version, split into major and minor version numbers.

version :: (Int, Int) Source #

The OpenGL version, split into major and minor version numbers. Note that in the presence of multiple contexts with different capabilities, this might be wrong. Use getVersion in those cases instead.

getExtensions :: MonadIO m => m (Set String) Source #

Retrieve the set of all available OpenGL extensions.

extensions :: Set String Source #

The set of all available OpenGL extensions. Note that in the presence of multiple contexts with different capabilities, this might be wrong. Use getExtensions in those cases instead.