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

Copyright(c) Sven Panne 2009-2015
LicenseBSD3
MaintainerSven Panne <svenpanne@gmail.com>
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.Rendering.OpenGL.Raw.Types

Contents

Description

All types from the whole OpenGL registry.

Synopsis

Types from OpenGL itself.

type GLboolean = CUChar Source

8bit boolean.

type GLbyte = CSChar Source

8bit signed two's complement binary integer.

type GLubyte = CUChar Source

8bit unsigned binary integer.

type GLchar = CChar Source

8bit characters making up strings.

type GLshort = CShort Source

16bit signed two's complement binary integer.

type GLushort = CUShort Source

16bit unsigned binary integer.

type GLint = CInt Source

32bit signed two's complement binary integer.

type GLuint = CUInt Source

32bit unsigned binary integer.

type GLfixed = CInt Source

32bit signed two's complement 16.16 scaled integer.

type GLint64 = Int64 Source

64bit signed two's complement binary integer.

type GLuint64 = Word64 Source

64bit unsigned binary integer.

type GLsizei = CInt Source

32bit non-negative binary integer size.

type GLenum = CUInt Source

32bit enumerated binary integer value.

type GLintptr = CPtrdiff Source

Pointer-sized signed two's complement binary integer.

type GLsizeiptr = CPtrdiff Source

Pointer-sized non-negative binary integer size.

type GLsync = Ptr () Source

Pointer-sized sync object handle.

type GLbitfield = CUInt Source

32bit bit field.

type GLhalf = CUShort Source

16bit half-precision floating-point value encoded in an unsigned scalar.

type GLfloat = CFloat Source

32bit floating-point value.

type GLclampf = CFloat Source

32bit floating-point value clamped to [0, 1].

type GLdouble = CDouble Source

64bit floating-point value.

type GLclampd = CDouble Source

64bit floating-point value clamped to [0, 1].

type GLDEBUGPROC = FunPtr GLDEBUGPROCFunc Source

A pointer to a debug callback.

type GLDEBUGPROCFunc Source

Arguments

 = GLenum

source.

-> GLenum

type.

-> GLuint

id.

-> GLenum

severity.

-> GLsizei

length.

-> Ptr GLchar

message.

-> Ptr ()

userParam.

-> IO () 

Debug callback.

makeGLDEBUGPROC :: GLDEBUGPROCFunc -> IO (FunPtr GLDEBUGPROCFunc) Source

The storage associated with the resulting FunPtr has to be released with freeHaskellFunPtr when it is no longer required.

type GLvoid = () Source

Not an actual GL type, though used in headers in the past.

Pre-standard OpenGL types.

type GLDEBUGPROCAMDFunc Source

Arguments

 = GLuint

id.

-> GLenum

category.

-> GLenum

severity.

-> GLsizei

length.

-> Ptr GLchar

message.

-> Ptr ()

userParam.

-> IO () 

Debug callback.

makeGLDEBUGPROCAMD :: GLDEBUGPROCAMDFunc -> IO (FunPtr GLDEBUGPROCAMDFunc) Source

The storage associated with the resulting FunPtr has to be released with freeHaskellFunPtr when it is no longer required.

Types from various extensions.

Re-exports

newtype CChar :: *

Haskell type representing the C char type.

Constructors

CChar Int8 

newtype CFloat :: *

Haskell type representing the C float type.

Constructors

CFloat Float 

newtype CInt :: *

Haskell type representing the C int type.

Constructors

CInt Int32 

newtype CSChar :: *

Haskell type representing the C signed char type.

Constructors

CSChar Int8 

newtype CShort :: *

Haskell type representing the C short type.

Constructors

CShort Int16 

newtype CUChar :: *

Haskell type representing the C unsigned char type.

Constructors

CUChar Word8 

newtype CUInt :: *

Haskell type representing the C unsigned int type.

Constructors

CUInt Word32 

newtype CUShort :: *

Haskell type representing the C unsigned short type.

Constructors

CUShort Word16 

data FunPtr a :: * -> *

A value of type FunPtr a is a pointer to a function callable from foreign code. The type a will normally be a foreign type, a function type with zero or more arguments where

A value of type FunPtr a may be a pointer to a foreign function, either returned by another foreign function or imported with a a static address import like

foreign import ccall "stdlib.h &free"
  p_free :: FunPtr (Ptr a -> IO ())

or a pointer to a Haskell function created using a wrapper stub declared to produce a FunPtr of the correct type. For example:

type Compare = Int -> Int -> Bool
foreign import ccall "wrapper"
  mkCompare :: Compare -> IO (FunPtr Compare)

Calls to wrapper stubs like mkCompare allocate storage, which should be released with freeHaskellFunPtr when no longer required.

To convert FunPtr values to corresponding Haskell functions, one can define a dynamic stub for the specific foreign type, e.g.

type IntFunction = CInt -> IO ()
foreign import ccall "dynamic" 
  mkFun :: FunPtr IntFunction -> IntFunction

Instances

Eq (FunPtr a) 
Ord (FunPtr a) 
Show (FunPtr a) 

data Ptr a :: * -> *

A value of type Ptr a represents a pointer to an object, or an array of objects, which may be marshalled to or from Haskell values of type a.

The type a will often be an instance of class Storable which provides the marshalling operations. However this is not essential, and you can provide your own operations to access the pointer. For example you might write small foreign functions to get or set the fields of a C struct.

Instances

Eq (Ptr a) 
Ord (Ptr a) 
Show (Ptr a)