<!--
{
  "documentType" : "article",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/glkit-functions",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "GLKit Functions"
}
-->

# GLKit Functions

## Topics

### Functions

[`func GLKMatrixStackCreate(CFAllocator?) -> Unmanaged<GLKMatrixStack>?`](/documentation/GLKit/GLKMatrixStackCreate(_:))

Allocates and returns a new matrix stack.

[`func GLKMatrixStackGetMatrix2(GLKMatrixStack) -> GLKMatrix2`](/documentation/GLKit/GLKMatrixStackGetMatrix2(_:))

Returns the top-left `2x2` corner of the top matrix.

[`func GLKMatrixStackGetMatrix3(GLKMatrixStack) -> GLKMatrix3`](/documentation/GLKit/GLKMatrixStackGetMatrix3(_:))

Returns the top-left `3x3` corner of the top matrix.

[`func GLKMatrixStackGetMatrix3Inverse(GLKMatrixStack) -> GLKMatrix3`](/documentation/GLKit/GLKMatrixStackGetMatrix3Inverse(_:))

Fetches the top-left `3x3` corner of the top matrix and returns its inverse.

[`func GLKMatrixStackGetMatrix3InverseTranspose(GLKMatrixStack) -> GLKMatrix3`](/documentation/GLKit/GLKMatrixStackGetMatrix3InverseTranspose(_:))

Fetches the top-left `3x3` corner of the top matrix and returns its inverse transpose.

[`func GLKMatrixStackGetMatrix4(GLKMatrixStack) -> GLKMatrix4`](/documentation/GLKit/GLKMatrixStackGetMatrix4(_:))

Returns a copy of the top matrix on the stack.

[`func GLKMatrixStackGetMatrix4Inverse(GLKMatrixStack) -> GLKMatrix4`](/documentation/GLKit/GLKMatrixStackGetMatrix4Inverse(_:))

Returns the inverse of the top matrix.

[`func GLKMatrixStackGetMatrix4InverseTranspose(GLKMatrixStack) -> GLKMatrix4`](/documentation/GLKit/GLKMatrixStackGetMatrix4InverseTranspose(_:))

Returns the inverse transpose of the top matrix.

[`func GLKMatrixStackGetTypeID() -> CFTypeID`](/documentation/GLKit/GLKMatrixStackGetTypeID())

Returns the Core Foundation type for a matrix stack.

[`func GLKMatrixStackLoadMatrix4(GLKMatrixStack, GLKMatrix4)`](/documentation/GLKit/GLKMatrixStackLoadMatrix4(_:_:))

Replaces the contents of the top matrix with a new matrix.

[`func GLKMatrixStackMultiplyMatrix4(GLKMatrixStack, GLKMatrix4)`](/documentation/GLKit/GLKMatrixStackMultiplyMatrix4(_:_:))

Replaces the contents of the top matrix with a matrix calculated by multiplying the contents of the top matrix by another matrix.

[`func GLKMatrixStackMultiplyMatrixStack(GLKMatrixStack, GLKMatrixStack)`](/documentation/GLKit/GLKMatrixStackMultiplyMatrixStack(_:_:))

Replaces the contents of the top matrix with a matrix calculated by multiplying the contents of the top matrix by the top matrix of another matrix stack.

[`func GLKMatrixStackPop(GLKMatrixStack)`](/documentation/GLKit/GLKMatrixStackPop(_:))

Removes the topmost entry from the stack.

[`func GLKMatrixStackPush(GLKMatrixStack)`](/documentation/GLKit/GLKMatrixStackPush(_:))

Push a copy of the topmost matrix onto the top of the stack.

[`func GLKMatrixStackRotate(GLKMatrixStack, Float, Float, Float, Float)`](/documentation/GLKit/GLKMatrixStackRotate(_:_:_:_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

[`func GLKMatrixStackRotateWithVector3(GLKMatrixStack, Float, GLKVector3)`](/documentation/GLKit/GLKMatrixStackRotateWithVector3(_:_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

[`func GLKMatrixStackRotateWithVector4(GLKMatrixStack, Float, GLKVector4)`](/documentation/GLKit/GLKMatrixStackRotateWithVector4(_:_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around an arbitrary axis.

[`func GLKMatrixStackRotateX(GLKMatrixStack, Float)`](/documentation/GLKit/GLKMatrixStackRotateX(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-x axis.

[`func GLKMatrixStackRotateY(GLKMatrixStack, Float)`](/documentation/GLKit/GLKMatrixStackRotateY(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-y axis.

[`func GLKMatrixStackRotateZ(GLKMatrixStack, Float)`](/documentation/GLKit/GLKMatrixStackRotateZ(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a rotation around the positive-z axis.

[`func GLKMatrixStackScale(GLKMatrixStack, Float, Float, Float)`](/documentation/GLKit/GLKMatrixStackScale(_:_:_:_:))

Replaces the contents of the top matrix with a matrix calculated by scaling the contents of the top matrix.

[`func GLKMatrixStackScaleWithVector3(GLKMatrixStack, GLKVector3)`](/documentation/GLKit/GLKMatrixStackScaleWithVector3(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a scaling operation.

[`func GLKMatrixStackScaleWithVector4(GLKMatrixStack, GLKVector4)`](/documentation/GLKit/GLKMatrixStackScaleWithVector4(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a scaling operation defined by a vector.

[`func GLKMatrixStackSize(GLKMatrixStack) -> Int32`](/documentation/GLKit/GLKMatrixStackSize(_:))

Returns the number of matrices present on the matrix stack.

[`func GLKMatrixStackTranslate(GLKMatrixStack, Float, Float, Float)`](/documentation/GLKit/GLKMatrixStackTranslate(_:_:_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation operation.

[`func GLKMatrixStackTranslateWithVector3(GLKMatrixStack, GLKVector3)`](/documentation/GLKit/GLKMatrixStackTranslateWithVector3(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation defined by a vector.

[`func GLKMatrixStackTranslateWithVector4(GLKMatrixStack, GLKVector4)`](/documentation/GLKit/GLKMatrixStackTranslateWithVector4(_:_:))

Replaces the contents of the top matrix with a matrix calculated by composing the top matrix with a translation defined by a vector.

[`func GLKVertexAttributeParametersFromModelIO(MDLVertexFormat) -> GLKVertexAttributeParameters`](/documentation/GLKit/GLKVertexAttributeParametersFromModelIO(_:))



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)