HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

  • Packagesdl2-2.5.5.0
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceOpenGL.hs

Creating and Configuring OpenGL Contexts

8 declarations
datadata OpenGLConfig
#

Configuration used when creating an OpenGL rendering context.

Constructors

Instances6Eq, Ord, Read, Show, Generic, Rep
newtypenewtype GLContext
#

A created OpenGL context.

Instances1Eq
  • Eq GLContextDefined in sdl2-2.5.5.0 · SDL.Video.OpenGL
datadata Profile
#

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

Instances6Eq, Ord, Read, Show, Generic, Rep
datadata Mode
#

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

Instances9Bounded, Enum, Eq, Data, Ord, Read, …
valueglDeleteContext :: MonadIO m => GLContext -> m ()
#

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

1 declaration

Swapping

3 declarations

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

valueglSwapWindow :: MonadIO m => Window -> m ()
#

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.

datadata SwapInterval
#

The swap interval for the current OpenGL context.

Constructors

Instances11Bounded, Enum, Eq, Data, Ord, Read, …

Function Loading

1 declaration