OpenGL ES program to which we attach shaders

Introduced properties

fun active_attrib_name(index: Int): String

glesv2 :: GLProgram :: active_attrib_name

Name of the active attribute at index
fun active_attrib_size(index: Int): Int

glesv2 :: GLProgram :: active_attrib_size

Size of the active attribute at index
fun active_attrib_type(index: Int): GLDataType

glesv2 :: GLProgram :: active_attrib_type

Type of the active attribute at index
fun active_attribute_max_length: Int

glesv2 :: GLProgram :: active_attribute_max_length

Length of the longest attribute name in this program, including the null byte
fun active_uniform_max_length: Int

glesv2 :: GLProgram :: active_uniform_max_length

Length of the longest uniform name in this program, including the null byte
fun active_uniform_name(index: Int): String

glesv2 :: GLProgram :: active_uniform_name

Name of the active uniform at index
fun active_uniform_size(index: Int): Int

glesv2 :: GLProgram :: active_uniform_size

Size of the active uniform at index
fun active_uniform_type(index: Int): GLDataType

glesv2 :: GLProgram :: active_uniform_type

Type of the active uniform at index
fun attrib_location(name: String): Int

glesv2 :: GLProgram :: attrib_location

Get the location of the attribute by name
fun bind_attrib_location(index: Int, name: String)

glesv2 :: GLProgram :: bind_attrib_location

Set the location for the attribute by name
fun is_deleted: Bool

glesv2 :: GLProgram :: is_deleted

Has this program been deleted?
fun is_linked: Bool

glesv2 :: GLProgram :: is_linked

Is this program linked?
fun is_validated: Bool

glesv2 :: GLProgram :: is_validated

Boolean result of validate, must be called after validate
fun n_active_attributes: Int

glesv2 :: GLProgram :: n_active_attributes

Number of active attributes in this program
fun n_active_uniforms: Int

glesv2 :: GLProgram :: n_active_uniforms

Number of active uniform in this program
fun n_attached_shaders: Int

glesv2 :: GLProgram :: n_attached_shaders

Number of shaders attached to this program
init new: GLProgram

glesv2 :: GLProgram :: new

Create a new program
fun uniform_location(name: String): Int

glesv2 :: GLProgram :: uniform_location

Get the location of the uniform by name

Redefined properties

redef type SELF: GLProgram

glesv2 $ GLProgram :: SELF

Type of this instance, automatically specialized in every class

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 active_attrib_name(index: Int): String

glesv2 :: GLProgram :: active_attrib_name

Name of the active attribute at index
fun active_attrib_size(index: Int): Int

glesv2 :: GLProgram :: active_attrib_size

Size of the active attribute at index
fun active_attrib_type(index: Int): GLDataType

glesv2 :: GLProgram :: active_attrib_type

Type of the active attribute at index
fun active_attribute_max_length: Int

glesv2 :: GLProgram :: active_attribute_max_length

Length of the longest attribute name in this program, including the null byte
fun active_uniform_max_length: Int

glesv2 :: GLProgram :: active_uniform_max_length

Length of the longest uniform name in this program, including the null byte
fun active_uniform_name(index: Int): String

glesv2 :: GLProgram :: active_uniform_name

Name of the active uniform at index
fun active_uniform_size(index: Int): Int

glesv2 :: GLProgram :: active_uniform_size

Size of the active uniform at index
fun active_uniform_type(index: Int): GLDataType

glesv2 :: GLProgram :: active_uniform_type

Type of the active uniform at index
fun address_is_null: Bool

core :: Pointer :: address_is_null

Is the address behind this Object at NULL?
fun attrib_location(name: String): Int

glesv2 :: GLProgram :: attrib_location

Get the location of the attribute by name
fun bind_attrib_location(index: Int, name: String)

glesv2 :: GLProgram :: bind_attrib_location

Set the location for the attribute by name
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 free

core :: Pointer :: free

Free the memory pointed by this pointer
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".
fun is_deleted: Bool

glesv2 :: GLProgram :: is_deleted

Has this program been deleted?
fun is_linked: Bool

glesv2 :: GLProgram :: is_linked

Is this program linked?
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.
fun is_validated: Bool

glesv2 :: GLProgram :: is_validated

Boolean result of validate, must be called after validate
fun n_active_attributes: Int

glesv2 :: GLProgram :: n_active_attributes

Number of active attributes in this program
fun n_active_uniforms: Int

glesv2 :: GLProgram :: n_active_uniforms

Number of active uniform in this program
fun n_attached_shaders: Int

glesv2 :: GLProgram :: n_attached_shaders

Number of shaders attached to this program
init new: GLProgram

glesv2 :: GLProgram :: new

Create a new program
init nul: Pointer

core :: Pointer :: nul

C NULL pointer
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.
fun uniform_location(name: String): Int

glesv2 :: GLProgram :: uniform_location

Get the location of the uniform by name
package_diagram glesv2::GLProgram GLProgram core::Pointer Pointer glesv2::GLProgram->core::Pointer core::Object Object core::Pointer->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

extern class Pointer

core :: Pointer

Pointer classes are used to manipulate extern C structures.

Class definitions

glesv2 $ GLProgram
# OpenGL ES program to which we attach shaders
extern class GLProgram `{GLuint`}
	# Create a new program
	#
	# The newly created instance should be checked using `is_ok`.
	new `{ return glCreateProgram(); `}

	# Set the location for the attribute by `name`
	fun bind_attrib_location(index: Int, name: String) import String.to_cstring `{
		GLchar *c_name = String_to_cstring(name);
		glBindAttribLocation(self, index, c_name);
	`}

	# Get the location of the attribute by `name`
	#
	# Returns `-1` if there is no active attribute named `name`.
	fun attrib_location(name: String): Int import String.to_cstring `{
		GLchar *c_name = String_to_cstring(name);
		return glGetAttribLocation(self, c_name);
	`}

	# Get the location of the uniform by `name`
	#
	# Returns `-1` if there is no active uniform named `name`.
	fun uniform_location(name: String): Int import String.to_cstring `{
		GLchar *c_name = String_to_cstring(name);
		return glGetUniformLocation(self, c_name);
	`}

	# Is this program linked?
	fun is_linked: Bool do return glGetProgramiv(self, gl_LINK_STATUS) != 0

	# Has this program been deleted?
	fun is_deleted: Bool do return glGetProgramiv(self, gl_DELETE_STATUS) != 0

	# Boolean result of `validate`, must be called after `validate`
	fun is_validated: Bool do return glGetProgramiv(self, gl_VALIDATE_STATUS) != 0

	# Number of active uniform in this program
	#
	# This should be the number of uniforms declared in all shader, except
	# unused uniforms which may have been optimized out.
	fun n_active_uniforms: Int do return glGetProgramiv(self, gl_ACTIVE_UNIFORMS)

	# Length of the longest uniform name in this program, including the null byte
	fun active_uniform_max_length: Int do return glGetProgramiv(self, gl_ACTIVE_UNIFORM_MAX_LENGTH)

	# Number of active attributes in this program
	#
	# This should be the number of uniforms declared in all shader, except
	# unused uniforms which may have been optimized out.
	fun n_active_attributes: Int do return glGetProgramiv(self, gl_ACTIVE_ATTRIBUTES)

	# Length of the longest attribute name in this program, including the null byte
	fun active_attribute_max_length: Int do return glGetProgramiv(self, gl_ACTIVE_ATTRIBUTE_MAX_LENGTH)

	# Number of shaders attached to this program
	fun n_attached_shaders: Int do return glGetProgramiv(self, gl_ATTACHED_SHADERS)

	# Name of the active attribute at `index`
	fun active_attrib_name(index: Int): String
	do
		var max_size = active_attribute_max_length
		var cname = new CString(max_size)
		active_attrib_name_native(index, max_size, cname)
		return cname.to_s
	end

	private fun active_attrib_name_native(index, max_size: Int, name: CString) `{
		// We get more values than we need, for compatibility. At least the
		// NVidia driver tries to fill them even if NULL.

		int size;
		GLenum type;
		glGetActiveAttrib(self, index, max_size, NULL, &size, &type, name);
	`}

	# Size of the active attribute at `index`
	fun active_attrib_size(index: Int): Int `{
		int size;
		GLenum type;
		glGetActiveAttrib(self, index, 0, NULL, &size, &type, NULL);
		return size;
	`}

	# Type of the active attribute at `index`
	#
	# May only be float related data types (single float, vectors and matrix).
	fun active_attrib_type(index: Int): GLDataType `{
		int size;
		GLenum type;
		glGetActiveAttrib(self, index, 0, NULL, &size, &type, NULL);
		return type;
	`}

	# Name of the active uniform at `index`
	fun active_uniform_name(index: Int): String
	do
		var max_size = active_uniform_max_length
		var cname = new CString(max_size)
		active_uniform_name_native(index, max_size, cname)
		return cname.to_s
	end

	private fun active_uniform_name_native(index, max_size: Int, name: CString) `{
		int size;
		GLenum type;
		glGetActiveUniform(self, index, max_size, NULL, &size, &type, name);
	`}

	# Size of the active uniform at `index`
	fun active_uniform_size(index: Int): Int `{
		int size;
		GLenum type;
		glGetActiveUniform(self, index, 0, NULL, &size, &type, NULL);
		return size;
	`}

	# Type of the active uniform at `index`
	#
	# May be any data type supported by OpenGL ES 2.0 shaders.
	fun active_uniform_type(index: Int): GLDataType `{
		int size;
		GLenum type = 0;
		glGetActiveUniform(self, index, 0, NULL, &size, &type, NULL);
		return type;
	`}
end
lib/glesv2/glesv2.nit:51,1--178,3