Low level array of Float

Introduced properties

fun [](index: Int): Float

glesv2 :: GLfloatArray :: []

fun []=(index: Int, val: Float)

glesv2 :: GLfloatArray :: []=

fun add(value: Float)

glesv2 :: GLfloatArray :: add

Require: add_index < length
protected fun add_index=(add_index: Int)

glesv2 :: GLfloatArray :: add_index=

fun fill_from(array: Array[Float], dst_offset: nullable Int)

glesv2 :: GLfloatArray :: fill_from

Fill with the content of array
init from(array: Array[Float]): GLfloatArray

glesv2 :: GLfloatArray :: from

Create with the content of array
protected fun length=(length: Int)

glesv2 :: GLfloatArray :: length=

protected fun native_array=(native_array: NativeGLfloatArray)

glesv2 :: GLfloatArray :: native_array=

Redefined properties

redef type SELF: GLfloatArray

glesv2 $ GLfloatArray :: SELF

Type of this instance, automatically specialized in every class
redef fun finalize_once

glesv2 $ GLfloatArray :: finalize_once

Real finalization method of FinalizableOnce, will be called only once

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun [](index: Int): Float

glesv2 :: GLfloatArray :: []

fun []=(index: Int, val: Float)

glesv2 :: GLfloatArray :: []=

fun add(value: Float)

glesv2 :: GLfloatArray :: add

Require: add_index < length
protected fun add_index=(add_index: Int)

glesv2 :: GLfloatArray :: add_index=

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
fun fill_from(array: Array[Float], dst_offset: nullable Int)

glesv2 :: GLfloatArray :: fill_from

Fill with the content of array
fun finalize

core :: Finalizable :: finalize

Liberate any resources held by self before the memory holding self is freed
protected fun finalize_once

core :: FinalizableOnce :: finalize_once

Real finalization method of FinalizableOnce, will be called only once
fun finalized: Bool

core :: FinalizableOnce :: finalized

Has self been finalized? (either by the GC or an explicit call to finalize)
protected fun finalized=(finalized: Bool)

core :: FinalizableOnce :: finalized=

Has self been finalized? (either by the GC or an explicit call to finalize)
init from(array: Array[Float]): GLfloatArray

glesv2 :: GLfloatArray :: from

Create with the content of array
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
protected fun length=(length: Int)

glesv2 :: GLfloatArray :: length=

protected fun native_array=(native_array: NativeGLfloatArray)

glesv2 :: GLfloatArray :: native_array=

intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram glesv2::GLfloatArray GLfloatArray core::FinalizableOnce FinalizableOnce glesv2::GLfloatArray->core::FinalizableOnce core::Finalizable Finalizable core::FinalizableOnce->core::Finalizable ...core::Finalizable ... ...core::Finalizable->core::Finalizable

Ancestors

class Finalizable

core :: Finalizable

An object needing finalization
interface Object

core :: Object

The root of the class hierarchy.

Parents

class FinalizableOnce

core :: FinalizableOnce

An object to be finalized only once

Class definitions

glesv2 $ GLfloatArray
# Low level array of `Float`
class GLfloatArray
	super FinalizableOnce

	var length: Int

	var native_array = new NativeGLfloatArray(length) is lateinit

	fun [](index: Int): Float do return native_array[index]

	fun []=(index: Int, val: Float) do native_array[index] = val

	var add_index = 0

	fun reset_add do add_index = 0

	# Require: `add_index < length`
	fun add(value: Float)
	do
		var index = add_index
		assert index < length
		native_array[index] = value
		self.add_index = index + 1
	end

	# Create with the content of `array`
	new from(array: Array[Float])
	do
		var arr = new GLfloatArray(array.length)
		arr.fill_from array
		return arr
	end

	# Fill with the content of `array`
	#
	# If `dst_offset` is set, the data is copied to the index `dst_offset`,
	# otherwise, it is copied the beginning of `self`.
	#
	# Require: `length >= array.length + dst_offset or else 0`
	fun fill_from(array: Array[Float], dst_offset: nullable Int)
	do
		dst_offset = dst_offset or else add_index

		assert length >= array.length + dst_offset
		for k in [0..array.length[ do
			self[dst_offset+k] = array[k]
		end
	end

	redef fun finalize_once do native_array.free
end
lib/glesv2/glesv2.nit:439,1--489,3

gamnit :: flat_core $ GLfloatArray
redef class GLfloatArray
	private fun fill_from_matrix(matrix: Matrix, dst_offset: nullable Int)
	do
		dst_offset = dst_offset or else add_index
		var mat_len = matrix.width*matrix.height
		assert length >= mat_len + dst_offset
		native_array.fill_from_matrix_native(matrix.items, dst_offset, mat_len)
		add_index += mat_len
	end
end
lib/gamnit/flat/flat_core.nit:1732,1--1741,3