Copyright | (c) Sven Panne 2009-2015 |
---|---|
License | BSD3 |
Maintainer | Sven Panne <svenpanne@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
All types from the whole OpenGL registry.
- type GLboolean = CUChar
- type GLbyte = CSChar
- type GLubyte = CUChar
- type GLchar = CChar
- type GLshort = CShort
- type GLushort = CUShort
- type GLint = CInt
- type GLuint = CUInt
- type GLfixed = CInt
- type GLint64 = Int64
- type GLuint64 = Word64
- type GLsizei = CInt
- type GLenum = CUInt
- type GLintptr = CPtrdiff
- type GLsizeiptr = CPtrdiff
- type GLsync = Ptr ()
- type GLbitfield = CUInt
- type GLhalf = CUShort
- type GLfloat = CFloat
- type GLclampf = CFloat
- type GLdouble = CDouble
- type GLclampd = CDouble
- type GLDEBUGPROC = FunPtr GLDEBUGPROCFunc
- type GLDEBUGPROCFunc = GLenum -> GLenum -> GLuint -> GLenum -> GLsizei -> Ptr GLchar -> Ptr () -> IO ()
- makeGLDEBUGPROC :: GLDEBUGPROCFunc -> IO (FunPtr GLDEBUGPROCFunc)
- type GLvoid = ()
- type GLcharARB = CChar
- type GLint64EXT = Int64
- type GLuint64EXT = Word64
- type GLintptrARB = CPtrdiff
- type GLsizeiptrARB = CPtrdiff
- type GLhalfARB = CUShort
- type GLhalfNV = CUShort
- type GLDEBUGPROCAMD = FunPtr GLDEBUGPROCAMDFunc
- type GLDEBUGPROCAMDFunc = GLuint -> GLenum -> GLenum -> GLsizei -> Ptr GLchar -> Ptr () -> IO ()
- makeGLDEBUGPROCAMD :: GLDEBUGPROCAMDFunc -> IO (FunPtr GLDEBUGPROCAMDFunc)
- type GLDEBUGPROCARB = GLDEBUGPROC
- type GLDEBUGPROCARBFunc = GLDEBUGPROCFunc
- makeGLDEBUGPROCARB :: GLDEBUGPROCARBFunc -> IO (FunPtr GLDEBUGPROCARBFunc)
- type GLDEBUGPROCKHR = GLDEBUGPROC
- type GLDEBUGPROCKHRFunc = GLDEBUGPROCFunc
- makeGLDEBUGPROCKHR :: GLDEBUGPROCKHRFunc -> IO (FunPtr GLDEBUGPROCKHRFunc)
- type GLclampx = CInt
- type GLhandleARB = CUInt
- type GLvdpauSurfaceNV = GLintptr
- type GLeglImageOES = Ptr ()
- newtype CChar :: * = CChar Int8
- newtype CDouble :: * = CDouble Double
- newtype CFloat :: * = CFloat Float
- newtype CInt :: * = CInt Int32
- newtype CPtrdiff :: * = CPtrdiff Int64
- newtype CSChar :: * = CSChar Int8
- newtype CShort :: * = CShort Int16
- newtype CUChar :: * = CUChar Word8
- newtype CUInt :: * = CUInt Word32
- newtype CUShort :: * = CUShort Word16
- data Int64 :: *
- data Word64 :: *
- data FunPtr a :: * -> *
- data Ptr a :: * -> *
Types from OpenGL itself.
type GLsizeiptr = CPtrdiff Source
Pointer-sized non-negative binary integer size.
type GLbitfield = CUInt Source
32bit bit field.
16bit half-precision floating-point value encoded in an unsigned scalar.
type GLDEBUGPROC = FunPtr GLDEBUGPROCFunc Source
A pointer to a debug callback.
type GLDEBUGPROCFunc Source
= GLenum |
|
-> GLenum |
|
-> GLuint |
|
-> GLenum |
|
-> GLsizei |
|
-> Ptr GLchar |
|
-> Ptr () |
|
-> 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.
Pre-standard OpenGL types.
type GLint64EXT = Int64 Source
type GLuint64EXT = Word64 Source
type GLintptrARB = CPtrdiff Source
type GLsizeiptrARB = CPtrdiff Source
type GLDEBUGPROCAMDFunc Source
= GLuint |
|
-> GLenum |
|
-> GLenum |
|
-> GLsizei |
|
-> Ptr GLchar |
|
-> Ptr () |
|
-> 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.
type GLDEBUGPROCARB = GLDEBUGPROC Source
type GLDEBUGPROCKHR = GLDEBUGPROC Source
Types from various extensions.
type GLhandleARB = CUInt Source
type GLvdpauSurfaceNV = GLintptr Source
type GLeglImageOES = Ptr () Source
Re-exports
newtype CChar :: *
Haskell type representing the C char
type.
newtype CDouble :: *
Haskell type representing the C double
type.
newtype CFloat :: *
Haskell type representing the C float
type.
newtype CInt :: *
Haskell type representing the C int
type.
newtype CPtrdiff :: *
Haskell type representing the C ptrdiff_t
type.
newtype CSChar :: *
Haskell type representing the C signed char
type.
newtype CShort :: *
Haskell type representing the C short
type.
newtype CUChar :: *
Haskell type representing the C unsigned char
type.
newtype CUInt :: *
Haskell type representing the C unsigned int
type.
newtype CUShort :: *
Haskell type representing the C unsigned short
type.
data Int64 :: *
64-bit signed integer type
data Word64 :: *
64-bit unsigned integer type
data FunPtr a :: * -> *
A value of type
is a pointer to a function callable
from foreign code. The type FunPtr
aa
will normally be a foreign type,
a function type with zero or more arguments where
- the argument types are marshallable foreign types,
i.e.
Char
,Int
,Double
,Float
,Bool
,Int8
,Int16
,Int32
,Int64
,Word8
,Word16
,Word32
,Word64
,
,Ptr
a
,FunPtr
a
or a renaming of any of these usingStablePtr
anewtype
. - the return type is either a marshallable foreign type or has the form
whereIO
tt
is a marshallable foreign type or()
.
A value of type
may be a pointer to a foreign function,
either returned by another foreign function or imported with a
a static address import likeFunPtr
a
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
data Ptr a :: * -> *
A value of type
represents a pointer to an object, or an
array of objects, which may be marshalled to or from Haskell values
of type Ptr
aa
.
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
.