pituicat/src/Types/Texture.hs
2020-10-17 16:19:18 +02:00

23 lines
475 B
Haskell

module Types.Texture where
import SDL (($=), get)
import qualified Graphics.Rendering.OpenGL as GL
-- internal imports
import Classes.Graphics.Bindable
data Texture = Texture
{ textureId :: GL.TextureObject
, textureSlot :: GL.TextureUnit
}
deriving (Eq, Show)
instance Bindable Texture where
bind t = do
GL.activeTexture $= textureSlot t
GL.textureBinding GL.Texture2D $= Just (textureId t)
unbind t = GL.textureBinding GL.Texture2D $= Nothing