module Graphics.LambdaCube.Texture where import Graphics.LambdaCube.Types import Graphics.LambdaCube.PixelFormat import Graphics.LambdaCube.HardwareBuffer -- | Enum identifying the texture usage data TextureUsage = TextureUsage { tuUsage :: Usage , tuAutoMipmap :: Bool -- ^ mipmaps will be automatically generated for this texture , tuRenderTarget :: Bool -- ^ this texture will be a render target, i.e. used as a target for render to texture -- setting this flag will ignore all other texture usages except TU_AUTOMIPMAP } deriving Eq {- enum TextureUsage { /// @copydoc HardwareBuffer::Usage TU_STATIC = HardwareBuffer::HBU_STATIC, TU_DYNAMIC = HardwareBuffer::HBU_DYNAMIC, TU_WRITE_ONLY = HardwareBuffer::HBU_WRITE_ONLY, TU_STATIC_WRITE_ONLY = HardwareBuffer::HBU_STATIC_WRITE_ONLY, TU_DYNAMIC_WRITE_ONLY = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, TU_DYNAMIC_WRITE_ONLY_DISCARDABLE = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, /// mipmaps will be automatically generated for this texture TU_AUTOMIPMAP = 0x100, /// this texture will be a render target, i.e. used as a target for render to texture /// setting this flag will ignore all other texture usages except TU_AUTOMIPMAP TU_RENDERTARGET = 0x200, /// default to automatic mipmap generation static textures TU_DEFAULT = TU_AUTOMIPMAP | TU_STATIC_WRITE_ONLY }; -} -- | Enum identifying the texture type data TextureType = TEX_TYPE_1D -- ^ 1D texture, used in combination with 1D texture coordinates | TEX_TYPE_2D -- ^ 2D texture, used in combination with 2D texture coordinates (default) | TEX_TYPE_3D -- ^ 3D volume texture, used in combination with 3D texture coordinates | TEX_TYPE_CUBE_MAP -- ^ 3D cube map, used in combination with 3D texture coordinates deriving (Eq,Show) -- | Enum identifying special mipmap numbers data TextureMipmap = MIP_UNLIMITED -- ^ Generate mipmaps up to 1x1 | MIP_DEFAULT -- ^ Use TextureManager default | MIP_NUMBER Int deriving Eq class (Eq a, HardwareBuffer a) => Texture a where txName :: a -> String txWidth :: a -> Int txHeight :: a -> Int txDepth :: a -> Int txNumRequestedMipmaps :: a -> TextureMipmap txNumMipmaps :: a -> Int txMipmapsHardwareGenerated :: a -> Bool txGamma :: a -> FloatType txHwGamma :: a -> Bool txFSAA :: a -> Int txFSAAHint :: a -> String txTextureType :: a -> TextureType txFormat :: a -> PixelFormat --txUsage :: a -> TextureUsage txAutoMipmap :: a -> Bool -- ^ mipmaps will be automatically generated for this texture txRenderTarget :: a -> Bool -- ^ this texture will be a render target, i.e. used as a target for render to texture -- setting this flag will ignore all other texture usages except TU_AUTOMIPMAP txSrcFormat :: a -> PixelFormat txSrcWidth :: a -> Int txSrcHeight :: a -> Int txSrcDepth :: a -> Int txDesiredFormat :: a -> PixelFormat txDesiredIntegerBitDepth :: a -> Int txDesiredFloatBitDepth :: a -> Int txTreatLuminanceAsAlpha :: a -> Bool