Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simplified 2D graphics system.
- type Object2D = Object Uniforms2D Geometry2D
- type IsObject2D gs is = (Subset Geometry2D is, Subset (View2 ': Uniforms2D) gs, ShaderVars is, ShaderVars gs)
- rect :: GLES => Texture -> Object2D
- image :: GLES => Texture -> Object2D
- sprite :: GLES => Texture -> Object2D
- depth :: (MemberGlobal Depth gs, GLES) => Float -> Object gs is -> Object gs is
- poly :: GLES => Texture -> Geometry (i ': is) -> Object Uniforms2D (i ': is)
- trans :: (MemberGlobal Transform2 gs, GLES) => Vec2 -> Object gs is -> Object gs is
- rot :: (MemberGlobal Transform2 gs, GLES) => Float -> Object gs is -> Object gs is
- scale :: (MemberGlobal Transform2 gs, GLES) => Float -> Object gs is -> Object gs is
- scaleV :: (MemberGlobal Transform2 gs, GLES) => Vec2 -> Object gs is -> Object gs is
- scaleTex :: (MemberGlobal Transform2 gs, GLES) => Texture -> Object gs is -> Object gs is
- scaleTexAR :: (MemberGlobal Transform2 gs, GLES) => Texture -> Object gs is -> Object gs is
- transform :: (MemberGlobal Transform2 gs, GLES) => Mat3 -> Object gs is -> Object gs is
- view :: (ShaderVars gs, ShaderVars is, GLES) => Mat3 -> [Object gs is] -> Object (View2 ': gs) is
- viewScreen :: (ShaderVars gs, ShaderVars is, GLES) => Mat3 -> [Object gs is] -> Object (View2 ': gs) is
- viewVP :: (ShaderVars gs, ShaderVars is, GLES) => (Vec2 -> Mat3) -> [Object gs is] -> Object (View2 ': gs) is
- layerS :: IsObject2D gs is => Object gs is -> Layer' s t ()
- transMat3 :: Vec2 -> Mat3
- rotMat3 :: Float -> Mat3
- scaleMat3 :: Vec2 -> Mat3
- screenMat3 :: Vec2 -> Mat3
- type Uniforms2D = '[Image, Depth, Transform2]
- data Image = Image GSampler2D
- data Depth = Depth GFloat
- data Transform2 = Transform2 GMat3
- data View2 = View2 GMat3
2D Objects
type Object2D = Object Uniforms2D Geometry2D Source #
A simple 2D Object, without the View2
matrix.
type IsObject2D gs is = (Subset Geometry2D is, Subset (View2 ': Uniforms2D) gs, ShaderVars is, ShaderVars gs) Source #
2D objects compatible with the standard 2D shader program.
image :: GLES => Texture -> Object2D Source #
A rectangle with the aspect ratio adapted to its texture.
sprite :: GLES => Texture -> Object2D Source #
A rectangle with the size and aspect ratio adapted to the screen, assuming
that you're using viewScreen
or screenMat3
.
depth :: (MemberGlobal Depth gs, GLES) => Float -> Object gs is -> Object gs is Source #
Set the depth of a 2D Object
.
poly :: GLES => Texture -> Geometry (i ': is) -> Object Uniforms2D (i ': is) Source #
A 2D object with a specified Geometry
.
Transformations
trans :: (MemberGlobal Transform2 gs, GLES) => Vec2 -> Object gs is -> Object gs is Source #
Translate a 2D Object
.
rot :: (MemberGlobal Transform2 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Rotate a 2D Object
.
scale :: (MemberGlobal Transform2 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Scale a 2D Object
.
scaleV :: (MemberGlobal Transform2 gs, GLES) => Vec2 -> Object gs is -> Object gs is Source #
Scale a 2D Object
in two dimensions.
scaleTex :: (MemberGlobal Transform2 gs, GLES) => Texture -> Object gs is -> Object gs is Source #
Scale an Object
so that it has the same size as the Texture
, assuming
viewScreen
or screenMat3
.
scaleTexAR :: (MemberGlobal Transform2 gs, GLES) => Texture -> Object gs is -> Object gs is Source #
transform :: (MemberGlobal Transform2 gs, GLES) => Mat3 -> Object gs is -> Object gs is Source #
Transform a 2D Object
.
Layers
view :: (ShaderVars gs, ShaderVars is, GLES) => Mat3 -> [Object gs is] -> Object (View2 ': gs) is Source #
Create a group of objects with a view matrix.
viewScreen :: (ShaderVars gs, ShaderVars is, GLES) => Mat3 -> [Object gs is] -> Object (View2 ': gs) is Source #
Create a group of objects with a view matrix and screenMat3
.
viewVP :: (ShaderVars gs, ShaderVars is, GLES) => (Vec2 -> Mat3) -> [Object gs is] -> Object (View2 ': gs) is Source #
Create a group of objects with a view matrix, depending on the size of the framebuffer.
layerS :: IsObject2D gs is => Object gs is -> Layer' s t () Source #
A Layer
with the standard 2D program.
Transformation matrices
Uniforms
type Uniforms2D = '[Image, Depth, Transform2] Source #
An uniform that represents the texture used in the default 2D shader.
An uniform that represents the depth used in the default 2D shader.
data Transform2 Source #
An uniform that represents the transformation matrix used in the default 2D shader.
Generic Transform2 Source # | |
type Rep Transform2 Source # | |