Click or drag to resize

VertexAttribute Constructor (Program, String)

Creates a vertex attribute.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public VertexAttribute(
	Program program,
	string attributeName
)

Parameters

program
Type: OooglesProgram
the program containing the attribute.
attributeName
Type: SystemString
the (case-sensitive) name of the attribute as used in the vertex shader of the program.
Exceptions
ExceptionCondition
GLExceptionInvalidOperation if program is not a valid program or has not been successfully linked.
Remarks
Queries the previously linked program object specified by program for the attribute variable specified by attributeName and initializes the attribute with the index of the generic vertex attribute that is bound to that attribute variable. If attributeName is a matrix attribute variable, the index of the first column of the matrix is used.

The association between an attribute variable name and a generic attribute index can be specified by using the other constructor VertexAttribute(Program, Int32, String). Attribute bindings do not go into effect until Link is called. After a program object has been linked successfully, the index values for attribute variables remain fixed until the next link command occurs. The attribute values can only be queried after a link if the link was successful.

This method uses the binding that actually went into effect the last time Link was called for the specified program object. Attribute bindings that have been specified since the last link operation are not used.

Note: in DEBUG mode, a warning will be logged to the debug console if program does not contain an attribute named attributeName, or attributeName starts with the reserved prefix 'gl_'.

OpenGL API: glGetAttribLocation

See Also