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