Property definitions

gamnit $ AttributeMap :: defaultinit
# Map to organize `Attribute` instances by their name
class AttributeMap
	super ShaderVariableMap[Attribute]

	redef fun provide_default_value(key) do
		return new InactiveAttribute(program.gl_program.as(not null), "", -1, 0)
	end

	redef fun max_name_length do return glGetProgramiv(program.gl_program.as(not null), gl_ACTIVE_ATTRIBUTE_MAX_LENGTH)

	redef fun [](key)
	do
		# Update the location of this attribute from the user specified name
		var item = super
		if key isa Text then item.location = program.gl_program.attrib_location(key.to_s)
		return item
	end
end
lib/gamnit/programs.nit:526,1--543,3