BufferWriter

expect abstract class BufferWriter(source)

Abstract class for writing data into a buffer. Provides methods for writing various types of data such as vectors, matrices, colors, and primitive types.

actual abstract class BufferWriter(source)
actual abstract class BufferWriter(source)

Constructors

Link copied to clipboard
constructor()
constructor()

Properties

Link copied to clipboard
expect abstract var position: Int
actual abstract var position: Int

Set the raw position of the underlying buffer, in 4-byte strides

actual abstract var position: Int

Set the raw position of the underlying buffer, in bytes

Link copied to clipboard
expect abstract var positionElements: Int
actual abstract var positionElements: Int

Set the position of the underlying buffer to accommodate the given number of elements according to the format size

actual abstract var positionElements: Int

Set the position of the underlying buffer to accommodate the given number of elements according to the format size

Functions

Link copied to clipboard
abstract fun copyBuffer(sourceBuffer: ByteBuffer, sourceOffset: Int, sourceSizeInBytes: Int)
Link copied to clipboard
expect abstract fun rewind()

rewind the underlying buffer

actual abstract fun rewind()

rewind the underlying buffer

actual abstract fun rewind()

rewind the underlying buffer

Link copied to clipboard
expect abstract fun write(vararg v: Vector3)

Writes one or more 3D vectors to the buffer.

expect abstract fun write(v: Byte)

Writes the provided byte value to the buffer.

expect abstract fun write(v: Float)

Writes the provided floating-point value to the buffer.

expect abstract fun write(v: Int)

Writes the provided integer value to the buffer.

expect abstract fun write(v: Short)

Writes the provided 16-bit short integer to the buffer.

expect abstract fun write(v: ColorRGBa)

Writes the provided color value to the buffer.

expect abstract fun write(v: IntVector2)

Writes the provided 2D integer vector to the buffer.

expect abstract fun write(v: IntVector3)

Writes the provided 3D integer vector to the buffer.

expect abstract fun write(v: IntVector4)

Writes the provided 4D integer vector to the buffer.

expect abstract fun write(v: Matrix33)

Writes a 3x3 matrix to the buffer.

expect abstract fun write(v: Matrix44)

Writes the provided 4x4 matrix to the buffer.

expect abstract fun write(v: Vector2)

Writes the provided 2D vector to the buffer.

expect abstract fun write(v: Vector3)

Writes the provided 3D vector to the buffer.

expect abstract fun write(v: Vector4)

Writes the provided 4D vector to the buffer.

expect abstract fun write(x: Float, y: Float)

Writes two floating-point values to the buffer.

expect abstract fun write(x: Float, y: Float, z: Float)

Writes three floating-point values to the buffer.

expect abstract fun write(a: FloatArray, offset: Int = 0, size: Int = a.size)

Writes the specified portion of the provided float array to the buffer starting at the given offset.

expect abstract fun write(x: Float, y: Float, z: Float, w: Float)

Writes four floating-point values to the buffer.

actual abstract fun write(vararg v: Vector3)
actual abstract fun write(v: Byte)
actual abstract fun write(v: Float)
actual abstract fun write(v: Int)
actual abstract fun write(v: Short)
actual abstract fun write(v: ColorRGBa)
actual abstract fun write(v: IntVector2)
actual abstract fun write(v: IntVector3)
actual abstract fun write(v: IntVector4)
actual abstract fun write(v: Matrix33)
actual abstract fun write(v: Matrix44)
actual abstract fun write(v: Vector2)
actual abstract fun write(v: Vector3)
actual abstract fun write(v: Vector4)
actual abstract fun write(x: Float, y: Float)
actual abstract fun write(x: Float, y: Float, z: Float)
actual abstract fun write(a: FloatArray, offset: Int, size: Int)
actual abstract fun write(x: Float, y: Float, z: Float, w: Float)
actual abstract fun write(vararg v: Vector3)
actual abstract fun write(v: Byte)
actual abstract fun write(v: Float)
actual abstract fun write(v: Int)
actual abstract fun write(v: Short)
actual abstract fun write(v: ColorRGBa)
actual abstract fun write(v: IntVector2)
actual abstract fun write(v: IntVector3)
actual abstract fun write(v: IntVector4)
actual abstract fun write(v: Matrix33)
actual abstract fun write(v: Matrix44)
actual abstract fun write(v: Vector2)
actual abstract fun write(v: Vector3)
actual abstract fun write(v: Vector4)
actual abstract fun write(x: Float, y: Float)
actual abstract fun write(x: Float, y: Float, z: Float)
actual abstract fun write(a: FloatArray, offset: Int, size: Int)
actual abstract fun write(x: Float, y: Float, z: Float, w: Float)
Link copied to clipboard
fun BufferWriter.write(drawStyle: DrawStyle)

Writes the specified DrawStyle properties to the buffer. This includes linearized fill color, linearized stroke color, and an adjusted stroke weight based on the presence and transparency of the stroke.