TextureVertexProtocol
public protocol TextureVertexProtocol
Used to specify vertex information when calling cogl_polygon()
The TextureVertexProtocol
protocol exposes the methods and properties of an underlying CoglTextureVertex
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see TextureVertex
.
Alternatively, use TextureVertexRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
CoglTextureVertex
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
_ptr
Default implementationTyped pointer to the underlying
CoglTextureVertex
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
CoglTextureVertex
instance.Declaration
Swift
var _ptr: UnsafeMutablePointer<CoglTextureVertex>! { get }
-
Required Initialiser for types conforming to
TextureVertexProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
polygon(nVertices:
Extension methoduseColor: ) Draws a convex polygon using the current source material to fill / texture with according to the texture coordinates passed.
If
use_color
istrue
then the color will be changed for each vertex using the value specified in the color member ofCoglTextureVertex
. This can be used for example to make the texture fade out by setting the alpha value of the color.All of the texture coordinates must be in the range [0,1] and repeating the texture is not supported.
Because of the way this function is implemented it will currently only work if either the texture is not sliced or the backend is not OpenGL ES and the minifying and magnifying functions are both set to COGL_MATERIAL_FILTER_NEAREST.
Declaration
Swift
@inlinable func polygon(nVertices: Int, useColor: CoglBool)
-
x
Extension methodModel x-coordinate
Declaration
Swift
@inlinable var x: CFloat { get set }
-
y
Extension methodModel y-coordinate
Declaration
Swift
@inlinable var y: CFloat { get set }
-
z
Extension methodModel z-coordinate
Declaration
Swift
@inlinable var z: CFloat { get set }
-
tx
Extension methodTexture x-coordinate
Declaration
Swift
@inlinable var tx: CFloat { get set }
-
ty
Extension methodTexture y-coordinate
Declaration
Swift
@inlinable var ty: CFloat { get set }
-
color
Extension methodThe color to use at this vertex. This is ignored if use_color is
false
when callingcogl_polygon()
Declaration
Swift
@inlinable var color: CoglColor { get set }