Gambas Documentation
Aperçu du Langage
À traduire
Code Snippets
Comment faire ...
Compilation et installation
Composants
gb
gb.args
gb.cairo
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.db
gb.db.form
gb.dbus
gb.debug
gb.desktop
gb.desktop.gnome.keyring
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.mdi
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gui
gb.image
gb.image.effect
gb.image.imlib
gb.image.io
gb.inotify
gb.libxml
gb.media
gb.mysql
gb.net
gb.net.curl
gb.net.smtp
gb.openal
gb.opengl
gb.opengl.glsl
Gl
AttachShader
CompileShader
CreateProgram
CreateShader
DeleteProgram
DeleteShader
DetachShader
GetAttachedShaders
GetProgramInfoLog
GetProgramiv
GetShaderInfoLog
GetShaderiv
GetShaderSource
IsProgram
IsShader
LinkProgram
ShaderSource
Uniform1f
Uniform1fv
Uniform1i
Uniform1iv
Uniform2f
Uniform2fv
Uniform2i
Uniform2iv
Uniform3f
Uniform3fv
Uniform3i
Uniform3iv
Uniform4f
Uniform4fv
Uniform4i
Uniform4iv
UniformMatrix2fv
UniformMatrix2x3fv
UniformMatrix2x4fv
UniformMatrix3fv
UniformMatrix3x2fv
UniformMatrix3x4fv
UniformMatrix4fv
UniformMatrix4x2fv
UniformMatrix4x3fv
UseProgram
ValidateProgram
VertexAttrib1f
VertexAttrib1fv
VertexAttrib2f
VertexAttrib2fv
VertexAttrib3f
VertexAttrib3fv
VertexAttrib4f
VertexAttrib4fv
gb.opengl.glu
gb.opengl.sge
gb.option
gb.pcre
gb.pdf
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt5
gb.qt5.opengl
gb.report
gb.scanner
gb.sdl
gb.sdl.sound
gb.settings
gb.signal
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
Controls pictures
Derniers changements
Dépôt d'applications
Documentation de l'Environnement de développement
Documentation des développeurs
Documents
Indenter
Index de tous les Documents
Index du langage
Lexique
LISEZ-MOI
Manuel du wiki
Messages d'erreur
Tutoriels
Wiki License

Gl.GetUniformLocation (gb.opengl.glsl)

Static Function GetUniformLocation ( Program As Integer, Name As String ) As Integer

Returns the location of a uniform variable.

Parameters

program

Specifies the program object to be queried.
name

Points to a null terminated string containing the name of the uniform variable whose location is to be queried.

Description

Gl.GetUniformLocation * returns an integer that represents the location of a specific uniform variable within a program object. name must be a null terminated string that contains no white space. name must be an active uniform variable name in program that is not a structure, an array of structures, or a subcomponent of a vector or a matrix. This function returns -1 if name does not correspond to an active uniform variable in program or if name starts with the reserved prefix "gl_".

Uniform variables that are structures or arrays of structures may be queried by calling Gl.GetUniformLocation for each field within the structure. The array element operator "[]" and the structure field operator "." may be used in name in order to select elements within an array or fields within a structure. The result of using these operators is not allowed to be another structure, an array of structures, or a subcomponent of a vector or a matrix. Except if the last part of name indicates a uniform variable array, the location of the first element of an array can be retrieved by using the name of the array, or by using the name appended by "/wiki/0".

The actual locations assigned to uniform variables are not known until the program object is linked successfully. After linking has occurred, the command Gl.GetUniformLocation can be used to obtain the location of a uniform variable. This location value can then be passed to Glu.niform to set the value of the uniform variable or to Gl.GetUniform in order to query the current value of the uniform variable. After a program object has been linked successfully, the index values for uniform variables remain fixed until the next link command occurs. Uniform variable locations and values can only be queried after a link if the link was successful.

Errors

Gl.INVALID_VALUE is generated if program is not a value generated by OpenGL.

Gl.INVALID_OPERATION is generated if program is not a program object.

Gl.INVALID_OPERATION is generated if program has not been successfully linked.

Associated Gets

Gl.GetActiveUniform with arguments program and the index of an active uniform variable

Gl.GetProgram with arguments program and Gl.ACTIVE_UNIFORMS or Gl.ACTIVE_UNIFORM_MAX_LENGTH

Gl.GetUniform with arguments program and the name of a uniform variable

Gl.IsProgram

See also

Glu.niform

See original documentation on OpenGL website