glesv2 :: GLProgram :: active_attrib_name
Name of the active attribute atindex
glesv2 :: GLProgram :: active_attrib_size
Size of the active attribute atindex
glesv2 :: GLProgram :: active_attrib_type
Type of the active attribute atindex
glesv2 :: GLProgram :: active_attribute_max_length
Length of the longest attribute name in this program, including the null byteglesv2 :: GLProgram :: active_uniform_max_length
Length of the longest uniform name in this program, including the null byteglesv2 :: GLProgram :: active_uniform_name
Name of the active uniform atindex
glesv2 :: GLProgram :: active_uniform_size
Size of the active uniform atindex
glesv2 :: GLProgram :: active_uniform_type
Type of the active uniform atindex
glesv2 :: GLProgram :: attrib_location
Get the location of the attribute byname
glesv2 :: GLProgram :: bind_attrib_location
Set the location for the attribute byname
glesv2 :: GLProgram :: defaultinit
glesv2 :: GLProgram :: is_validated
Boolean result ofvalidate
, must be called after validate
glesv2 :: GLProgram :: n_active_attributes
Number of active attributes in this programglesv2 :: GLProgram :: n_active_uniforms
Number of active uniform in this programglesv2 :: GLProgram :: n_attached_shaders
Number of shaders attached to this programglesv2 :: GLProgram :: uniform_location
Get the location of the uniform byname
glesv2 :: GLProgram :: active_attrib_name
Name of the active attribute atindex
glesv2 :: GLProgram :: active_attrib_size
Size of the active attribute atindex
glesv2 :: GLProgram :: active_attrib_type
Type of the active attribute atindex
glesv2 :: GLProgram :: active_attribute_max_length
Length of the longest attribute name in this program, including the null byteglesv2 :: GLProgram :: active_uniform_max_length
Length of the longest uniform name in this program, including the null byteglesv2 :: GLProgram :: active_uniform_name
Name of the active uniform atindex
glesv2 :: GLProgram :: active_uniform_size
Size of the active uniform atindex
glesv2 :: GLProgram :: active_uniform_type
Type of the active uniform atindex
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?glesv2 :: GLProgram :: attrib_location
Get the location of the attribute byname
glesv2 :: GLProgram :: bind_attrib_location
Set the location for the attribute byname
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
glesv2 :: GLProgram :: defaultinit
core :: Object :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
glesv2 :: GLProgram :: is_validated
Boolean result ofvalidate
, must be called after validate
glesv2 :: GLProgram :: n_active_attributes
Number of active attributes in this programglesv2 :: GLProgram :: n_active_uniforms
Number of active uniform in this programglesv2 :: GLProgram :: n_attached_shaders
Number of shaders attached to this programcore :: Object :: output_class_name
Display class name on stdout (debug only).glesv2 :: GLProgram :: uniform_location
Get the location of the uniform byname
# 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