Documentation ¶
Index ¶
- Constants
- func CompileShader(src []byte) (*shaderir.Program, error)
- func InternalImageSize(x int) int
- func LockAndResetVertices(f func() error) error
- func QuadIndices() []uint16
- func QuadVertices(sx0, sy0, sx1, sy1 float32, a, b, c, d, tx, ty float32, cr, cg, cb, ca float32) []float32
- func Vertices(n int) []float32
Constants ¶
View Source
const ( ShaderImageCount = 4 // PreservedUniformVariablesCount represents the number of preserved uniform variables. // Any shaders in Ebitengine must have these uniform variables. PreservedUniformVariablesCount = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 // the projection matrix TextureDestinationSizeUniformVariableIndex = 0 TextureSourceSizesUniformVariableIndex = 1 TextureDestinationRegionOriginUniformVariableIndex = 2 TextureDestinationRegionSizeUniformVariableIndex = 3 TextureSourceOffsetsUniformVariableIndex = 4 TextureSourceRegionOriginUniformVariableIndex = 5 TextureSourceRegionSizeUniformVariableIndex = 6 ProjectionMatrixUniformVariableIndex = 7 )
View Source
const ( IndicesCount = (1 << 16) / 3 * 3 // Adjust num for triangles. VertexFloatCount = 8 )
Variables ¶
This section is empty.
Functions ¶
func InternalImageSize ¶
InternalImageSize returns a nearest appropriate size as an internal image.
func LockAndResetVertices ¶ added in v2.2.0
func QuadIndices ¶
func QuadIndices() []uint16
func QuadVertices ¶
func QuadVertices(sx0, sy0, sx1, sy1 float32, a, b, c, d, tx, ty float32, cr, cg, cb, ca float32) []float32
QuadVertices returns a float32 slice for a quadrangle. QuadVertices returns a slice that never overlaps with other slices returned this function, and users can do optimization based on this fact.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.