h-raylib-5.5.1.0: Raylib bindings for Haskell
Safe HaskellNone
LanguageHaskell2010

Raylib.Util.RLGL

Description

Bindings to rlgl

Synopsis

High level

Matrix operations

rlMatrixMode :: RLMatrixMode -> IO () Source #

Choose the current matrix to be transformed

rlPushMatrix :: IO () Source #

Push the current matrix to stack

rlPopMatrix :: IO () Source #

Pop latest inserted matrix from stack

rlLoadIdentity :: IO () Source #

Reset current matrix to identity matrix

rlTranslatef :: Float -> Float -> Float -> IO () Source #

Multiply the current matrix by a translation matrix

rlRotatef :: Float -> Float -> Float -> Float -> IO () Source #

Multiply the current matrix by a rotation matrix

rlScalef :: Float -> Float -> Float -> IO () Source #

Multiply the current matrix by a scaling matrix

rlMultMatrixf :: [Float] -> IO () Source #

Multiply the current matrix by another matrix

rlFrustum :: Double -> Double -> Double -> Double -> Double -> Double -> IO () Source #

Multiply the current matrix by a perspective matrix generated by parameters

rlOrtho :: Double -> Double -> Double -> Double -> Double -> Double -> IO () Source #

Multiply the current matrix by an orthographic matrix generated by parameters

rlViewport :: Int -> Int -> Int -> Int -> IO () Source #

Set the viewport area

rlSetClipPlanes :: Double -> Double -> IO () Source #

Set clip planes distances

rlGetCullDistanceNear :: IO Double Source #

Get cull plane distance near

rlGetCullDistanceFar :: IO Double Source #

Get cull plane distance far

Vertex level operations

rlBegin :: RLDrawMode -> IO () Source #

Initialize drawing mode (how to organize vertex)

rlEnd :: IO () Source #

Finish vertex providing

rlVertex2i :: Int -> Int -> IO () Source #

Define one vertex (position) - 2 int

rlVertex2f :: Float -> Float -> IO () Source #

Define one vertex (position) - 2 float

rlVertex3f :: Float -> Float -> Float -> IO () Source #

Define one vertex (position) - 3 float

rlTexCoord2f :: Float -> Float -> IO () Source #

Define one vertex (texture coordinate) - 2 float

rlNormal3f :: Float -> Float -> Float -> IO () Source #

Define one vertex (normal) - 3 float

rlColor4ub :: Word8 -> Word8 -> Word8 -> Word8 -> IO () Source #

Define one vertex (color) - 4 byte

rlColor3f :: Float -> Float -> Float -> IO () Source #

Define one vertex (color) - 3 float

rlColor4f :: Float -> Float -> Float -> Float -> IO () Source #

Define one vertex (color) - 4 float

OpenGL style functions (common to 1.1, 3.3+, ES2)

NOTE: These functions are used to completely abstract raylib code from OpenGL layer, some of them are direct wrappers over OpenGL calls, some others are custom

Vertex buffers state

rlEnableVertexArray :: Integer -> IO Bool Source #

Enable vertex array (VAO, if supported)

rlDisableVertexArray :: IO () Source #

Disable vertex array (VAO, if supported)

rlEnableVertexBuffer :: Integer -> IO () Source #

Enable vertex buffer (VBO)

rlDisableVertexBuffer :: IO () Source #

Disable vertex buffer (VBO)

rlEnableVertexBufferElement :: Integer -> IO () Source #

Enable vertex buffer element (VBO element)

rlDisableVertexBufferElement :: IO () Source #

Disable vertex buffer element (VBO element)

rlEnableVertexAttribute :: Integer -> IO () Source #

Enable vertex attribute index

rlDisableVertexAttribute :: Integer -> IO () Source #

Disable vertex attribute index

Textures state

rlActiveTextureSlot :: Int -> IO () Source #

Select and active a texture slot

rlEnableTexture :: Integer -> IO () Source #

Enable texture

rlDisableTexture :: IO () Source #

Disable texture

rlEnableTextureCubemap :: Integer -> IO () Source #

Enable texture cubemap

rlDisableTextureCubemap :: IO () Source #

Disable texture cubemap

rlTextureParameters :: Integer -> RLTextureParam -> Int -> IO () Source #

Set texture parameters (filter, wrap)

rlCubemapParameters :: Integer -> RLTextureParam -> Int -> IO () Source #

Set cubemap parameters (filter, wrap)

Shader state

rlEnableShader :: Integer -> IO () Source #

Enable shader program

rlDisableShader :: IO () Source #

Disable shader program

Framebuffer state

rlEnableFramebuffer :: Integer -> IO () Source #

Enable render texture (fbo)

rlDisableFramebuffer :: IO () Source #

Disable render texture (fbo), return to default framebuffer

rlGetActiveFramebuffer :: IO Integer Source #

Get the currently active render texture (fbo), 0 for default framebuffer

rlActiveDrawBuffers :: Int -> IO () Source #

Activate multiple draw color buffers

rlBlitFramebuffer :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> [RLBitField] -> IO () Source #

Blit active framebuffer to main framebuffer

rlBindFramebuffer :: Integer -> Integer -> IO () Source #

Bind framebuffer (FBO)

General render state

rlEnableColorBlend :: IO () Source #

Enable color blending

rlDisableColorBlend :: IO () Source #

Disable color blending

rlEnableDepthTest :: IO () Source #

Enable depth test

rlDisableDepthTest :: IO () Source #

Disable depth test

rlEnableDepthMask :: IO () Source #

Enable depth write

rlDisableDepthMask :: IO () Source #

Disable depth write

rlEnableBackfaceCulling :: IO () Source #

Enable backface culling

rlDisableBackfaceCulling :: IO () Source #

Disable backface culling

rlColorMask :: Bool -> Bool -> Bool -> Bool -> IO () Source #

Color mask control

rlSetCullFace :: RLCullMode -> IO () Source #

Set face culling mode

rlEnableScissorTest :: IO () Source #

Enable scissor test

rlDisableScissorTest :: IO () Source #

Disable scissor test

rlScissor :: Int -> Int -> Int -> Int -> IO () Source #

Scissor test

rlEnableWireMode :: IO () Source #

Enable wire mode

rlEnablePointMode :: IO () Source #

Enable point mode

rlDisableWireMode :: IO () Source #

Disable wire and point mode

rlSetLineWidth :: Float -> IO () Source #

Set the line drawing width

rlGetLineWidth :: IO Float Source #

Get the line drawing width

rlEnableSmoothLines :: IO () Source #

Enable line aliasing

rlDisableSmoothLines :: IO () Source #

Disable line aliasing

rlEnableStereoRender :: IO () Source #

Enable stereo rendering

rlDisableStereoRender :: IO () Source #

Disable stereo rendering

rlIsStereoRenderEnabled :: IO Bool Source #

Check if stereo render is enabled

rlClearColor :: Word8 -> Word8 -> Word8 -> Word8 -> IO () Source #

Clear color buffer with color

rlClearScreenBuffers :: IO () Source #

Clear used screen buffers (color and depth)

rlCheckErrors :: IO () Source #

Check and log OpenGL error codes

rlSetBlendMode :: RLBlendMode -> IO () Source #

Set blending mode

rlSetBlendFactors :: Int -> Int -> Int -> IO () Source #

Set blending mode factor and equation (using OpenGL factors)

rlSetBlendFactorsSeparate :: Int -> Int -> Int -> Int -> Int -> Int -> IO () Source #

Set blending mode factors and equations separately (using OpenGL factors)

rlgl functionality

rlgl initialization functions

rlglInit :: Int -> Int -> IO () Source #

Initialize rlgl (buffers, shaders, textures, states)

rlglClose :: IO () Source #

De-initialize rlgl (buffers, shaders, textures)

rlLoadExtensions :: Ptr () -> IO () Source #

Load OpenGL extensions (loader function required)

rlGetVersion :: IO Int Source #

Get current OpenGL version

rlSetFramebufferWidth :: Int -> IO () Source #

Set current framebuffer width

rlGetFramebufferWidth :: IO Int Source #

Get default framebuffer width

rlSetFramebufferHeight :: Int -> IO () Source #

Set current framebuffer height

rlGetFramebufferHeight :: IO Int Source #

Get default framebuffer height

rlGetTextureIdDefault :: IO Integer Source #

Get default texture id

rlGetShaderIdDefault :: IO Integer Source #

Get default shader id

rlGetShaderLocsDefault :: IO [Int] Source #

Get default shader locations

Render batch management

NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode but this render batch API is exposed in case custom batches are required

rlLoadRenderBatch :: Int -> Int -> IO RLRenderBatch Source #

Load a render batch system

rlUnloadRenderBatch :: RLRenderBatch -> IO () Source #

Unload render batch system

rlDrawRenderBatch :: RLRenderBatch -> IO RLRenderBatch Source #

Draw render batch data (Update->Draw->Reset)

rlSetRenderBatchActive :: Maybe RLRenderBatch -> IO () Source #

Set the active render batch for rlgl (NULL for default internal)

rlDrawRenderBatchActive :: IO () Source #

Update and draw internal render batch

rlCheckRenderBatchLimit :: Int -> IO Bool Source #

Check internal buffer overflow for a given number of vertex

rlSetTexture :: Integer -> IO () Source #

Set current texture for render batch and check buffers limits

Vertex buffers management

rlLoadVertexArray :: IO Integer Source #

Load vertex array (vao) if supported

rlLoadVertexBuffer :: (Freeable a, Storable a) => [a] -> Int -> Bool -> IO Integer Source #

Load a vertex buffer attribute

rlLoadVertexBufferElement :: (Freeable a, Storable a) => [a] -> Int -> Bool -> IO Integer Source #

Load a new attributes element buffer (typically the buffer data will be a list of Ints)

rlUpdateVertexBuffer :: (Freeable a, Storable a) => Integer -> [a] -> Int -> Int -> IO () Source #

Update GPU buffer with new data. WARNING: Fails on empty list

rlUpdateVertexBufferElements :: (Freeable a, Storable a) => Integer -> [a] -> Int -> Int -> IO () Source #

Update vertex buffer elements with new data (typically the buffer data will be a list of Ints). WARNING: Fails on empty list

rlUnloadVertexArray :: Integer -> IO () Source #

Unload vertex array object (VAO)

rlUnloadVertexBuffer :: Integer -> IO () Source #

Unload vertex buffer (VBO)

rlSetVertexAttribute :: Integer -> Int -> Int -> Bool -> Int -> Int -> IO () Source #

Set vertex attribute (the type must be a valid GLenum value)

rlSetVertexAttributeDivisor :: Integer -> Int -> IO () Source #

Set vertex attribute divisor

rlSetVertexAttributeDefault :: Int -> Ptr () -> Int -> Int -> IO () Source #

Set vertex attribute default value

rlDrawVertexArray :: Int -> Int -> IO () Source #

Draw vertex array

rlDrawVertexArrayElements :: Int -> [Int] -> IO () Source #

Draw vertex array elements

rlDrawVertexArrayInstanced :: Int -> Int -> Int -> IO () Source #

Draw vertex array instanced

rlDrawVertexArrayElementsInstanced :: Int -> [Int] -> Int -> IO () Source #

Draw vertex array elements instanced

Textures management

rlLoadTexture :: [Int] -> Int -> Int -> RLPixelFormat -> Int -> IO Integer Source #

Load texture in GPU

rlLoadTextureDepth :: Int -> Int -> Bool -> IO Integer Source #

Load depth texture/renderbuffer (to be attached to fbo)

rlLoadTextureCubemap :: [Int] -> RLPixelFormat -> IO Integer Source #

Load texture cubemap

rlUpdateTexture :: (Freeable a, Storable a) => Integer -> Int -> Int -> Int -> Int -> RLPixelFormat -> [a] -> IO () Source #

Update GPU texture with new data

rlGetGlTextureFormats Source #

Arguments

:: RLPixelFormat 
-> IO (Integer, Integer, Integer)

Return type as tuple: (glInternalFormat, glFormat, glType)

Get OpenGL internal formats

rlGetPixelFormatName :: RLPixelFormat -> String Source #

Get name string for pixel format

rlUnloadTexture :: Integer -> IO () Source #

Unload texture from GPU memory

rlGenTextureMipmaps Source #

Arguments

:: Integer 
-> Int 
-> Int 
-> RLPixelFormat 
-> IO Int

The number of mipmaps generated

Generate mipmap data for selected texture

rlReadTexturePixels :: Integer -> Int -> Int -> RLPixelFormat -> IO [Word8] Source #

Read texture pixel data

rlReadScreenPixels :: Int -> Int -> IO [Word8] Source #

Read screen pixel data (color buffer)

Framebuffer management (fbo)

rlLoadFramebuffer :: IO Integer Source #

Load an empty framebuffer

rlFramebufferAttach :: Integer -> Integer -> RLFramebufferAttachType -> RLFramebufferAttachTextureType -> Int -> IO () Source #

Attach texture/renderbuffer to a framebuffer

rlFramebufferComplete :: Integer -> IO Bool Source #

Verify framebuffer is complete

rlUnloadFramebuffer :: Integer -> IO () Source #

Delete framebuffer from GPU

Shaders management

rlLoadShaderCode :: String -> String -> IO Integer Source #

Load shader from code strings

rlCompileShader :: String -> RLShaderType -> IO Integer Source #

Compile custom shader and return shader id

rlLoadShaderProgram :: Integer -> Integer -> IO Integer Source #

Load custom shader program

rlUnloadShaderProgram :: Integer -> IO () Source #

Unload shader program

rlGetLocationUniform :: Integer -> String -> IO Int Source #

Get shader location uniform

rlGetLocationAttrib :: Integer -> String -> IO Int Source #

Get shader location attribute

rlSetUniform :: Int -> ShaderUniformDataV -> IO () Source #

Set shader value uniform

rlSetUniformMatrix :: Int -> Matrix -> IO () Source #

Set shader value matrix

rlSetUniformMatrices :: Int -> [Matrix] -> IO () Source #

Set shader value matrices

rlSetUniformSampler :: Int -> Integer -> IO () Source #

Set shader value sampler

rlSetShader :: Integer -> [Int] -> IO () Source #

Set shader currently active (id and locations)

Compute shader management

rlLoadComputeShaderProgram :: Integer -> IO Integer Source #

Load compute shader program

rlComputeShaderDispatch :: Integer -> Integer -> Integer -> IO () Source #

Dispatch compute shader (equivalent to *draw* for graphics pipeline)

Shader buffer storage object management (ssbo)

rlLoadShaderBuffer :: (Freeable a, Storable a) => Integer -> [a] -> RLBufferHint -> IO Integer Source #

Load shader storage buffer object (SSBO). WARNING: Fails if list is empty

rlUnloadShaderBuffer :: Integer -> IO () Source #

Unload shader storage buffer object (SSBO)

rlUpdateShaderBuffer :: (Freeable a, Storable a) => Integer -> a -> Integer -> IO () Source #

Update SSBO buffer data

rlBindShaderBuffer :: Integer -> Integer -> IO () Source #

Bind SSBO buffer

rlCopyShaderBuffer :: Integer -> Integer -> Integer -> Integer -> Integer -> IO () Source #

Copy SSBO data between buffers

rlGetShaderBufferSize :: Integer -> IO Integer Source #

Get SSBO buffer size

Buffer management

rlBindImageTexture :: Integer -> Integer -> RLPixelFormat -> Bool -> IO () Source #

Bind image texture

Matrix state management

rlGetMatrixModelview :: IO Matrix Source #

Get internal modelview matrix

rlGetMatrixProjection :: IO Matrix Source #

Get internal projection matrix

rlGetMatrixTransform :: IO Matrix Source #

Get internal accumulated transform matrix

rlGetMatrixProjectionStereo :: Int -> IO Matrix Source #

Get internal projection matrix for stereo render (selected eye)

rlGetMatrixViewOffsetStereo :: Int -> IO Matrix Source #

Get internal view offset matrix for stereo render (selected eye)

rlSetMatrixProjection :: Matrix -> IO () Source #

Set a custom projection matrix (replaces internal projection matrix)

rlSetMatrixModelview :: Matrix -> IO () Source #

Set a custom modelview matrix (replaces internal modelview matrix)

rlSetMatrixProjectionStereo :: Matrix -> Matrix -> IO () Source #

Set eyes projection matrices for stereo rendering

rlSetMatrixViewOffsetStereo :: Matrix -> Matrix -> IO () Source #

Set eyes view offsets matrices for stereo rendering

Quick and dirty cube/quad buffers load->draw->unload

rlLoadDrawCube :: IO () Source #

Load and draw a cube

rlLoadDrawQuad :: IO () Source #

Load and draw a quad

Native

c'rlMatrixMode :: CInt -> IO () Source #

c'rlTranslatef :: CFloat -> CFloat -> CFloat -> IO () Source #

c'rlRotatef :: CFloat -> CFloat -> CFloat -> CFloat -> IO () Source #

c'rlScalef :: CFloat -> CFloat -> CFloat -> IO () Source #

c'rlMultMatrixf :: Ptr CFloat -> IO () Source #

c'rlFrustum :: CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> IO () Source #

c'rlOrtho :: CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> CDouble -> IO () Source #

c'rlViewport :: CInt -> CInt -> CInt -> CInt -> IO () Source #

c'rlSetClipPlanes :: CDouble -> CDouble -> IO () Source #

c'rlBegin :: CInt -> IO () Source #

c'rlVertex2i :: CInt -> CInt -> IO () Source #

c'rlVertex2f :: CFloat -> CFloat -> IO () Source #

c'rlVertex3f :: CFloat -> CFloat -> CFloat -> IO () Source #

c'rlTexCoord2f :: CFloat -> CFloat -> IO () Source #

c'rlNormal3f :: CFloat -> CFloat -> CFloat -> IO () Source #

c'rlColor4ub :: CUChar -> CUChar -> CUChar -> CUChar -> IO () Source #

c'rlColor3f :: CFloat -> CFloat -> CFloat -> IO () Source #

c'rlColor4f :: CFloat -> CFloat -> CFloat -> CFloat -> IO () Source #

c'rlEnableVertexArray :: CUInt -> IO CBool Source #

c'rlEnableVertexBuffer :: CUInt -> IO () Source #

c'rlActiveTextureSlot :: CInt -> IO () Source #

c'rlEnableTexture :: CUInt -> IO () Source #

c'rlTextureParameters :: CUInt -> CInt -> CInt -> IO () Source #

c'rlCubemapParameters :: CUInt -> CInt -> CInt -> IO () Source #

c'rlEnableShader :: CUInt -> IO () Source #

c'rlEnableFramebuffer :: CUInt -> IO () Source #

c'rlActiveDrawBuffers :: CInt -> IO () Source #

c'rlBlitFramebuffer :: CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> IO () Source #

c'rlBindFramebuffer :: CUInt -> CUInt -> IO () Source #

c'rlColorMask :: CBool -> CBool -> CBool -> CBool -> IO () Source #

c'rlSetCullFace :: CInt -> IO () Source #

c'rlScissor :: CInt -> CInt -> CInt -> CInt -> IO () Source #

c'rlSetLineWidth :: CFloat -> IO () Source #

c'rlClearColor :: CUChar -> CUChar -> CUChar -> CUChar -> IO () Source #

c'rlSetBlendMode :: CInt -> IO () Source #

c'rlSetBlendFactors :: CInt -> CInt -> CInt -> IO () Source #

c'rlSetBlendFactorsSeparate :: CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> IO () Source #

c'rlglInit :: CInt -> CInt -> IO () Source #

c'rlLoadRenderBatch :: CInt -> CInt -> IO (Ptr RLRenderBatch) Source #

c'rlCheckRenderBatchLimit :: CInt -> IO CBool Source #

c'rlSetTexture :: CUInt -> IO () Source #

c'rlLoadVertexBuffer :: Ptr () -> CInt -> CBool -> IO CUInt Source #

c'rlLoadVertexBufferElement :: Ptr () -> CInt -> CBool -> IO CUInt Source #

c'rlUpdateVertexBuffer :: CUInt -> Ptr () -> CInt -> CInt -> IO () Source #

c'rlUpdateVertexBufferElements :: CUInt -> Ptr () -> CInt -> CInt -> IO () Source #

c'rlUnloadVertexArray :: CUInt -> IO () Source #

c'rlUnloadVertexBuffer :: CUInt -> IO () Source #

c'rlSetVertexAttribute :: CUInt -> CInt -> CInt -> CBool -> CInt -> CInt -> IO () Source #

c'rlSetVertexAttributeDivisor :: CUInt -> CInt -> IO () Source #

c'rlSetVertexAttributeDefault :: CInt -> Ptr () -> CInt -> CInt -> IO () Source #

c'rlDrawVertexArray :: CInt -> CInt -> IO () Source #

c'rlDrawVertexArrayElements :: CInt -> CInt -> Ptr () -> IO () Source #

c'rlDrawVertexArrayInstanced :: CInt -> CInt -> CInt -> IO () Source #

c'rlDrawVertexArrayElementsInstanced :: CInt -> CInt -> Ptr () -> CInt -> IO () Source #

c'rlLoadTexture :: Ptr () -> CInt -> CInt -> CInt -> CInt -> IO CUInt Source #

c'rlLoadTextureDepth :: CInt -> CInt -> CBool -> IO CUInt Source #

c'rlLoadTextureCubemap :: Ptr () -> CInt -> CInt -> IO CUInt Source #

c'rlUpdateTexture :: CUInt -> CInt -> CInt -> CInt -> CInt -> CInt -> Ptr () -> IO () Source #

c'rlGetGlTextureFormats :: CInt -> Ptr CUInt -> Ptr CUInt -> Ptr CUInt -> IO () Source #

c'rlGetPixelFormatName :: CUInt -> IO CString Source #

c'rlUnloadTexture :: CUInt -> IO () Source #

c'rlGenTextureMipmaps :: CUInt -> CInt -> CInt -> CInt -> Ptr CInt -> IO () Source #

c'rlReadTexturePixels :: CUInt -> CInt -> CInt -> CInt -> IO (Ptr ()) Source #

c'rlReadScreenPixels :: CInt -> CInt -> IO (Ptr CUChar) Source #

c'rlFramebufferAttach :: CUInt -> CUInt -> CInt -> CInt -> CInt -> IO () Source #

c'rlFramebufferComplete :: CUInt -> IO CBool Source #

c'rlUnloadFramebuffer :: CUInt -> IO () Source #

c'rlLoadShaderCode :: CString -> CString -> IO CUInt Source #

c'rlCompileShader :: CString -> CInt -> IO CUInt Source #

c'rlLoadShaderProgram :: CUInt -> CUInt -> IO CUInt Source #

c'rlUnloadShaderProgram :: CUInt -> IO () Source #

c'rlGetLocationUniform :: CUInt -> CString -> IO CInt Source #

c'rlGetLocationAttrib :: CUInt -> CString -> IO CInt Source #

c'rlSetUniform :: CInt -> Ptr () -> CInt -> CInt -> IO () Source #

c'rlSetUniformMatrix :: CInt -> Ptr Matrix -> IO () Source #

c'rlSetUniformMatrices :: CInt -> Ptr Matrix -> CInt -> IO () Source #

c'rlSetUniformSampler :: CInt -> CUInt -> IO () Source #

c'rlSetShader :: CUInt -> Ptr CInt -> IO () Source #

c'rlComputeShaderDispatch :: CUInt -> CUInt -> CUInt -> IO () Source #

c'rlLoadShaderBuffer :: CUInt -> Ptr () -> CInt -> IO CUInt Source #

c'rlUnloadShaderBuffer :: CUInt -> IO () Source #

c'rlUpdateShaderBuffer :: CUInt -> Ptr () -> CUInt -> CUInt -> IO () Source #

c'rlBindShaderBuffer :: CUInt -> CUInt -> IO () Source #

c'rlReadShaderBuffer :: CUInt -> Ptr () -> CUInt -> CUInt -> IO () Source #

c'rlCopyShaderBuffer :: CUInt -> CUInt -> CUInt -> CUInt -> CUInt -> IO () Source #

c'rlGetShaderBufferSize :: CUInt -> IO CUInt Source #

c'rlBindImageTexture :: CUInt -> CUInt -> CInt -> CBool -> IO () Source #

c'rlGetPixelDataSize :: CInt -> CInt -> CInt -> IO CInt Source #

c'rlEnd :: IO () Source #