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

Raylib.Internal

Description

Internal h-raylib utilities for automatic memory management

Synopsis

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

class Closeable a where Source #

Typeclass to conveniently release resources

Methods

close :: a -> IO () Source #

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

Instances details
Closeable AutomationEventListRef Source # 
Instance details

Defined in Raylib.Types.Core

Closeable AudioStream Source # 
Instance details

Defined in Raylib.Types.Core.Audio

Closeable Music Source # 
Instance details

Defined in Raylib.Types.Core.Audio

Closeable Sound Source # 
Instance details

Defined in Raylib.Types.Core.Audio

Closeable Material Source # 
Instance details

Defined in Raylib.Types.Core.Models

Closeable Mesh Source # 
Instance details

Defined in Raylib.Types.Core.Models

Closeable Model Source # 
Instance details

Defined in Raylib.Types.Core.Models

Closeable Shader Source # 
Instance details

Defined in Raylib.Types.Core.Models

Closeable Font Source # 
Instance details

Defined in Raylib.Types.Core.Text

Closeable RenderTexture Source # 
Instance details

Defined in Raylib.Types.Core.Textures

Closeable Texture Source # 
Instance details

Defined in Raylib.Types.Core.Textures

Closeable (FunPtr a) Source # 
Instance details

Defined in Raylib.Internal

Methods

close :: FunPtr a -> IO () Source #

addToWindowResources :: WindowResources -> FunPtr a -> IO () Source #

Closeable a => Closeable [a] Source # 
Instance details

Defined in Raylib.Internal

Methods

close :: [a] -> IO () Source #

addToWindowResources :: WindowResources -> [a] -> IO () Source #

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 #

unloadSingleFunPtr :: FunPtr () -> WindowResources -> IO () Source #

Unloading all resources

Adding resources

addShaderId :: Integral a => a -> WindowResources -> IO () Source #

addTextureId :: Integral a => a -> WindowResources -> IO () Source #

addFrameBuffer :: Integral a => a -> WindowResources -> IO () Source #

addVaoId :: Integral a => a -> WindowResources -> IO () Source #

addVboIds :: Integral a => Maybe [a] -> WindowResources -> IO () Source #

addCtxData :: Integral a => a -> Ptr () -> WindowResources -> IO () Source #

addFunPtr :: FunPtr () -> 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'unloadMusicStreamData :: CInt -> Ptr () -> IO () Source #

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

Miscellaneous