Skip to content

Instantly share code, notes, and snippets.

View akrmn's full-sized avatar

Moisés Ackerman akrmn

  • Zürich, Switzerland
View GitHub Profile
@akrmn
akrmn / Buffered.hs
Last active February 28, 2021 08:44
module Buffered (main) where
import Data.Word (Word8)
import Foreign.ForeignPtr (ForeignPtr, withForeignPtr)
import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
import Graphics.GL (glDrawBuffer, glReadBuffer, glReadPixels, pattern GL_BACK, pattern GL_RGBA, pattern GL_UNSIGNED_BYTE)
import Graphics.Gloss.Interface.IO.Simulate (simulateIO)
import qualified Graphics.Gloss.Rendering as Gloss
import Prelude hiding (display)
import Codec.Picture (PixelRGBA8, Pixel (componentCount))
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE PostfixOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE NoStarIsType #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Main
( main