Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Raylib.Internal
Description
Internal h-raylib utilities for automatic memory management
Synopsis
- data WindowResources = WindowResources {
- shaderIds :: IORef [CUInt]
- shaderLocations :: IORef (Map Integer (Map String Int))
- textureIds :: IORef [CUInt]
- frameBuffers :: IORef [CUInt]
- vaoIds :: IORef [CUInt]
- vboIds :: IORef [CUInt]
- ctxDataPtrs :: IORef [(CInt, Ptr ())]
- audioBuffers :: IORef [Ptr ()]
- audioBufferAliases :: IORef [Ptr ()]
- automationEventLists :: IORef [Ptr ()]
- funPtrs :: IORef [FunPtr ()]
- defaultWindowResources :: IO WindowResources
- releaseNonAudioWindowResources :: WindowResources -> IO ()
- releaseAudioWindowResources :: WindowResources -> IO ()
- releaseAllWindowResources :: WindowResources -> IO ()
- class Closeable a where
- close :: a -> IO ()
- addToWindowResources :: WindowResources -> a -> IO ()
- managed :: Closeable a => WindowResources -> IO a -> IO a
- unloadSingleShader :: Integral a => a -> WindowResources -> IO ()
- unloadSingleTexture :: Integral a => a -> WindowResources -> IO ()
- unloadSingleFrameBuffer :: Integral a => a -> WindowResources -> IO ()
- unloadSingleVaoId :: Integral a => a -> WindowResources -> IO ()
- unloadSingleVboIdList :: Integral a => Maybe [a] -> WindowResources -> IO ()
- unloadSingleCtxDataPtr :: Integral a => a -> Ptr () -> WindowResources -> IO ()
- unloadSingleAudioBuffer :: Ptr () -> WindowResources -> IO ()
- unloadSingleAudioBufferAlias :: Ptr () -> WindowResources -> IO ()
- unloadSingleAutomationEventList :: Ptr () -> WindowResources -> IO ()
- unloadSingleFunPtr :: FunPtr () -> WindowResources -> IO ()
- unloadShaders :: WindowResources -> IO ()
- unloadTextures :: WindowResources -> IO ()
- unloadFrameBuffers :: WindowResources -> IO ()
- unloadVaoIds :: WindowResources -> IO ()
- unloadVboIds :: WindowResources -> IO ()
- unloadCtxData :: WindowResources -> IO ()
- unloadAudioBuffers :: WindowResources -> IO ()
- unloadAudioBufferAliases :: WindowResources -> IO ()
- unloadAutomationEventLists :: WindowResources -> IO ()
- unloadFunPtrs :: WindowResources -> IO ()
- addShaderId :: Integral a => a -> WindowResources -> IO ()
- addTextureId :: Integral a => a -> WindowResources -> IO ()
- addFrameBuffer :: Integral a => a -> WindowResources -> IO ()
- addVaoId :: Integral a => a -> WindowResources -> IO ()
- addVboIds :: Integral a => Maybe [a] -> WindowResources -> IO ()
- addCtxData :: Integral a => a -> Ptr () -> WindowResources -> IO ()
- addAudioBuffer :: Ptr () -> WindowResources -> IO ()
- addAudioBufferAlias :: Ptr () -> WindowResources -> IO ()
- addAutomationEventList :: Ptr () -> WindowResources -> IO ()
- addFunPtr :: FunPtr () -> WindowResources -> IO ()
- c'rlUnloadShaderProgram :: CUInt -> IO ()
- c'rlUnloadTexture :: CUInt -> IO ()
- c'rlUnloadFramebuffer :: CUInt -> IO ()
- c'rlUnloadVertexArray :: CUInt -> IO ()
- c'rlUnloadVertexBuffer :: CUInt -> IO ()
- c'unloadMusicStreamData :: CInt -> Ptr () -> IO ()
- c'unloadAudioBuffer :: Ptr () -> IO ()
- c'unloadAudioBufferAlias :: Ptr () -> IO ()
- c'getPixelDataSize :: CInt -> CInt -> CInt -> IO CInt
- _unloadAutomationEventList :: Ptr () -> IO ()
- c'rlGetShaderIdDefault :: IO CUInt
- getPixelDataSize :: Int -> Int -> Int -> Int
Documentation
data WindowResources Source #
Tracks all raylib resources which cannot be immediately freed.
Each field is an IORef
to a list, and the list contains the data to be
tracked. Typically, data allocated on the GPU is stored here.
Constructors
WindowResources | |
Fields
|
releaseAudioWindowResources :: WindowResources -> IO () Source #
releaseAllWindowResources :: WindowResources -> IO () Source #
class Closeable a where Source #
Typeclass to conveniently release resources
Methods
Release a resource; this is only necessary when using an unmanaged resource
WARNING: Do not use this on a managed resource, doing so will cause it to be freed twice
addToWindowResources :: WindowResources -> a -> IO () Source #
Add an unmanaged resource to a WindowResources
handle to be freed later
Instances
managed :: Closeable a => WindowResources -> IO a -> IO a Source #
Use this when loading a resource for automatic memory management
Unloading individual resources
unloadSingleShader :: Integral a => a -> WindowResources -> IO () Source #
unloadSingleTexture :: Integral a => a -> WindowResources -> IO () Source #
unloadSingleFrameBuffer :: Integral a => a -> WindowResources -> IO () Source #
unloadSingleVaoId :: Integral a => a -> WindowResources -> IO () Source #
unloadSingleVboIdList :: Integral a => Maybe [a] -> WindowResources -> IO () Source #
unloadSingleCtxDataPtr :: Integral a => a -> Ptr () -> WindowResources -> IO () Source #
unloadSingleAudioBuffer :: Ptr () -> WindowResources -> IO () Source #
unloadSingleAudioBufferAlias :: Ptr () -> WindowResources -> IO () Source #
unloadSingleAutomationEventList :: Ptr () -> WindowResources -> IO () Source #
unloadSingleFunPtr :: FunPtr () -> WindowResources -> IO () Source #
Unloading all resources
unloadShaders :: WindowResources -> IO () Source #
unloadTextures :: WindowResources -> IO () Source #
unloadFrameBuffers :: WindowResources -> IO () Source #
unloadVaoIds :: WindowResources -> IO () Source #
unloadVboIds :: WindowResources -> IO () Source #
unloadCtxData :: WindowResources -> IO () Source #
unloadAudioBuffers :: WindowResources -> IO () Source #
unloadAudioBufferAliases :: WindowResources -> IO () Source #
unloadAutomationEventLists :: WindowResources -> IO () Source #
unloadFunPtrs :: WindowResources -> IO () Source #
Adding resources
addShaderId :: Integral a => a -> WindowResources -> IO () Source #
addTextureId :: Integral a => a -> WindowResources -> IO () Source #
addFrameBuffer :: Integral a => a -> WindowResources -> IO () Source #
addCtxData :: Integral a => a -> Ptr () -> WindowResources -> IO () Source #
addAudioBuffer :: Ptr () -> WindowResources -> IO () Source #
addAudioBufferAlias :: Ptr () -> WindowResources -> IO () Source #
addAutomationEventList :: Ptr () -> WindowResources -> IO () Source #
Native unload functions
c'rlUnloadShaderProgram :: CUInt -> IO () Source #
c'rlUnloadTexture :: CUInt -> IO () Source #
c'rlUnloadFramebuffer :: CUInt -> IO () Source #
c'rlUnloadVertexArray :: CUInt -> IO () Source #
c'rlUnloadVertexBuffer :: CUInt -> IO () Source #
c'unloadAudioBuffer :: Ptr () -> IO () Source #
c'unloadAudioBufferAlias :: Ptr () -> IO () Source #
_unloadAutomationEventList :: Ptr () -> IO () Source #