GLAPI/glGetAttachedShaders: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
m (Renaming category: 'API Reference 4' to 'Core API Reference'.)
m (Bot: Adding better formatting.)
 
(4 intermediate revisions by the same user not shown)
Line 8: Line 8:
== Function Definition ==
== Function Definition ==


   void '''glGetAttachedShaders'''(GLuint ''program'', GLsizei ''maxCount'', GLsizei *''count'', GLuint *''shaders'');
   void '''glGetAttachedShaders'''(GLuint {{param|program}}, GLsizei {{param|maxCount}}, GLsizei *{{param|count}}, GLuint *{{param|shaders}});


; program
; program
Line 15: Line 15:
: Specifies the size of the array for storing the returned object names.
: Specifies the size of the array for storing the returned object names.
; count
; count
: Returns the number of names actually returned in ''objects''.
: Returns the number of names actually returned in {{param|objects}}.
; shaders
; shaders
: Specifies an array that is used to return the names of attached shader objects.
: Specifies an array that is used to return the names of attached shader objects.
Line 21: Line 21:
== Description ==
== Description ==


'''glGetAttachedShaders''' returns the names of the shader objects attached to ''program''. The names of shader objects that are attached to ''program'' will be returned in ''shaders.'' The actual number of shader names written into ''shaders'' is returned in ''count.'' If no shader objects are attached to ''program'', ''count'' is set to 0. The maximum number of shader names that may be returned in ''shaders'' is specified by ''maxCount''.
'''glGetAttachedShaders''' returns the names of the shader objects attached to {{param|program}}. The names of shader objects that are attached to {{param|program}} will be returned in {{param|shaders.}} The actual number of shader names written into {{param|shaders}} is returned in {{param|count.}} If no shader objects are attached to {{param|program}}, {{param|count}} is set to 0. The maximum number of shader names that may be returned in {{param|shaders}} is specified by {{param|maxCount}}.


If the number of names actually returned is not required (for instance, if it has just been obtained by calling [[GLAPI/glGetProgram|glGetProgram]]), a value of {{code|NULL}} may be passed for count. If no shader objects are attached to ''program'', a value of 0 will be returned in ''count''. The actual number of attached shaders can be obtained by calling [[GLAPI/glGetProgram|glGetProgram]] with the value {{code|GL_ATTACHED_SHADERS}}.
If the number of names actually returned is not required (for instance, if it has just been obtained by calling {{apifunc|glGetProgram}}), a value of {{code|NULL}} may be passed for count. If no shader objects are attached to {{param|program}}, a value of 0 will be returned in {{param|count}}. The actual number of attached shaders can be obtained by calling {{apifunc|glGetProgram}} with the value {{enum|GL_ATTACHED_SHADERS}}.


== Errors ==
== Errors ==


{{code|GL_INVALID_VALUE}} is generated if ''program'' is not a value generated by OpenGL.
{{enum|GL_INVALID_VALUE}} is generated if {{param|program}} is not a value generated by OpenGL.


{{code|GL_INVALID_OPERATION}} is generated if ''program'' is not a program object.
{{enum|GL_INVALID_OPERATION}} is generated if {{param|program}} is not a program object.


{{code|GL_INVALID_VALUE}} is generated if ''maxCount'' is less than 0.
{{enum|GL_INVALID_VALUE}} is generated if {{param|maxCount}} is less than 0.


== Associated Gets ==
== Associated Gets ==


[[GLAPI/glGetProgram|glGetProgram]] with argument {{code|GL_ATTACHED_SHADERS}}
{{apifunc|glGetProgram}} with argument {{enum|GL_ATTACHED_SHADERS}}


[[GLAPI/glIsProgram|glIsProgram]]
{{apifunc|glIsProgram}}


== See Also ==
== See Also ==


[[GLAPI/glAttachShader|glAttachShader]], [[GLAPI/glDetachShader|glDetachShader]]
{{apifunc|glCreateProgram}}, {{apifunc|glAttachShader}}, {{apifunc|glDetachShader}}


== Copyright ==
== Copyright ==
Line 47: Line 47:
Copyright © 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. [http://opencontent.org/openpub/ http://opencontent.org/openpub/].
Copyright © 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. [http://opencontent.org/openpub/ http://opencontent.org/openpub/].


[[Category:GL 4 API Shader Program Creation|GetAttachedShaders]]
[[Category:Core API Reference|GetAttachedShaders]]
[[Category:Core API Reference|GetAttachedShaders]]
[[Category:Core API Ref Shader Program Creation|GetAttachedShaders]]
[[Category:Program Object API State Functions|GetAttachedShaders]]

Latest revision as of 09:59, 15 August 2013

glGetAttachedShaders
Core in version 4.6
Core since version 2.0

glGetAttachedShaders: Returns the handles of the shader objects attached to a program object

Function Definition

 void glGetAttachedShaders(GLuint program​, GLsizei maxCount​, GLsizei *count​, GLuint *shaders​);
program
Specifies the program object to be queried.
maxCount
Specifies the size of the array for storing the returned object names.
count
Returns the number of names actually returned in objects​.
shaders
Specifies an array that is used to return the names of attached shader objects.

Description

glGetAttachedShaders returns the names of the shader objects attached to program​. The names of shader objects that are attached to program​ will be returned in shaders.​ The actual number of shader names written into shaders​ is returned in count.​ If no shader objects are attached to program​, count​ is set to 0. The maximum number of shader names that may be returned in shaders​ is specified by maxCount​.

If the number of names actually returned is not required (for instance, if it has just been obtained by calling glGetProgram), a value of NULL may be passed for count. If no shader objects are attached to program​, a value of 0 will be returned in count​. The actual number of attached shaders can be obtained by calling glGetProgram with the value GL_ATTACHED_SHADERS.

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_VALUE is generated if maxCount​ is less than 0.

Associated Gets

glGetProgram with argument GL_ATTACHED_SHADERS

glIsProgram

See Also

glCreateProgram, glAttachShader, glDetachShader

Copyright

Copyright © 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.