GLFragmentShader
and GLVertexShader
core :: Pointer :: address_is_null
Is the address behind this Object at NULL?core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Pointer :: defaultinit
glesv2 :: GLShader :: defaultinit
core :: Object :: 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.
core :: Object :: output_class_name
Display class name on stdout (debug only).
# Abstract OpenGL ES shader object, implemented by `GLFragmentShader` and `GLVertexShader`
extern class GLShader `{GLuint`}
# Source of the shader, if available
#
# Returns `null` if the source is not available, usually when the shader
# was created from a binary file.
fun source: nullable String
do
var size = glGetShaderiv(self, gl_SHADER_SOURCE_LENGTH)
if size == 0 then return null
return source_native(size).to_s
end
private fun source_native(size: Int): CString `{
GLchar *code = malloc(size);
glGetShaderSource(self, size, NULL, code);
return code;
`}
# Has this shader been compiled?
fun is_compiled: Bool do return glGetShaderiv(self, gl_COMPILE_STATUS) != 0
# Has this shader been deleted?
fun is_deleted: Bool do return glGetShaderiv(self, gl_DELETE_STATUS) != 0
end
lib/glesv2/glesv2.nit:227,1--252,3