module Graphics.Gloss.Internals.Render.State
( State (..)
, stateInit
, Texture (..))
where
import qualified Graphics.Rendering.OpenGL.GL as GL
import Foreign.ForeignPtr
import System.Mem.StableName
import Data.Word
import Data.IORef
import Graphics.Gloss.Data.Picture
data State
= State
{
stateColor :: !Bool
, stateWireframe :: !Bool
, stateBlendAlpha :: !Bool
, stateLineSmooth :: !Bool
, stateTextures :: !(IORef [Texture])
}
data Texture
= Texture
{
texName :: StableName BitmapData
, texWidth :: Int
, texHeight :: Int
, texData :: ForeignPtr Word8
, texObject :: GL.TextureObject
, texCacheMe :: Bool }
stateInit :: IO State
stateInit
= do textures <- newIORef []
return State
{ stateColor = True
, stateWireframe = False
, stateBlendAlpha = True
, stateLineSmooth = False
, stateTextures = textures }