<commit_before>module SFML.Graphics.Types
where


import Foreign.Ptr (Ptr)


newtype CircleShape = CircleShape (Ptr CircleShape)
newtype ConvexShape = ConvexShape (Ptr ConvexShape)
newtype Font = Font (Ptr Font)
newtype Image = Image (Ptr Image)
newtype Shader = Shader (Ptr Shader)
newtype RectangleShape = RectangleShape (Ptr RectangleShape)
newtype RenderTexture = RenderTexture (Ptr RenderTexture)
newtype RenderWindow = RenderWindow (Ptr RenderWindow)
newtype Shape = Shape (Ptr Shape)
newtype Sprite = Sprite (Ptr Sprite)
newtype Text = Text (Ptr Text)
newtype Texture = Texture (Ptr Texture)
newtype Transformable = Transformable (Ptr Transformable)
newtype VertexArray = VertexArray (Ptr VertexArray)
newtype View = View (Ptr View)
<commit_msg>Added Storable instances for Texture and Shader<commit_after>module SFML.Graphics.Types
where


import Foreign.C.Types (CInt)
import Foreign.Ptr
import Foreign.Storable


newtype CircleShape = CircleShape (Ptr CircleShape)
newtype ConvexShape = ConvexShape (Ptr ConvexShape)
newtype Font = Font (Ptr Font)
newtype Image = Image (Ptr Image)
newtype Shader = Shader (Ptr Shader)
newtype RectangleShape = RectangleShape (Ptr RectangleShape)
newtype RenderTexture = RenderTexture (Ptr RenderTexture)
newtype RenderWindow = RenderWindow (Ptr RenderWindow)
newtype Shape = Shape (Ptr Shape)
newtype Sprite = Sprite (Ptr Sprite)
newtype Text = Text (Ptr Text)
newtype Texture = Texture (Ptr Texture)
newtype Transformable = Transformable (Ptr Transformable)
newtype VertexArray = VertexArray (Ptr VertexArray)
newtype View = View (Ptr View)


instance Storable Texture where
    sizeOf _ = sizeOf (undefined :: CInt)
    alignment _ = alignment (undefined :: CInt)
    
    peek ptr = peek (castPtr ptr) >>= return . Texture
    poke ptr (Texture p) = poke (castPtr ptr) p


instance Storable Shader where
    sizeOf _ = sizeOf (undefined :: CInt)
    alignment _ = alignment (undefined :: CInt)
    
    peek ptr = peek (castPtr ptr) >>= return . Shader
    poke ptr (Shader p) = poke (castPtr ptr) p

{'fraction_non_alphanumeric': 0.07474352711284807, 'fraction_numerical': 0.0, 'mean_word_length': 4.988304093567251, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5592841', 'n_tokens_mistral': 628, 'n_tokens_neox': 613, 'n_words': 226}