h-raylib-5.5.2.1: Raylib bindings for Haskell
Safe HaskellSafe-Inferred
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.

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

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

Unloading all resources

Adding resources

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

Native unload functions

Miscellaneous