sdl2-2.5.5.1: Both high- and low-level bindings to the SDL library (version 2.0.6+).

Safe Haskell | None
Language | Haskell2010

SDL.Video.OpenGL

Contents

- Creating and Configuring OpenGL Contexts
- Querying for the drawable size without a Renderer
- Swapping
- Function Loading

Synopsis

- defaultOpenGL :: OpenGLConfig
- data OpenGLConfig = OpenGLConfig {
  - glColorPrecision :: V4 CInt
  - glDepthPrecision :: CInt
  - glStencilPrecision :: CInt
  - glMultisampleSamples :: CInt
  - glProfile :: Profile
  }
- data GLContext
- glCreateContext :: (Functor m, MonadIO m) => Window -> m GLContext
- data Profile
  - = Core Mode CInt CInt
  - | Compatibility Mode CInt CInt
  - | ES Mode CInt CInt
- data Mode
  - = Normal
  - | Debug
- glMakeCurrent :: (Functor m, MonadIO m) => Window -> GLContext -> m ()
- glDeleteContext :: MonadIO m => GLContext -> m ()
- glGetDrawableSize :: MonadIO m => Window -> m (V2 CInt)
- glSwapWindow :: MonadIO m => Window -> m ()
- data SwapInterval
  - = ImmediateUpdates
  - | SynchronizedUpdates
  - | LateSwapTearing
- swapInterval :: StateVar SwapInterval
- glGetProcAddress :: MonadIO m => CString -> m (Ptr ())

# Creating and Configuring OpenGL Contexts

defaultOpenGL :: OpenGLConfig Source #

A set of default options for `OpenGLConfig`

    defaultOpenGL = OpenGLConfig
      { glColorPrecision = V4 8 8 8 0
      , glDepthPrecision = 24
      , glStencilPrecision = 8
      , glMultisampleSamples = 1
      , glProfile = Compatibility Normal 2 1
      }

data OpenGLConfig Source #

Configuration used when creating an OpenGL rendering context.

Constructors

OpenGLConfig |

Fields

- glColorPrecision :: V4 CInt

  Defaults to `V4` `8 8 8 0`.

- glDepthPrecision :: CInt

  Defaults to `24`.

- glStencilPrecision :: CInt

  Defaults to `8`.

- glMultisampleSamples :: CInt

  Defaults to `1`.

- glProfile :: Profile

  Defaults to `Compatibility` `Normal` `2 1`.

#### Instances

Instances details

Generic OpenGLConfig Source # |

Instance details

Defined in SDL.Video.OpenGL

Associated Types

type Rep OpenGLConfig |

Instance details

Defined in SDL.Video.OpenGL

type Rep OpenGLConfig = D1 ('MetaData "OpenGLConfig" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "OpenGLConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "glColorPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V4 CInt)) :*: S1 ('MetaSel ('Just "glDepthPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)) :*: (S1 ('MetaSel ('Just "glStencilPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: (S1 ('MetaSel ('Just "glMultisampleSamples") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Just "glProfile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Profile)))))

Methods

from :: OpenGLConfig -> Rep OpenGLConfig x Source #

to :: Rep OpenGLConfig x -> OpenGLConfig Source #

Read OpenGLConfig Source # |
Instance details Defined in SDL.Video.OpenGL Methods readsPrec :: Int -> ReadS OpenGLConfig Source # readList :: ReadS [OpenGLConfig] Source # readPrec :: ReadPrec OpenGLConfig Source # readListPrec :: ReadPrec [OpenGLConfig] Source #
Show OpenGLConfig Source # |
Instance details Defined in SDL.Video.OpenGL Methods showsPrec :: Int -> OpenGLConfig -> ShowS Source # show :: OpenGLConfig -> String Source # showList :: [OpenGLConfig] -> ShowS Source #
Eq OpenGLConfig Source # |
Instance details Defined in SDL.Video.OpenGL Methods (==) :: OpenGLConfig -> OpenGLConfig -> Bool Source # (/=) :: OpenGLConfig -> OpenGLConfig -> Bool Source #
Ord OpenGLConfig Source # |

Instance details

Defined in SDL.Video.OpenGL

Methods

compare :: OpenGLConfig -> OpenGLConfig -> Ordering Source #

(<) :: OpenGLConfig -> OpenGLConfig -> Bool Source #

(<=) :: OpenGLConfig -> OpenGLConfig -> Bool Source #

(>) :: OpenGLConfig -> OpenGLConfig -> Bool Source #

(>=) :: OpenGLConfig -> OpenGLConfig -> Bool Source #

max :: OpenGLConfig -> OpenGLConfig -> OpenGLConfig Source #

min :: OpenGLConfig -> OpenGLConfig -> OpenGLConfig Source #

type Rep OpenGLConfig Source # |

Instance details

Defined in SDL.Video.OpenGL

type Rep OpenGLConfig = D1 ('MetaData "OpenGLConfig" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "OpenGLConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "glColorPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (V4 CInt)) :*: S1 ('MetaSel ('Just "glDepthPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)) :*: (S1 ('MetaSel ('Just "glStencilPrecision") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: (S1 ('MetaSel ('Just "glMultisampleSamples") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Just "glProfile") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Profile)))))

data GLContext Source #

A created OpenGL context.

#### Instances

Instances details

Eq GLContext Source # |
Instance details Defined in SDL.Video.OpenGL Methods (==) :: GLContext -> GLContext -> Bool Source # (/=) :: GLContext -> GLContext -> Bool Source #

glCreateContext :: (Functor m, MonadIO m) => Window -> m GLContext Source #

Create a new OpenGL context and makes it the current context for the window.

Throws `SDLException` if the window wasn't configured with OpenGL support, or if context creation fails.

See `SDL_GL_CreateContext` for C documentation.

data Profile Source #

The profile a driver should use when creating an OpenGL context.

Constructors

Core Mode CInt CInt | Use the OpenGL core profile, with a given major and minor version
Compatibility Mode CInt CInt | Use the compatibilty profile with a given major and minor version. The compatibility profile allows you to use deprecated functions such as immediate mode
ES Mode CInt CInt | Use an OpenGL profile for embedded systems

#### Instances

Instances details

Generic Profile Source # |

Instance details

Defined in SDL.Video.OpenGL

Associated Types

type Rep Profile |

Instance details

Defined in SDL.Video.OpenGL

type Rep Profile = D1 ('MetaData "Profile" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "Core" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt))) :+: (C1 ('MetaCons "Compatibility" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt))) :+: C1 ('MetaCons "ES" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))))

Methods

from :: Profile -> Rep Profile x Source #

to :: Rep Profile x -> Profile Source #

Read Profile Source # |
Instance details Defined in SDL.Video.OpenGL Methods readsPrec :: Int -> ReadS Profile Source # readList :: ReadS [Profile] Source # readPrec :: ReadPrec Profile Source # readListPrec :: ReadPrec [Profile] Source #
Show Profile Source # |
Instance details Defined in SDL.Video.OpenGL Methods showsPrec :: Int -> Profile -> ShowS Source # show :: Profile -> String Source # showList :: [Profile] -> ShowS Source #
Eq Profile Source # |
Instance details Defined in SDL.Video.OpenGL Methods (==) :: Profile -> Profile -> Bool Source # (/=) :: Profile -> Profile -> Bool Source #
Ord Profile Source # |
Instance details Defined in SDL.Video.OpenGL Methods compare :: Profile -> Profile -> Ordering Source # (<) :: Profile -> Profile -> Bool Source # (<=) :: Profile -> Profile -> Bool Source # (>) :: Profile -> Profile -> Bool Source # (>=) :: Profile -> Profile -> Bool Source # max :: Profile -> Profile -> Profile Source # min :: Profile -> Profile -> Profile Source #
type Rep Profile Source # |

Instance details

Defined in SDL.Video.OpenGL

type Rep Profile = D1 ('MetaData "Profile" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "Core" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt))) :+: (C1 ('MetaCons "Compatibility" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt))) :+: C1 ('MetaCons "ES" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Mode) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CInt)))))

data Mode Source #

The mode a driver should use when creating an OpenGL context.

Constructors

Normal | A normal profile with no special debugging support
Debug | Use a debug context, allowing the usage of extensions such as `GL_ARB_debug_output`

#### Instances

Instances details

Data Mode Source # |

Instance details

Defined in SDL.Video.OpenGL

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Mode -> c Mode Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Mode Source #

toConstr :: Mode -> Constr Source #

dataTypeOf :: Mode -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Mode) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Mode) Source #

gmapT :: (forall b. Data b => b -> b) -> Mode -> Mode Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Mode -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Mode -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Mode -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Mode -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Mode -> m Mode Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Mode -> m Mode Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Mode -> m Mode Source #

Bounded Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods minBound :: Mode Source # maxBound :: Mode Source #
Enum Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods succ :: Mode -> Mode Source # pred :: Mode -> Mode Source # toEnum :: Int -> Mode Source # fromEnum :: Mode -> Int Source # enumFrom :: Mode -> [Mode] Source # enumFromThen :: Mode -> Mode -> [Mode] Source # enumFromTo :: Mode -> Mode -> [Mode] Source # enumFromThenTo :: Mode -> Mode -> Mode -> [Mode] Source #
Generic Mode Source # |

Instance details

Defined in SDL.Video.OpenGL

Associated Types

type Rep Mode |
Instance details Defined in SDL.Video.OpenGL type Rep Mode = D1 ('MetaData "Mode" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "Normal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Debug" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: Mode -> Rep Mode x Source #

to :: Rep Mode x -> Mode Source #

Read Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods readsPrec :: Int -> ReadS Mode Source # readList :: ReadS [Mode] Source # readPrec :: ReadPrec Mode Source # readListPrec :: ReadPrec [Mode] Source #
Show Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods showsPrec :: Int -> Mode -> ShowS Source # show :: Mode -> String Source # showList :: [Mode] -> ShowS Source #
Eq Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods (==) :: Mode -> Mode -> Bool Source # (/=) :: Mode -> Mode -> Bool Source #
Ord Mode Source # |
Instance details Defined in SDL.Video.OpenGL Methods compare :: Mode -> Mode -> Ordering Source # (<) :: Mode -> Mode -> Bool Source # (<=) :: Mode -> Mode -> Bool Source # (>) :: Mode -> Mode -> Bool Source # (>=) :: Mode -> Mode -> Bool Source # max :: Mode -> Mode -> Mode Source # min :: Mode -> Mode -> Mode Source #
type Rep Mode Source # |
Instance details Defined in SDL.Video.OpenGL type Rep Mode = D1 ('MetaData "Mode" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "Normal" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Debug" 'PrefixI 'False) (U1 :: Type -> Type))

glMakeCurrent :: (Functor m, MonadIO m) => Window -> GLContext -> m () Source #

Set up an OpenGL context for rendering into an OpenGL window.

Throws `SDLException` on failure.

See `SDL_GL_MakeCurrent` for C documentation.

glDeleteContext :: MonadIO m => GLContext -> m () Source #

Delete the given OpenGL context.

You must make sure that there are no pending commands in the OpenGL command queue, the driver may still be processing commands even if you have stopped issuing them!

The `glFinish` command will block until the command queue has been fully processed. You should call that function before deleting a context.

See `SDL_GL_DeleteContext` for C documentation.

# Querying for the drawable size without a Renderer

glGetDrawableSize :: MonadIO m => Window -> m (V2 CInt) Source #

Get the size of a window's underlying drawable area in pixels (for use with glViewport).

It may differ from `windowSize` if window was created with `windowHighDPI` flag.

# Swapping

The process of "swapping" means to move the back-buffer into the window contents itself.

glSwapWindow :: MonadIO m => Window -> m () Source #

Replace the contents of the front buffer with the back buffer's. The contents of the back buffer are undefined, clear them with `glClear` or equivalent before drawing to them again.

See `SDL_GL_SwapWindow` for C documentation.

data SwapInterval Source #

The swap interval for the current OpenGL context.

Constructors

ImmediateUpdates | No vertical retrace synchronization
SynchronizedUpdates | The buffer swap is synchronized with the vertical retrace
LateSwapTearing |

#### Instances

Instances details

Data SwapInterval Source # |

Instance details

Defined in SDL.Video.OpenGL

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SwapInterval -> c SwapInterval Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SwapInterval Source #

toConstr :: SwapInterval -> Constr Source #

dataTypeOf :: SwapInterval -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SwapInterval) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SwapInterval) Source #

gmapT :: (forall b. Data b => b -> b) -> SwapInterval -> SwapInterval Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SwapInterval -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SwapInterval -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> SwapInterval -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SwapInterval -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SwapInterval -> m SwapInterval Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SwapInterval -> m SwapInterval Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SwapInterval -> m SwapInterval Source #

Bounded SwapInterval Source # |
Instance details Defined in SDL.Video.OpenGL Methods minBound :: SwapInterval Source # maxBound :: SwapInterval Source #
Enum SwapInterval Source # |

Instance details

Defined in SDL.Video.OpenGL

Methods

succ :: SwapInterval -> SwapInterval Source #

pred :: SwapInterval -> SwapInterval Source #

toEnum :: Int -> SwapInterval Source #

fromEnum :: SwapInterval -> Int Source #

enumFrom :: SwapInterval -> [SwapInterval] Source #

enumFromThen :: SwapInterval -> SwapInterval -> [SwapInterval] Source #

enumFromTo :: SwapInterval -> SwapInterval -> [SwapInterval] Source #

enumFromThenTo :: SwapInterval -> SwapInterval -> SwapInterval -> [SwapInterval] Source #

Generic SwapInterval Source # |

Instance details

Defined in SDL.Video.OpenGL

Associated Types

type Rep SwapInterval |
Instance details Defined in SDL.Video.OpenGL type Rep SwapInterval = D1 ('MetaData "SwapInterval" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "ImmediateUpdates" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SynchronizedUpdates" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LateSwapTearing" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: SwapInterval -> Rep SwapInterval x Source #

to :: Rep SwapInterval x -> SwapInterval Source #

Read SwapInterval Source # |
Instance details Defined in SDL.Video.OpenGL Methods readsPrec :: Int -> ReadS SwapInterval Source # readList :: ReadS [SwapInterval] Source # readPrec :: ReadPrec SwapInterval Source # readListPrec :: ReadPrec [SwapInterval] Source #
Show SwapInterval Source # |
Instance details Defined in SDL.Video.OpenGL Methods showsPrec :: Int -> SwapInterval -> ShowS Source # show :: SwapInterval -> String Source # showList :: [SwapInterval] -> ShowS Source #
Eq SwapInterval Source # |
Instance details Defined in SDL.Video.OpenGL Methods (==) :: SwapInterval -> SwapInterval -> Bool Source # (/=) :: SwapInterval -> SwapInterval -> Bool Source #
Ord SwapInterval Source # |

Instance details

Defined in SDL.Video.OpenGL

Methods

compare :: SwapInterval -> SwapInterval -> Ordering Source #

(<) :: SwapInterval -> SwapInterval -> Bool Source #

(<=) :: SwapInterval -> SwapInterval -> Bool Source #

(>) :: SwapInterval -> SwapInterval -> Bool Source #

(>=) :: SwapInterval -> SwapInterval -> Bool Source #

max :: SwapInterval -> SwapInterval -> SwapInterval Source #

min :: SwapInterval -> SwapInterval -> SwapInterval Source #

FromNumber SwapInterval CInt Source # |
Instance details Defined in SDL.Video.OpenGL Methods fromNumber :: CInt -> SwapInterval Source #
ToNumber SwapInterval CInt Source # |
Instance details Defined in SDL.Video.OpenGL Methods toNumber :: SwapInterval -> CInt Source #
type Rep SwapInterval Source # |
Instance details Defined in SDL.Video.OpenGL type Rep SwapInterval = D1 ('MetaData "SwapInterval" "SDL.Video.OpenGL" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) (C1 ('MetaCons "ImmediateUpdates" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SynchronizedUpdates" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LateSwapTearing" 'PrefixI 'False) (U1 :: Type -> Type)))

swapInterval :: StateVar SwapInterval Source #

Get or set the swap interval for the current OpenGL context.

This `StateVar` can be modified using `$=` and the current value retrieved with `get`.

See `SDL_GL_SetSwapInterval` and `SDL_GL_GetSwapInterval` for C documentation.

# Function Loading

glGetProcAddress :: MonadIO m => CString -> m (Ptr ()) Source #