{-# OPTIONS_HADDOCK hide #-}
module Graphics.Rendering.OpenGL.GL.QueryUtils.PName (
GetPName(..),
GetPName1I(..), GetPName1F(..), GetIPName1I(..),
GetPName2I(..), GetPName2F(..),
GetPName3I(..), GetPName3F(..),
GetPName4I(..), GetPName4F(..), GetIPName4I(..),
GetPNameNI(..),
PName1I(..), PName1F(..), IPName1I(..),
PName2I(..), PName2F(..),
PName3F(..),
PName4I(..), PName4F(..), PName4ISemiIndexed(..),
PNameNI(..),
GetPNameMatrix(..),
PNameMatrix(..),
clipPlaneIndexToEnum,
GetPointervPName(..), getPointer
) where
import Foreign.Marshal.Alloc ( alloca )
import Foreign.Marshal.Array ( allocaArray, peekArray )
import Foreign.Marshal.Utils ( with )
import Foreign.Ptr ( Ptr, nullPtr, castPtr )
import Foreign.Storable ( Storable(peek) )
import Graphics.Rendering.OpenGL.GL.PeekPoke
import Graphics.Rendering.OpenGL.GLU.ErrorsInternal
import Graphics.GL
class GetPName p where
marshalGetPName :: p -> Maybe GLenum
getBooleanv :: GetPName p => p-> Ptr GLboolean -> IO ()
getBooleanv = makeGetter glGetBooleanv
getIntegerv :: GetPName p => p -> Ptr GLint -> IO ()
getIntegerv = makeGetter glGetIntegerv
getInteger64v :: GetPName p => p -> Ptr GLint64 -> IO ()
getInteger64v = makeGetter glGetInteger64v
getFloatv :: GetPName p => p -> Ptr GLfloat -> IO ()
getFloatv = makeGetter glGetFloatv
getDoublev :: GetPName p => p -> Ptr GLdouble -> IO ()
getDoublev = makeGetter glGetDoublev
getBooleaniv :: GetPName p => p -> GLuint -> Ptr GLboolean -> IO ()
getBooleaniv p i = makeGetter (\e -> glGetBooleani_v e i) p
getIntegeriv :: GetPName p => p -> GLuint -> Ptr GLint -> IO ()
getIntegeriv p i = makeGetter (\e -> glGetIntegeri_v e i) p
getInteger64iv :: GetPName p => p -> GLuint -> Ptr GLint64 -> IO ()
getInteger64iv p i = makeGetter (\e -> glGetInteger64i_v e i) p
{-# INLINE makeGetter #-}
makeGetter :: GetPName p => (GLenum -> Ptr a -> IO ()) -> p -> Ptr a -> IO ()
makeGetter f = maybe (const recordInvalidEnum) f . marshalGetPName
class GetPName p => GetPName1I p where
getBoolean1 :: (GLboolean -> a) -> p -> IO a
getBoolean1 = get1 getBooleanv
getInteger1 :: (GLint -> a) -> p -> IO a
getInteger1 = get1 getIntegerv
getEnum1 :: (GLenum -> a) -> p -> IO a
getEnum1 = get1 getIntegerv
getSizei1 :: (GLsizei -> a) -> p -> IO a
getSizei1 = get1 getIntegerv
getInteger64 :: (GLint64 -> a) -> p -> IO a
getInteger64 = get1 getInteger64v
class GetPName p => GetPName1F p where
getFloat1 :: (GLfloat -> a) -> p -> IO a
getFloat1 = get1 getFloatv
getClampf1 :: (GLclampf -> a) -> p -> IO a
getClampf1 = get1 getFloatv
getDouble1 :: (GLdouble -> a) -> p -> IO a
getDouble1 = get1 getDoublev
getClampd1 :: (GLclampd -> a) -> p -> IO a
getClampd1 = get1 getDoublev
get1 :: (Storable b, Storable c)
=> (p -> Ptr c -> IO ())
-> (b -> a)
-> p -> IO a
get1 g f n = alloca $ \buf -> do
g n buf
peek1 f (castPtr buf)
class GetPName p => GetIPName1I p where
getBoolean1i :: (GLboolean -> a) -> p -> GLuint -> IO a
getBoolean1i = get1i getBooleaniv
getInteger1i :: (GLint -> a) -> p -> GLuint -> IO a
getInteger1i = get1i getIntegeriv
getEnum1i :: (GLenum -> a) -> p -> GLuint -> IO a
getEnum1i = get1i getIntegeriv
getSizei1i :: (GLsizei -> a) -> p -> GLuint -> IO a
getSizei1i = get1i getIntegeriv
getInteger641i :: (GLint64 -> a) -> p -> GLuint -> IO a
getInteger641i = get1i getInteger64iv
get1i :: (Storable b, Storable c)
=> (p -> GLuint -> Ptr c -> IO ())
-> (b -> a)
-> p -> GLuint -> IO a
get1i g f n i = alloca $ \buf -> do
g n i buf
peek1 f (castPtr buf)
class GetPName p => GetPName2I p where
getBoolean2 :: (GLboolean -> GLboolean -> a) -> p -> IO a
getBoolean2 = get2 getBooleanv
getInteger2 :: (GLint -> GLint -> a) -> p -> IO a
getInteger2 = get2 getIntegerv
getEnum2 :: (GLenum -> GLenum -> a) -> p -> IO a
getEnum2 = get2 getIntegerv
getSizei2 :: (GLsizei -> GLsizei -> a) -> p -> IO a
getSizei2 = get2 getIntegerv
class GetPName p => GetPName2F p where
getFloat2 :: (GLfloat -> GLfloat -> a) -> p -> IO a
getFloat2 = get2 getFloatv
getClampf2 :: (GLclampf -> GLclampf -> a) -> p -> IO a
getClampf2 = get2 getFloatv
getDouble2 :: (GLdouble -> GLdouble -> a) -> p -> IO a
getDouble2 = get2 getDoublev
getClampd2 :: (GLclampd -> GLclampd -> a) -> p -> IO a
getClampd2 = get2 getDoublev
get2 :: (Storable b, Storable c)
=> (p -> Ptr c -> IO ())
-> (b -> b -> a)
-> p -> IO a
get2 g f n = allocaArray 2 $ \buf -> do
g n buf
peek2 f (castPtr buf)
class GetPName p => GetPName3I p where
getBoolean3 :: (GLboolean -> GLboolean -> GLboolean -> a) -> p -> IO a
getBoolean3 = get3 getBooleanv
getInteger3 :: (GLint -> GLint -> GLint -> a) -> p -> IO a
getInteger3 = get3 getIntegerv
getEnum3 :: (GLenum -> GLenum -> GLenum -> a) -> p -> IO a
getEnum3 = get3 getIntegerv
getSizei3 :: (GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
getSizei3 = get3 getIntegerv
class GetPName p => GetPName3F p where
getFloat3 :: (GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
getFloat3 = get3 getFloatv
getClampf3 :: (GLclampf -> GLclampf -> GLclampf -> a) -> p -> IO a
getClampf3 = get3 getFloatv
getDouble3 :: (GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
getDouble3 = get3 getDoublev
getClampd3 :: (GLclampd -> GLclampd -> GLclampd -> a) -> p -> IO a
getClampd3 = get3 getDoublev
get3 :: (Storable b, Storable c)
=> (p -> Ptr c -> IO ())
-> (b -> b -> b -> a)
-> p -> IO a
get3 g f n = allocaArray 3 $ \buf -> do
g n buf
peek3 f (castPtr buf)
class GetPName p => GetPName4I p where
getBoolean4 :: (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a) -> p -> IO a
getBoolean4 = get4 getBooleanv
getInteger4 :: (GLint -> GLint -> GLint -> GLint -> a) -> p -> IO a
getInteger4 = get4 getIntegerv
getEnum4 :: (GLenum -> GLenum -> GLenum -> GLenum -> a) -> p -> IO a
getEnum4 = get4 getIntegerv
getSizei4 :: (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> IO a
getSizei4 = get4 getIntegerv
class GetPName p => GetPName4F p where
getFloat4 :: (GLfloat -> GLfloat -> GLfloat -> GLfloat -> a) -> p -> IO a
getFloat4 = get4 getFloatv
getClampf4 :: (GLclampf -> GLclampf -> GLclampf -> GLclampf -> a) -> p -> IO a
getClampf4 = get4 getFloatv
getDouble4 :: (GLdouble -> GLdouble -> GLdouble -> GLdouble -> a) -> p -> IO a
getDouble4 = get4 getDoublev
getClampd4 :: (GLclampd -> GLclampd -> GLclampd -> GLclampd -> a) -> p -> IO a
getClampd4 = get4 getDoublev
get4 :: (Storable b, Storable c)
=> (p -> Ptr c -> IO ())
-> (b -> b -> b -> b -> a)
-> p -> IO a
get4 g f n = allocaArray 4 $ \buf -> do
g n buf
peek4 f (castPtr buf)
class GetPName p => GetIPName4I p where
getBoolean4i :: (GLboolean -> GLboolean -> GLboolean -> GLboolean -> a) -> p -> GLuint -> IO a
getBoolean4i = get4i getBooleaniv
getInteger4i :: (GLint -> GLint -> GLint -> GLint -> a) -> p -> GLuint -> IO a
getInteger4i = get4i getIntegeriv
getEnum4i :: (GLenum -> GLenum -> GLenum -> GLenum -> a) -> p -> GLuint -> IO a
getEnum4i = get4i getIntegeriv
getSizei4i :: (GLsizei -> GLsizei -> GLsizei -> GLsizei -> a) -> p -> GLuint -> IO a
getSizei4i = get4i getIntegeriv
get4i :: (Storable b, Storable c)
=> (p -> GLuint -> Ptr c -> IO ())
-> (b -> b -> b -> b -> a)
-> p -> GLuint -> IO a
get4i g f n i = allocaArray 4 $ \buf -> do
g n i buf
peek4 f (castPtr buf)
class GetPName p => GetPNameNI p where
getEnumN :: (GLenum -> a) -> p -> Int -> IO [a]
getEnumN f p n =
allocaArray n $ \buf -> do
getIntegerv p buf
(map (f . fromIntegral)) `fmap` peekArray n buf
class GetPName p => GetPNameMatrix p where
getMatrixf :: p -> Ptr GLfloat -> IO ()
getMatrixf = getFloatv
getMatrixd :: p -> Ptr GLdouble -> IO ()
getMatrixd = getDoublev
data PName1I
= GetEdgeFlag
| GetRGBAMode
| GetCurrentIndex
| GetMaxTextureUnits
| GetListIndex
| GetListMode
| GetMaxListNesting
| GetListBase
| GetRenderMode
| GetDrawFramebufferBinding
| GetReadFramebufferBinding
| GetFramebufferBinding
| GetRenderbufferBinding
| GetPerspectiveCorrectionHint
| GetPointSmoothHint
| GetLineSmoothHint
| GetPolygonSmoothHint
| GetFogHint
| GetGenerateMipmapHint
| GetTextureCompressionHint
| GetPackCMYKHint
| GetUnpackCMYKHint
| GetVertexArrayBinding
| GetMaxNameStackDepth
| GetNameStackDepth
| GetContextProfileMask
| GetPackSwapBytes
| GetUnpackSwapBytes
| GetPackLSBFirst
| GetUnpackLSBFirst
| GetPackRowLength
| GetUnpackRowLength
| GetPackSkipRows
| GetUnpackSkipRows
| GetPackSkipPixels
| GetUnpackSkipPixels
| GetPackAlignment
| GetUnpackAlignment
| GetPackImageHeight
| GetUnpackImageHeight
| GetPackSkipImages
| GetUnpackSkipImages
| GetPixelMapIToISize
| GetPixelMapSToSSize
| GetPixelMapIToRSize
| GetPixelMapIToGSize
| GetPixelMapIToBSize
| GetPixelMapIToASize
| GetPixelMapRToRSize
| GetPixelMapGToGSize
| GetPixelMapBToBSize
| GetPixelMapAToASize
| GetMaxPixelMapTable
| GetMaxVertexTextureImageUnits
| GetMaxTextureImageUnits
| GetMaxCombinedTextureImageUnits
| GetMaxTextureCoords
| GetMaxVertexUniformComponents
| GetMaxFragmentUniformComponents
| GetMaxVertexAttribs
| GetMaxVaryingFloats
| GetPatchVertices
| GetMaxPatchVertices
| GetMaxTessGenLevel
| GetMatrixMode
| GetModelviewStackDepth
| GetProjectionStackDepth
| GetTextureStackDepth
| GetColorMatrixStackDepth
| GetMaxModelviewStackDepth
| GetMaxProjectionStackDepth
| GetMaxTextureStackDepth
| GetMaxColorMatrixStackDepth
| GetMaxMatrixPaletteStackDepth
| GetCurrentMatrixStackDepth
| GetActiveTexture
| GetVertexArraySize
| GetVertexArrayType
| GetVertexArrayStride
| GetNormalArrayType
| GetNormalArrayStride
| GetColorArraySize
| GetColorArrayType
| GetColorArrayStride
| GetIndexArrayType
| GetIndexArrayStride
| GetTextureCoordArraySize
| GetTextureCoordArrayType
| GetTextureCoordArrayStride
| GetEdgeFlagArrayStride
| GetFogCoordArrayType
| GetFogCoordArrayStride
| GetSecondaryColorArraySize
| GetSecondaryColorArrayType
| GetSecondaryColorArrayStride
| GetArrayElementLockCount
| GetArrayElementLockFirst
| GetClientActiveTexture
| GetMaxElementsVertices
| GetMaxElementsIndices
| GetPrimitiveRestartIndex
| GetPrimitiveRestartNV
| GetPrimitiveRestartIndexNV
| GetArrayBufferBinding
| GetAtomicCounterBufferBinding
| GetCopyReadBufferBinding
| GetCopyWriteBufferBinding
| GetDispatchIndirectBufferBinding
| GetDrawIndirectBufferBinding
| GetElementArrayBufferBinding
| GetPixelPackBufferBinding
| GetPixelUnpackBufferBinding
| GetQueryBufferBinding
| GetShaderStorageBufferBinding
| GetTransformFeedbackBufferBinding
| GetUniformBufferBinding
| GetVertexArrayBufferBinding
| GetNormalArrayBufferBinding
| GetColorArrayBufferBinding
| GetIndexArrayBufferBinding
| GetTextureCoordArrayBufferBinding
| GetEdgeFlagArrayBufferBinding
| GetSecondaryColorArrayBufferBinding
| GetFogCoordArrayBufferBinding
| GetMaxClipPlanes
| GetMaxLights
| GetFrontFace
| GetLightModelLocalViewer
| GetLightModelTwoSide
| GetLightModelColorControl
| GetColorMaterialFace
| GetColorMaterialParameter
| GetShadeModel
| GetFragmentColorClamp
| GetVertexColorClamp
| GetReadColorClamp
| GetMaxEvalOrder
| GetMap1GridSegments
| GetFogMode
| GetFogIndex
| GetFogCoordSrc
| GetFogDistanceMode
| GetAuxBuffers
| GetDoublebuffer
| GetStereo
| GetRedBits
| GetGreenBits
| GetBlueBits
| GetAlphaBits
| GetStencilBits
| GetDepthBits
| GetAccumRedBits
| GetAccumGreenBits
| GetAccumBlueBits
| GetAccumAlphaBits
| GetDrawBuffer
| GetDrawBufferN GLsizei
| GetMaxDrawBuffers
| GetIndexWritemask
| GetDepthWritemask
| GetStencilWritemask
| GetStencilBackWritemask
| GetStencilClearValue
| GetCurrentProgram
| GetMaxTransformFeedbackSeparateAttribs
| GetMaxTransformFeedbackInterleavedComponents
| GetMaxTransformFeedbackSeparateComponents
| GetCurrentRasterIndex
| GetCurrentRasterPositionValid
| GetLineStippleRepeat
| GetLineStipplePattern
| GetSampleCoverageInvert
| GetAlphaTestFunc
| GetStencilFunc
| GetStencilBackFunc
| GetStencilValueMask
| GetStencilBackValueMask
| GetStencilRef
| GetStencilBackRef
| GetStencilFail
| GetStencilBackFail
| GetStencilPassDepthFail
| GetStencilBackPassDepthFail
| GetStencilPassDepthPass
| GetStencilBackPassDepthPass
| GetActiveStencilFace
| GetLogicOpMode
| GetBlendDst
| GetBlendSrc
| GetBlendSrcRGB
| GetBlendSrcAlpha
| GetBlendDstRGB
| GetBlendDstAlpha
| GetBlendEquation
| GetBlendEquationAlpha
| GetDepthFunc
| GetMapColor
| GetMapStencil
| GetIndexShift
| GetIndexOffset
| GetCullFaceMode
| GetNumCompressedTextureFormats
| GetMaxTextureSize
| GetMax3DTextureSize
| GetMaxCubeMapTextureSize
| GetMaxRectangleTextureSize
| GetMaxArrayTextureLayers
| GetMaxSampleMaskWords
| GetMaxColorTextureSamples
| GetMaxDepthTextureSamples
| GetMaxIntegerSamples
| GetReadBuffer
| GetTextureBinding1D
| GetTextureBinding2D
| GetTextureBinding3D
| GetTextureBinding1DArray
| GetTextureBinding2DArray
| GetTextureBindingCubeMapArray
| GetTextureBindingRectangle
| GetTextureBindingBuffer
| GetTextureBindingCubeMap
| GetTextureBinding2DMultisample
| GetTextureBinding2DMultisampleArray
| GetSubpixelBits
| GetSamples
| GetSampleBuffers
| GetMaxServerWaitTimeout
| GetMaxVertexStreams
| GetTimestamp
| GetShaderCompiler
| GetNumShaderBinaryFormats
| GetNumProgramBinaryFormats
| GetMaxDebugMessageLength
| GetMaxDebugLoggedMessages
| GetDebugLoggedMessages
| GetDebugNextLoggedMessageLength
| GetMaxDebugGroupStackDepth
| GetMaxLabelLength
| GetNumExtensions
instance GetPName1I PName1I where
instance GetPName PName1I where
marshalGetPName pn = case pn of
GetEdgeFlag -> Just GL_EDGE_FLAG
GetRGBAMode -> Just GL_RGBA_MODE
GetCurrentIndex -> Just GL_CURRENT_INDEX
GetMaxTextureUnits -> Just GL_MAX_TEXTURE_UNITS
GetListIndex -> Just GL_LIST_INDEX
GetListMode -> Just GL_LIST_MODE
GetMaxListNesting -> Just GL_MAX_LIST_NESTING
GetListBase -> Just GL_LIST_BASE
GetRenderMode -> Just GL_RENDER_MODE
GetDrawFramebufferBinding -> Just GL_DRAW_FRAMEBUFFER_BINDING
GetReadFramebufferBinding -> Just GL_READ_FRAMEBUFFER_BINDING
GetFramebufferBinding -> Just GL_FRAMEBUFFER_BINDING
GetRenderbufferBinding -> Just GL_RENDERBUFFER_BINDING
GetPerspectiveCorrectionHint -> Just GL_PERSPECTIVE_CORRECTION_HINT
GetPointSmoothHint -> Just GL_POINT_SMOOTH_HINT
GetLineSmoothHint -> Just GL_LINE_SMOOTH_HINT
GetPolygonSmoothHint -> Just GL_POLYGON_SMOOTH_HINT
GetFogHint -> Just GL_FOG_HINT
GetGenerateMipmapHint -> Just GL_GENERATE_MIPMAP_HINT
GetTextureCompressionHint -> Just GL_TEXTURE_COMPRESSION_HINT
GetPackCMYKHint -> Just GL_PACK_CMYK_HINT_EXT
GetUnpackCMYKHint -> Just GL_UNPACK_CMYK_HINT_EXT
GetVertexArrayBinding -> Just GL_VERTEX_ARRAY_BINDING
GetMaxNameStackDepth -> Just GL_MAX_NAME_STACK_DEPTH
GetNameStackDepth -> Just GL_NAME_STACK_DEPTH
GetContextProfileMask -> Just GL_CONTEXT_PROFILE_MASK
GetPackSwapBytes -> Just GL_PACK_SWAP_BYTES
GetUnpackSwapBytes -> Just GL_UNPACK_SWAP_BYTES
GetPackLSBFirst -> Just GL_PACK_LSB_FIRST
GetUnpackLSBFirst -> Just GL_UNPACK_LSB_FIRST
GetPackRowLength -> Just GL_PACK_ROW_LENGTH
GetUnpackRowLength -> Just GL_UNPACK_ROW_LENGTH
GetPackSkipRows -> Just GL_PACK_SKIP_ROWS
GetUnpackSkipRows -> Just GL_UNPACK_SKIP_ROWS
GetPackSkipPixels -> Just GL_PACK_SKIP_PIXELS
GetUnpackSkipPixels -> Just GL_UNPACK_SKIP_PIXELS
GetPackAlignment -> Just GL_PACK_ALIGNMENT
GetUnpackAlignment -> Just GL_UNPACK_ALIGNMENT
GetPackSkipImages -> Just GL_PACK_SKIP_IMAGES
GetUnpackSkipImages -> Just GL_UNPACK_SKIP_IMAGES
GetPackImageHeight -> Just GL_PACK_IMAGE_HEIGHT
GetUnpackImageHeight -> Just GL_UNPACK_IMAGE_HEIGHT
GetPixelMapIToISize -> Just GL_PIXEL_MAP_I_TO_I_SIZE
GetPixelMapSToSSize -> Just GL_PIXEL_MAP_S_TO_S_SIZE
GetPixelMapIToRSize -> Just GL_PIXEL_MAP_I_TO_R_SIZE
GetPixelMapIToGSize -> Just GL_PIXEL_MAP_I_TO_G_SIZE
GetPixelMapIToBSize -> Just GL_PIXEL_MAP_I_TO_B_SIZE
GetPixelMapIToASize -> Just GL_PIXEL_MAP_I_TO_A_SIZE
GetPixelMapRToRSize -> Just GL_PIXEL_MAP_R_TO_R_SIZE
GetPixelMapGToGSize -> Just GL_PIXEL_MAP_G_TO_G_SIZE
GetPixelMapBToBSize -> Just GL_PIXEL_MAP_B_TO_B_SIZE
GetPixelMapAToASize -> Just GL_PIXEL_MAP_A_TO_A_SIZE
GetMaxPixelMapTable -> Just GL_MAX_PIXEL_MAP_TABLE
GetMaxVertexTextureImageUnits -> Just GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
GetMaxTextureImageUnits -> Just GL_MAX_TEXTURE_IMAGE_UNITS
GetMaxCombinedTextureImageUnits -> Just GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
GetMaxTextureCoords -> Just GL_MAX_TEXTURE_COORDS
GetMaxVertexUniformComponents -> Just GL_MAX_VERTEX_UNIFORM_COMPONENTS
GetMaxFragmentUniformComponents -> Just GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
GetMaxVaryingFloats -> Just GL_MAX_VARYING_COMPONENTS
GetMaxVertexAttribs -> Just GL_MAX_VERTEX_ATTRIBS
GetPatchVertices -> Just GL_PATCH_VERTICES
GetMaxPatchVertices -> Just GL_MAX_PATCH_VERTICES
GetMaxTessGenLevel -> Just GL_MAX_TESS_GEN_LEVEL
GetMatrixMode -> Just GL_MATRIX_MODE
GetModelviewStackDepth -> Just GL_MODELVIEW_STACK_DEPTH
GetProjectionStackDepth -> Just GL_PROJECTION_STACK_DEPTH
GetTextureStackDepth -> Just GL_TEXTURE_STACK_DEPTH
GetColorMatrixStackDepth -> Just GL_COLOR_MATRIX_STACK_DEPTH
GetMaxModelviewStackDepth -> Just GL_MAX_MODELVIEW_STACK_DEPTH
GetMaxProjectionStackDepth -> Just GL_MAX_PROJECTION_STACK_DEPTH
GetMaxTextureStackDepth -> Just GL_MAX_TEXTURE_STACK_DEPTH
GetMaxColorMatrixStackDepth -> Just GL_MAX_COLOR_MATRIX_STACK_DEPTH
GetMaxMatrixPaletteStackDepth -> Just GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB
GetCurrentMatrixStackDepth -> Just GL_CURRENT_MATRIX_STACK_DEPTH_ARB
GetActiveTexture -> Just GL_ACTIVE_TEXTURE
GetVertexArraySize -> Just GL_VERTEX_ARRAY_SIZE
GetVertexArrayType -> Just GL_VERTEX_ARRAY_TYPE
GetVertexArrayStride -> Just GL_VERTEX_ARRAY_STRIDE
GetNormalArrayType -> Just GL_NORMAL_ARRAY_TYPE
GetNormalArrayStride -> Just GL_NORMAL_ARRAY_STRIDE
GetColorArraySize -> Just GL_COLOR_ARRAY_SIZE
GetColorArrayType -> Just GL_COLOR_ARRAY_TYPE
GetColorArrayStride -> Just GL_COLOR_ARRAY_STRIDE
GetIndexArrayType -> Just GL_INDEX_ARRAY_TYPE
GetIndexArrayStride -> Just GL_INDEX_ARRAY_STRIDE
GetTextureCoordArraySize -> Just GL_TEXTURE_COORD_ARRAY_SIZE
GetTextureCoordArrayType -> Just GL_TEXTURE_COORD_ARRAY_TYPE
GetTextureCoordArrayStride -> Just GL_TEXTURE_COORD_ARRAY_STRIDE
GetEdgeFlagArrayStride -> Just GL_EDGE_FLAG_ARRAY_STRIDE
GetFogCoordArrayType -> Just GL_FOG_COORD_ARRAY_TYPE
GetFogCoordArrayStride -> Just GL_FOG_COORD_ARRAY_STRIDE
GetSecondaryColorArraySize -> Just GL_SECONDARY_COLOR_ARRAY_SIZE
GetSecondaryColorArrayType -> Just GL_SECONDARY_COLOR_ARRAY_TYPE
GetSecondaryColorArrayStride -> Just GL_SECONDARY_COLOR_ARRAY_STRIDE
GetArrayElementLockCount -> Just GL_ARRAY_ELEMENT_LOCK_COUNT_EXT
GetArrayElementLockFirst -> Just GL_ARRAY_ELEMENT_LOCK_FIRST_EXT
GetClientActiveTexture -> Just GL_CLIENT_ACTIVE_TEXTURE
GetMaxElementsVertices -> Just GL_MAX_ELEMENTS_VERTICES
GetMaxElementsIndices -> Just GL_MAX_ELEMENTS_INDICES
GetPrimitiveRestartIndex -> Just GL_PRIMITIVE_RESTART_INDEX
GetPrimitiveRestartNV -> Just GL_PRIMITIVE_RESTART_NV
GetPrimitiveRestartIndexNV -> Just GL_PRIMITIVE_RESTART_INDEX_NV
GetArrayBufferBinding -> Just GL_ARRAY_BUFFER_BINDING
GetAtomicCounterBufferBinding -> Just GL_ATOMIC_COUNTER_BUFFER_BINDING
GetCopyReadBufferBinding -> Just GL_COPY_READ_BUFFER_BINDING
GetCopyWriteBufferBinding -> Just GL_COPY_WRITE_BUFFER_BINDING
GetDispatchIndirectBufferBinding -> Just GL_DISPATCH_INDIRECT_BUFFER_BINDING
GetDrawIndirectBufferBinding -> Just GL_DRAW_INDIRECT_BUFFER_BINDING
GetElementArrayBufferBinding -> Just GL_ELEMENT_ARRAY_BUFFER_BINDING
GetPixelPackBufferBinding -> Just GL_PIXEL_PACK_BUFFER_BINDING
GetPixelUnpackBufferBinding -> Just GL_PIXEL_UNPACK_BUFFER_BINDING
GetQueryBufferBinding -> Just GL_QUERY_BUFFER_BINDING
GetShaderStorageBufferBinding -> Just GL_SHADER_STORAGE_BUFFER_BINDING
GetTransformFeedbackBufferBinding -> Just GL_TRANSFORM_FEEDBACK_BUFFER_BINDING
GetUniformBufferBinding -> Just GL_UNIFORM_BUFFER_BINDING
GetVertexArrayBufferBinding -> Just GL_VERTEX_ARRAY_BUFFER_BINDING
GetNormalArrayBufferBinding -> Just GL_NORMAL_ARRAY_BUFFER_BINDING
GetColorArrayBufferBinding -> Just GL_COLOR_ARRAY_BUFFER_BINDING
GetIndexArrayBufferBinding -> Just GL_INDEX_ARRAY_BUFFER_BINDING
GetTextureCoordArrayBufferBinding -> Just GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING
GetEdgeFlagArrayBufferBinding -> Just GL_EDGE_FLAG_ARRAY_BUFFER_BINDING
GetSecondaryColorArrayBufferBinding -> Just GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING
GetFogCoordArrayBufferBinding -> Just GL_FOG_COORD_ARRAY_BUFFER_BINDING
GetMaxClipPlanes -> Just GL_MAX_CLIP_DISTANCES
GetMaxLights -> Just GL_MAX_LIGHTS
GetFrontFace -> Just GL_FRONT_FACE
GetLightModelLocalViewer -> Just GL_LIGHT_MODEL_LOCAL_VIEWER
GetLightModelTwoSide -> Just GL_LIGHT_MODEL_TWO_SIDE
GetLightModelColorControl -> Just GL_LIGHT_MODEL_COLOR_CONTROL
GetColorMaterialFace -> Just GL_COLOR_MATERIAL_FACE
GetColorMaterialParameter -> Just GL_COLOR_MATERIAL_PARAMETER
GetShadeModel -> Just GL_SHADE_MODEL
GetVertexColorClamp -> Just GL_CLAMP_VERTEX_COLOR
GetFragmentColorClamp -> Just GL_CLAMP_FRAGMENT_COLOR
GetReadColorClamp -> Just GL_CLAMP_READ_COLOR
GetMaxEvalOrder -> Just GL_MAX_EVAL_ORDER
GetMap1GridSegments -> Just GL_MAP1_GRID_SEGMENTS
GetFogMode -> Just GL_FOG_MODE
GetFogIndex -> Just GL_FOG_INDEX
GetFogCoordSrc -> Just GL_FOG_COORD_SRC
GetFogDistanceMode -> Just GL_FOG_DISTANCE_MODE_NV
GetAuxBuffers -> Just GL_AUX_BUFFERS
GetDoublebuffer -> Just GL_DOUBLEBUFFER
GetStereo -> Just GL_STEREO
GetRedBits -> Just GL_RED_BITS
GetGreenBits -> Just GL_GREEN_BITS
GetBlueBits -> Just GL_BLUE_BITS
GetAlphaBits -> Just GL_ALPHA_BITS
GetDepthBits -> Just GL_DEPTH_BITS
GetStencilBits -> Just GL_STENCIL_BITS
GetAccumRedBits -> Just GL_ACCUM_RED_BITS
GetAccumGreenBits -> Just GL_ACCUM_GREEN_BITS
GetAccumBlueBits -> Just GL_ACCUM_BLUE_BITS
GetAccumAlphaBits -> Just GL_ACCUM_ALPHA_BITS
GetDrawBuffer -> Just GL_DRAW_BUFFER
GetDrawBufferN i -> drawBufferIndexToEnum i
GetMaxDrawBuffers -> Just GL_MAX_DRAW_BUFFERS
GetIndexWritemask -> Just GL_INDEX_WRITEMASK
GetDepthWritemask -> Just GL_DEPTH_WRITEMASK
GetStencilWritemask -> Just GL_STENCIL_WRITEMASK
GetStencilBackWritemask -> Just GL_STENCIL_BACK_WRITEMASK
GetStencilClearValue -> Just GL_STENCIL_CLEAR_VALUE
GetCurrentProgram -> Just GL_CURRENT_PROGRAM
GetMaxTransformFeedbackSeparateAttribs -> Just GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS
GetMaxTransformFeedbackSeparateComponents -> Just GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS
GetMaxTransformFeedbackInterleavedComponents -> Just GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS
GetCurrentRasterIndex -> Just GL_CURRENT_RASTER_INDEX
GetCurrentRasterPositionValid -> Just GL_CURRENT_RASTER_POSITION_VALID
GetLineStipplePattern -> Just GL_LINE_STIPPLE_PATTERN
GetLineStippleRepeat -> Just GL_LINE_STIPPLE_REPEAT
GetSampleCoverageInvert -> Just GL_SAMPLE_COVERAGE_INVERT
GetAlphaTestFunc -> Just GL_ALPHA_TEST_FUNC
GetStencilFunc -> Just GL_STENCIL_FUNC
GetStencilBackFunc -> Just GL_STENCIL_BACK_FUNC
GetStencilValueMask -> Just GL_STENCIL_VALUE_MASK
GetStencilBackValueMask -> Just GL_STENCIL_BACK_VALUE_MASK
GetStencilRef -> Just GL_STENCIL_REF
GetStencilBackRef -> Just GL_STENCIL_BACK_REF
GetStencilFail -> Just GL_STENCIL_FAIL
GetStencilBackFail -> Just GL_STENCIL_BACK_FAIL
GetStencilPassDepthFail -> Just GL_STENCIL_PASS_DEPTH_FAIL
GetStencilBackPassDepthFail -> Just GL_STENCIL_BACK_PASS_DEPTH_FAIL
GetStencilPassDepthPass -> Just GL_STENCIL_PASS_DEPTH_PASS
GetStencilBackPassDepthPass -> Just GL_STENCIL_BACK_PASS_DEPTH_PASS
GetActiveStencilFace -> Just GL_ACTIVE_STENCIL_FACE_EXT
GetLogicOpMode -> Just GL_LOGIC_OP_MODE
GetBlendDst -> Just GL_BLEND_DST
GetBlendSrc -> Just GL_BLEND_SRC
GetBlendDstRGB -> Just GL_BLEND_DST_RGB
GetBlendSrcRGB -> Just GL_BLEND_SRC_RGB
GetBlendDstAlpha -> Just GL_BLEND_DST_ALPHA
GetBlendSrcAlpha -> Just GL_BLEND_SRC_ALPHA
GetBlendEquation -> Just GL_BLEND_EQUATION_RGB
GetBlendEquationAlpha -> Just GL_BLEND_EQUATION_ALPHA
GetDepthFunc -> Just GL_DEPTH_FUNC
GetMapColor -> Just GL_MAP_COLOR
GetMapStencil -> Just GL_MAP_STENCIL
GetIndexShift -> Just GL_INDEX_SHIFT
GetIndexOffset -> Just GL_INDEX_OFFSET
GetCullFaceMode -> Just GL_CULL_FACE_MODE
GetNumCompressedTextureFormats -> Just GL_NUM_COMPRESSED_TEXTURE_FORMATS
GetMaxTextureSize -> Just GL_MAX_TEXTURE_SIZE
GetMax3DTextureSize -> Just GL_MAX_3D_TEXTURE_SIZE
GetMaxCubeMapTextureSize -> Just GL_MAX_CUBE_MAP_TEXTURE_SIZE
GetMaxRectangleTextureSize -> Just GL_MAX_RECTANGLE_TEXTURE_SIZE
GetMaxArrayTextureLayers -> Just GL_MAX_ARRAY_TEXTURE_LAYERS
GetMaxSampleMaskWords -> Just GL_MAX_SAMPLE_MASK_WORDS
GetMaxColorTextureSamples -> Just GL_MAX_COLOR_TEXTURE_SAMPLES
GetMaxDepthTextureSamples -> Just GL_MAX_DEPTH_TEXTURE_SAMPLES
GetMaxIntegerSamples -> Just GL_MAX_INTEGER_SAMPLES
GetReadBuffer -> Just GL_READ_BUFFER
GetTextureBinding1D -> Just GL_TEXTURE_BINDING_1D
GetTextureBinding2D -> Just GL_TEXTURE_BINDING_2D
GetTextureBinding3D -> Just GL_TEXTURE_BINDING_3D
GetTextureBinding1DArray -> Just GL_TEXTURE_BINDING_1D_ARRAY
GetTextureBinding2DArray -> Just GL_TEXTURE_BINDING_2D_ARRAY
GetTextureBindingCubeMapArray -> Just GL_TEXTURE_BINDING_CUBE_MAP_ARRAY
GetTextureBindingRectangle -> Just GL_TEXTURE_BINDING_RECTANGLE
GetTextureBindingBuffer -> Just GL_TEXTURE_BINDING_BUFFER
GetTextureBindingCubeMap -> Just GL_TEXTURE_BINDING_CUBE_MAP
GetTextureBinding2DMultisample -> Just GL_TEXTURE_BINDING_2D_MULTISAMPLE
GetTextureBinding2DMultisampleArray -> Just GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY
GetSubpixelBits -> Just GL_SUBPIXEL_BITS
GetSampleBuffers -> Just GL_SAMPLE_BUFFERS
GetSamples -> Just GL_SAMPLES
GetMaxServerWaitTimeout -> Just GL_MAX_SERVER_WAIT_TIMEOUT
GetMaxVertexStreams -> Just GL_MAX_VERTEX_STREAMS
GetTimestamp -> Just GL_TIMESTAMP
GetShaderCompiler -> Just GL_SHADER_COMPILER
GetNumShaderBinaryFormats -> Just GL_NUM_SHADER_BINARY_FORMATS
GetNumProgramBinaryFormats -> Just GL_NUM_PROGRAM_BINARY_FORMATS
GetMaxDebugMessageLength -> Just GL_MAX_DEBUG_MESSAGE_LENGTH
GetMaxDebugLoggedMessages -> Just GL_MAX_DEBUG_LOGGED_MESSAGES
GetDebugLoggedMessages -> Just GL_DEBUG_LOGGED_MESSAGES
GetDebugNextLoggedMessageLength -> Just GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH
GetMaxDebugGroupStackDepth -> Just GL_MAX_DEBUG_GROUP_STACK_DEPTH
GetMaxLabelLength -> Just GL_MAX_LABEL_LENGTH
GetNumExtensions -> Just GL_NUM_EXTENSIONS
drawBufferIndexToEnum :: GLsizei -> Maybe GLenum
drawBufferIndexToEnum i
| 0 <= i && i <= maxDrawBufferIndex = Just (GL_DRAW_BUFFER0 + fromIntegral i)
| otherwise = Nothing
maxDrawBufferIndex :: GLsizei
maxDrawBufferIndex = fromIntegral (GL_DRAW_BUFFER15 - GL_DRAW_BUFFER0)
data PName1F
= GetCurrentFogCoord
| GetZoomX
| GetZoomY
| GetMaxShininess
| GetMaxSpotExponent
| GetFogStart
| GetFogEnd
| GetFogDensity
| GetDepthClearValue
| GetIndexClearValue
| GetCurrentRasterDistance
| GetPointSizeMin
| GetPointSizeMax
| GetPointFadeThresholdSize
| GetSmoothPointSizeGranularity
| GetPointSize
| GetLineWidth
| GetSmoothLineWidthGranularity
| GetSampleCoverageValue
| GetAlphaTestRef
| GetRedScale
| GetGreenScale
| GetBlueScale
| GetAlphaScale
| GetPostConvolutionRedScale
| GetPostConvolutionGreenScale
| GetPostConvolutionBlueScale
| GetPostConvolutionAlphaScale
| GetPostColorMatrixRedScale
| GetPostColorMatrixGreenScale
| GetPostColorMatrixBlueScale
| GetPostColorMatrixAlphaScale
| GetRedBias
| GetGreenBias
| GetBlueBias
| GetAlphaBias
| GetPostConvolutionRedBias
| GetPostConvolutionGreenBias
| GetPostConvolutionBlueBias
| GetPostConvolutionAlphaBias
| GetPostColorMatrixRedBias
| GetPostColorMatrixGreenBias
| GetPostColorMatrixBlueBias
| GetPostColorMatrixAlphaBias
| GetDepthScale
| GetDepthBias
| GetPolygonOffsetFactor
| GetPolygonOffsetUnits
| GetMaxTextureMaxAnisotropy
| GetMaxTextureLODBias
instance GetPName1F PName1F where
instance GetPName PName1F where
marshalGetPName pn = case pn of
GetCurrentFogCoord -> Just GL_CURRENT_FOG_COORD
GetZoomX -> Just GL_ZOOM_X
GetZoomY -> Just GL_ZOOM_Y
GetMaxShininess -> Just GL_MAX_SHININESS_NV
GetMaxSpotExponent -> Just GL_MAX_SPOT_EXPONENT_NV
GetFogStart -> Just GL_FOG_START
GetFogEnd -> Just GL_FOG_END
GetFogDensity -> Just GL_FOG_DENSITY
GetDepthClearValue -> Just GL_DEPTH_CLEAR_VALUE
GetIndexClearValue -> Just GL_INDEX_CLEAR_VALUE
GetCurrentRasterDistance -> Just GL_CURRENT_RASTER_DISTANCE
GetPointSizeMin -> Just GL_POINT_SIZE_MIN
GetPointSizeMax -> Just GL_POINT_SIZE_MAX
GetPointFadeThresholdSize -> Just GL_POINT_FADE_THRESHOLD_SIZE
GetSmoothPointSizeGranularity -> Just GL_POINT_SIZE_GRANULARITY
GetPointSize -> Just GL_POINT_SIZE
GetSmoothLineWidthGranularity -> Just GL_SMOOTH_LINE_WIDTH_GRANULARITY
GetLineWidth -> Just GL_LINE_WIDTH
GetSampleCoverageValue -> Just GL_SAMPLE_COVERAGE_VALUE
GetAlphaTestRef -> Just GL_ALPHA_TEST_REF
GetRedScale -> Just GL_RED_SCALE
GetRedBias -> Just GL_RED_BIAS
GetGreenScale -> Just GL_GREEN_SCALE
GetGreenBias -> Just GL_GREEN_BIAS
GetBlueScale -> Just GL_BLUE_SCALE
GetBlueBias -> Just GL_BLUE_BIAS
GetAlphaScale -> Just GL_ALPHA_SCALE
GetAlphaBias -> Just GL_ALPHA_BIAS
GetPostConvolutionRedScale -> Just GL_POST_CONVOLUTION_RED_SCALE
GetPostConvolutionGreenScale -> Just GL_POST_CONVOLUTION_GREEN_SCALE
GetPostConvolutionBlueScale -> Just GL_POST_CONVOLUTION_BLUE_SCALE
GetPostConvolutionAlphaScale -> Just GL_POST_CONVOLUTION_ALPHA_SCALE
GetPostConvolutionRedBias -> Just GL_POST_CONVOLUTION_RED_BIAS
GetPostConvolutionGreenBias -> Just GL_POST_CONVOLUTION_GREEN_BIAS
GetPostConvolutionBlueBias -> Just GL_POST_CONVOLUTION_BLUE_BIAS
GetPostConvolutionAlphaBias -> Just GL_POST_CONVOLUTION_ALPHA_BIAS
GetPostColorMatrixRedScale -> Just GL_POST_COLOR_MATRIX_RED_SCALE
GetPostColorMatrixGreenScale -> Just GL_POST_COLOR_MATRIX_GREEN_SCALE
GetPostColorMatrixBlueScale -> Just GL_POST_COLOR_MATRIX_BLUE_SCALE
GetPostColorMatrixAlphaScale -> Just GL_POST_COLOR_MATRIX_ALPHA_SCALE
GetPostColorMatrixRedBias -> Just GL_POST_COLOR_MATRIX_RED_BIAS
GetPostColorMatrixGreenBias -> Just GL_POST_COLOR_MATRIX_GREEN_BIAS
GetPostColorMatrixBlueBias -> Just GL_POST_COLOR_MATRIX_BLUE_BIAS
GetPostColorMatrixAlphaBias -> Just GL_POST_COLOR_MATRIX_ALPHA_BIAS
GetDepthScale -> Just GL_DEPTH_SCALE
GetDepthBias -> Just GL_DEPTH_BIAS
GetPolygonOffsetFactor -> Just GL_POLYGON_OFFSET_FACTOR
GetPolygonOffsetUnits -> Just GL_POLYGON_OFFSET_UNITS
GetMaxTextureMaxAnisotropy -> Just GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
GetMaxTextureLODBias -> Just GL_MAX_TEXTURE_LOD_BIAS
data IPName1I =
GetAtomicCounterBuffer
| GetAtomicCounterBufferStart
| GetAtomicCounterBufferSize
| GetShaderStorageBuffer
| GetShaderStorageBufferStart
| GetShaderStorageBufferSize
| GetTransformFeedbackBuffer
| GetTransformFeedbackBufferStart
| GetTransformFeedbackBufferSize
| GetUniformBuffer
| GetUniformBufferStart
| GetUniformBufferSize
instance GetIPName1I IPName1I where
instance GetPName IPName1I where
marshalGetPName pn = case pn of
GetAtomicCounterBuffer -> Just GL_ATOMIC_COUNTER_BUFFER
GetAtomicCounterBufferStart -> Just GL_ATOMIC_COUNTER_BUFFER_START
GetAtomicCounterBufferSize -> Just GL_ATOMIC_COUNTER_BUFFER_SIZE
GetShaderStorageBuffer -> Just GL_SHADER_STORAGE_BUFFER
GetShaderStorageBufferStart -> Just GL_SHADER_STORAGE_BUFFER_START
GetShaderStorageBufferSize -> Just GL_SHADER_STORAGE_BUFFER_SIZE
GetTransformFeedbackBuffer -> Just GL_TRANSFORM_FEEDBACK_BUFFER
GetTransformFeedbackBufferStart -> Just GL_TRANSFORM_FEEDBACK_BUFFER_START
GetTransformFeedbackBufferSize -> Just GL_TRANSFORM_FEEDBACK_BUFFER_SIZE
GetUniformBuffer -> Just GL_UNIFORM_BUFFER
GetUniformBufferStart -> Just GL_UNIFORM_BUFFER_START
GetUniformBufferSize -> Just GL_UNIFORM_BUFFER_SIZE
data PName2I
= GetMaxViewportDims
| GetMap2GridSegments
| GetPolygonMode
instance GetPName2I PName2I where
instance GetPName PName2I where
marshalGetPName pn = case pn of
GetMaxViewportDims -> Just GL_MAX_VIEWPORT_DIMS
GetMap2GridSegments -> Just GL_MAP2_GRID_SEGMENTS
GetPolygonMode -> Just GL_POLYGON_MODE
data PName2F
= GetDepthRange
| GetMap1GridDomain
| GetAliasedPointSizeRange
| GetSmoothPointSizeRange
| GetAliasedLineWidthRange
| GetSmoothLineWidthRange
| GetDepthBounds
| GetPatchDefaultInnerLevel
instance GetPName2F PName2F where
instance GetPName PName2F where
marshalGetPName pn = case pn of
GetDepthRange -> Just GL_DEPTH_RANGE
GetMap1GridDomain -> Just GL_MAP1_GRID_DOMAIN
GetAliasedPointSizeRange -> Just GL_ALIASED_POINT_SIZE_RANGE
GetSmoothPointSizeRange -> Just GL_POINT_SIZE_RANGE
GetAliasedLineWidthRange -> Just GL_ALIASED_LINE_WIDTH_RANGE
GetSmoothLineWidthRange -> Just GL_SMOOTH_LINE_WIDTH_RANGE
GetDepthBounds -> Just GL_DEPTH_BOUNDS_EXT
GetPatchDefaultInnerLevel -> Just GL_PATCH_DEFAULT_INNER_LEVEL
data PName3F
= GetCurrentNormal
| GetPointDistanceAttenuation
instance GetPName3F PName3F where
instance GetPName PName3F where
marshalGetPName pn = case pn of
GetCurrentNormal -> Just GL_CURRENT_NORMAL
GetPointDistanceAttenuation -> Just GL_POINT_DISTANCE_ATTENUATION
data PName4I
= GetViewport
| GetRGBASignedComponents
| GetScissorBox
instance GetPName4I PName4I where
instance GetPName PName4I where
marshalGetPName pn = case pn of
GetViewport -> Just GL_VIEWPORT
GetRGBASignedComponents -> Just GL_RGBA_SIGNED_COMPONENTS_EXT
GetScissorBox -> Just GL_SCISSOR_BOX
data PName4ISemiIndexed
= GetColorWritemask
instance GetPName4I PName4ISemiIndexed where
instance GetIPName4I PName4ISemiIndexed where
instance GetPName PName4ISemiIndexed where
marshalGetPName pn = case pn of
GetColorWritemask -> Just GL_COLOR_WRITEMASK
data PName4F
= GetCurrentColor
| GetCurrentTextureCoords
| GetCurrentSecondaryColor
| GetLightModelAmbient
| GetMap2GridDomain
| GetFogColor
| GetColorClearValue
| GetAccumClearValue
| GetCurrentRasterColor
| GetCurrentRasterSecondaryColor
| GetCurrentRasterTextureCoords
| GetCurrentRasterPosition
| GetBlendColor
| GetPatchDefaultOuterLevel
instance GetPName4F PName4F where
instance GetPName PName4F where
marshalGetPName pn = case pn of
GetCurrentColor -> Just GL_CURRENT_COLOR
GetCurrentTextureCoords -> Just GL_CURRENT_TEXTURE_COORDS
GetCurrentSecondaryColor -> Just GL_CURRENT_SECONDARY_COLOR
GetLightModelAmbient -> Just GL_LIGHT_MODEL_AMBIENT
GetMap2GridDomain -> Just GL_MAP2_GRID_DOMAIN
GetFogColor -> Just GL_FOG_COLOR
GetColorClearValue -> Just GL_COLOR_CLEAR_VALUE
GetAccumClearValue -> Just GL_ACCUM_CLEAR_VALUE
GetCurrentRasterColor -> Just GL_CURRENT_RASTER_COLOR
GetCurrentRasterSecondaryColor -> Just GL_CURRENT_RASTER_SECONDARY_COLOR
GetCurrentRasterTextureCoords -> Just GL_CURRENT_RASTER_TEXTURE_COORDS
GetCurrentRasterPosition -> Just GL_CURRENT_RASTER_POSITION
GetBlendColor -> Just GL_BLEND_COLOR
GetPatchDefaultOuterLevel -> Just GL_PATCH_DEFAULT_OUTER_LEVEL
clipPlaneIndexToEnum :: GLsizei -> Maybe GLenum
clipPlaneIndexToEnum i
| 0 <= i && i <= maxClipPlaneIndex = Just (GL_CLIP_DISTANCE0 + fromIntegral i)
| otherwise = Nothing
maxClipPlaneIndex :: GLsizei
maxClipPlaneIndex = 0xFFF
data PNameNI
= GetCompressedTextureFormats
| GetShaderBinaryFormats
| GetProgramBinaryFormats
instance GetPNameNI PNameNI where
instance GetPName PNameNI where
marshalGetPName pn = case pn of
GetCompressedTextureFormats -> Just GL_COMPRESSED_TEXTURE_FORMATS
GetShaderBinaryFormats -> Just GL_SHADER_BINARY_FORMATS
GetProgramBinaryFormats -> Just GL_PROGRAM_BINARY_FORMATS
data PNameMatrix
= GetModelviewMatrix
| GetProjectionMatrix
| GetTextureMatrix
| GetColorMatrix
| GetMatrixPalette
instance GetPNameMatrix PNameMatrix where
instance GetPName PNameMatrix where
marshalGetPName pn = case pn of
GetModelviewMatrix -> Just GL_MODELVIEW_MATRIX
GetProjectionMatrix -> Just GL_PROJECTION_MATRIX
GetTextureMatrix -> Just GL_TEXTURE_MATRIX
GetColorMatrix -> Just GL_COLOR_MATRIX
GetMatrixPalette -> Just GL_MATRIX_PALETTE_ARB
data GetPointervPName =
DebugCallbackFunction
| DebugCallbackUserParam
| SelectionBufferPointer
| FeedbackBufferPointer
| VertexArrayPointer
| NormalArrayPointer
| ColorArrayPointer
| SecondaryColorArrayPointer
| IndexArrayPointer
| TextureCoordArrayPointer
| FogCoordArrayPointer
| EdgeFlagArrayPointer
| WeightArrayPointer
| MatrixIndexArrayPointer
marshalGetPointervPName :: GetPointervPName -> GLenum
marshalGetPointervPName x = case x of
DebugCallbackFunction -> GL_DEBUG_CALLBACK_FUNCTION
DebugCallbackUserParam -> GL_DEBUG_CALLBACK_USER_PARAM
SelectionBufferPointer -> GL_SELECTION_BUFFER_POINTER
FeedbackBufferPointer -> GL_FEEDBACK_BUFFER_POINTER
VertexArrayPointer -> GL_VERTEX_ARRAY_POINTER
NormalArrayPointer -> GL_NORMAL_ARRAY_POINTER
ColorArrayPointer -> GL_COLOR_ARRAY_POINTER
SecondaryColorArrayPointer -> GL_SECONDARY_COLOR_ARRAY_POINTER
IndexArrayPointer -> GL_INDEX_ARRAY_POINTER
TextureCoordArrayPointer -> GL_TEXTURE_COORD_ARRAY_POINTER
FogCoordArrayPointer -> GL_FOG_COORD_ARRAY_POINTER
EdgeFlagArrayPointer -> GL_EDGE_FLAG_ARRAY_POINTER
WeightArrayPointer -> GL_WEIGHT_ARRAY_POINTER_ARB
MatrixIndexArrayPointer -> GL_MATRIX_INDEX_ARRAY_POINTER_ARB
getPointer :: GetPointervPName -> IO (Ptr a)
getPointer n = with nullPtr $ \buf -> do
glGetPointerv (marshalGetPointervPName n) buf
peek buf