opengles-0.8.3: Functional interface for OpenGL 4.1+ and OpenGL ES 2.0+

Safe HaskellNone
LanguageHaskell2010

Graphics.EGL

Contents

Description

EGL 1.5 carefully reconstructed. EGL is an interface works between native window systems and rendering APIs such as OpenGL, OpenGL ES, OpenVG. This high-level APIs are specialized for OpenGL ES, so that initialization could be simply done in several lines. You can still access the rest of C APIs via Graphics.EGL.Base.

Synopsis

EGL Lifecycle

eglInit :: IO Egl Source

Initialize EGL with default display.

eglInitializeOn Source

Arguments

:: Maybe EGLNativeDisplay

If any, specify native display pointer.

-> [[(EGLConfAttr, Int32)]]

EGL configurations with many fallbacks.

-> [(EGLContextAttr, Int32)]

Choose GL version here.

-> IO Egl 

Initialize EGL with specified display and configurations.

eglResume Source

Arguments

:: Egl 
-> EGLNativeWindow

Pointer to the native window handler.

-> IO () 

Start using graphics APIs on this thread. initialization is performed here whenever necessary. EGL context would be re-created if the last context was lost due to power management events such as sleep.

eglSuspend :: Egl -> IO () Source

Stop using graphics APIs on this thread. Should be called before a sleep.

eglInvalidate :: Egl -> IO () Source

Invalidate EGL objects and terminates the display on this thread. You can still reuse Egl because Egl is state manager.

Posting the Color Buffer

eglPostFrame :: Egl -> IO () Source

Post EGL surface color buffer to the native window. eglPostFrame calls eglSwapBuffers inside.

eglPostInterval :: Egl -> Int32 -> IO Bool Source

Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context. Returns False on failure. The default swap interval is 1.

Query Context

eglScreenDims :: Num a => Egl -> IO (a, a) Source

Attributes

Config Attributes

egl_SurfaceType :: EGLConfAttr Source

Bitmask, see below.

egl_RenderableType :: EGLConfAttr Source

Bitmask, see below.

egl_ConfigCaveat values (except egl_None)

egl_SurfaceType mask bits

egl_TransparentType values (except egl_None)

egl_ColorBufferType values

egl_RenderableType bitmask

egl_OpenGLES3 :: EGLint Source

EGL_KHR_create_context or EGL 1.5 required

Surface

Surface Attributes

egl_Height :: EGLSurfAttr Source

int Height of surface.

egl_Width :: EGLSurfAttr Source

int Width of surface.

egl_LargestPbuffer :: EGLSurfAttr Source

boolean If true, create largest pbuffer possible.

egl_TextureFormat :: EGLSurfAttr Source

enum Format of texture: RGB, RGBA, or no texture.

egl_TextureTarget :: EGLSurfAttr Source

enum Type of texture: 2D or no texture.

egl_MipmapTexture :: EGLSurfAttr Source

boolean True if texture has mipmaps.

egl_MipmapLevel :: EGLSurfAttr Source

int Mipmap level to render to.

egl_RenderBuffer :: EGLSurfAttr Source

enum Render buffer, see below.

egl_VGColorspace :: EGLSurfAttr Source

enum Color space for OpenVG, see below.

egl_VGAlphaFormat :: EGLSurfAttr Source

enum Alpha format for OpenVG, see below.

egl_HorizontalResolution :: EGLSurfAttr Source

int Horizontal dot pitch.

egl_VerticalResolution :: EGLSurfAttr Source

int Vertical dot pitch.

egl_PixelAspectRaito :: EGLSurfAttr Source

int Display aspect ratio.

egl_SwapBehavior :: EGLSurfAttr Source

enum Buffer swap behavior, see below.

egl_MultisampleResolve :: EGLSurfAttr Source

enum Multisample resolve behavior, see below.

egl_ConfigId :: EGLSurfAttr Source

int ID of EGLConfig surface was created with egl_Height integer Height of surface.

egl_GLColorspace :: EGLSurfAttr Source

EGL_KHR_gl_colorspace or EGL 1.5+ enum Color space for OpenGL, see below.

egl_Texture{Format,Target} values

egl_RenderBuffer values

egl_{VG,GL}Colorspace values

egl_VGAlphaFormat values

Resolution and Aspect Raito values

egl_DisplayScaling :: EGLint Source

Constant scale factor by which fractional display resolutions & aspect ratio are scaled when queried as integer values.

egl_Unknown :: EGLint Source

Unknown display resolution or aspect ratio.

egl_SwapBehavior values

egl_MultisampleResolve values

Context

Context Attributes

egl_ClientVersion :: EGLContextAttr Source

Specify context client major version, 2 or later.

egl_GLRobustAccessExt :: EGLContextAttr Source

EGL_EXT_create_context_robustness required Same as unpostfixed version.

egl_GLResetNotificationStrategyExt :: EGLContextAttr Source

EGL_EXT_create_context_robustness required Same as unpostfixed version.

egl_MinorVersion :: EGLContextAttr Source

EGL_KHR_create_context or EGL 1.5 required Specify context client minor version.

egl_GLProfileMask :: EGLContextAttr Source

EGL_KHR_create_context or EGL 1.5 required See below.

egl_GLResetNotificationStrategy :: EGLContextAttr Source

EGL_KHR_create_context or EGL 1.5 required See below.

egl_ContextFlags :: EGLContextAttr Source

EGL_KHR_create_context required See below.

egl_GLDebug :: EGLContextAttr Source

EGL 1.5 required Specify egl_True or egl_False

egl_OpenGLProfileMask mask bits

egl_OpenGLResetNotificationStrategy values

egl_ContextFlags bits

Synchronization Primitives

Copying Surface to Texture

type EGLBuffer = EGLint Source

Specify egl_RenderBuffer value. (Perhaps egl_BackBuffer only?)

Switching between APIs