Method GL.GLSLUtils.GLSLProgram()->add_texture()
- Method
add_texture
voidadd_texture(stringname,int|objecttype_or_texture,int|voidid)- Description
Adds a texture to the list of textures used by the shader. If this function is used the allocation of texture units is done automatically by this class.
There are really two variants of this function: If
type_or_textureis an integer, theidindicates the texture object ID (as given byglGenTextures), andtype_or_textureindicates the texture type (GL_TEXTURE_2D etc).If
type_or_textureis an object, it's assumed that there is a texture_type member variable (indicating the texture type, such as GL_TEXTURE_2D) and a use method that will bind the texture to the currently active texture unit.The GLUE.Texture class meets these requirements. The RenderBuffer objects does not, however.
A RenderBuffer can be added as an texture by calling add_texture( name, buffer->texture_type, buffer->texture )
There are currently no checks done to ensure that you don't use more textures than there are texture units on your graphics card.