GLAPI/glIsProgram: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
4.0 API.
 
m Bot: Adding better formatting.
 
(5 intermediate revisions by the same user not shown)
Line 8: Line 8:
== Function Definition ==
== Function Definition ==


   GLboolean '''glIsProgram'''(GLuint ''program'');
   GLboolean '''glIsProgram'''(GLuint {{param|program}});


; program
; program
Line 15: Line 15:
== Description ==
== Description ==


'''glIsProgram''' returns {{code|GL_TRUE}} if ''program'' is the name of a program object previously created with [[GLAPI/glCreateProgram|glCreateProgram]] and not yet deleted with [[GLAPI/glDeleteProgram|glDeleteProgram]]. If ''program'' is zero or a non-zero value that is not the name of a program object, or if an error occurs, '''glIsProgram''' returns {{code|GL_FALSE}}.
'''glIsProgram''' returns {{enum|GL_TRUE}} if {{param|program}} is the name of a program object previously created with {{apifunc|glCreateProgram}} and not yet deleted with {{apifunc|glDeleteProgram}}. If {{param|program}} is zero or a non-zero value that is not the name of a program object, or if an error occurs, '''glIsProgram''' returns {{enum|GL_FALSE}}.


== Notes ==
== Notes ==


No error is generated if ''program'' is not a valid program object name.
No error is generated if {{param|program}} is not a valid program object name.


A program object marked for deletion with [[GLAPI/glDeleteProgram|glDeleteProgram]] but still in use as part of current rendering state is still considered a program object and '''glIsProgram''' will return {{code|GL_TRUE}}.
A program object marked for deletion with {{apifunc|glDeleteProgram}} but still in use as part of current rendering state is still considered a program object and '''glIsProgram''' will return {{enum|GL_TRUE}}.


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


[[GLAPI/glGet|glGet]] with the argument {{code|GL_CURRENT_PROGRAM}}
{{apifunc|glGet}} with the argument {{enum|GL_CURRENT_PROGRAM}}


[[GLAPI/glGetActiveAttrib|glGetActiveAttrib]] with arguments ''program'' and the index of an active attribute variable
{{apifunc|glGetActiveAttrib}} with arguments {{param|program}} and the index of an active attribute variable


[[GLAPI/glGetActiveUniform|glGetActiveUniform]] with arguments ''program'' and the index of an active uniform variable
{{apifunc|glGetActiveUniform}} with arguments {{param|program}} and the index of an active uniform variable


[[GLAPI/glGetAttachedShaders|glGetAttachedShaders]] with argument ''program''
{{apifunc|glGetAttachedShaders}} with argument {{param|program}}


[[GLAPI/glGetAttribLocation|glGetAttribLocation]] with arguments ''program'' and the name of an attribute variable
{{apifunc|glGetAttribLocation}} with arguments {{param|program}} and the name of an attribute variable


[[GLAPI/glGetProgram|glGetProgram]] with arguments ''program'' and the parameter to be queried
{{apifunc|glGetProgram}} with arguments {{param|program}} and the parameter to be queried


[[GLAPI/glGetProgramInfoLog|glGetProgramInfoLog]] with argument ''program''
{{apifunc|glGetProgramInfoLog}} with argument {{param|program}}


[[GLAPI/glGetUniform|glGetUniform]] with arguments ''program'' and the location of a uniform variable
{{apifunc|glGetUniform}} with arguments {{param|program}} and the location of a uniform variable


[[GLAPI/glGetUniformLocation|glGetUniformLocation]] with arguments ''program'' and the name of a uniform variable
{{apifunc|glGetUniformLocation}} with arguments {{param|program}} and the name of a uniform variable


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


[[GLAPI/glAttachShader|glAttachShader]], [[GLAPI/glBindAttribLocation|glBindAttribLocation]], [[GLAPI/glCreateProgram|glCreateProgram]], [[GLAPI/glDeleteProgram|glDeleteProgram]], [[GLAPI/glDetachShader|glDetachShader]], [[GLAPI/glLinkProgram|glLinkProgram]], [[GLAPI/glUniform|glUniform]], [[GLAPI/glUseProgram|glUseProgram]], [[GLAPI/glValidateProgram|glValidateProgram]]
{{apifunc|glCreateProgram}}, {{apifunc|glCreateShaderProgram}}, {{apifunc|glDeleteProgram}}


== Copyright ==
== Copyright ==
Line 51: Line 51:
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:API Reference 4|IsProgram]]
[[Category:Core API Reference|IsProgram]]
[[Category:Core API Ref Shader Program Creation|IsProgram]]

Latest revision as of 19:41, 27 September 2012

glIsProgram
Core in version 4.6
Core since version 2.0

glIsProgram: Determines if a name corresponds to a program object

Function Definition

 GLboolean glIsProgram(GLuint program​);
program
Specifies a potential program object.

Description

glIsProgram returns GL_TRUE if program​ is the name of a program object previously created with glCreateProgram and not yet deleted with glDeleteProgram. If program​ is zero or a non-zero value that is not the name of a program object, or if an error occurs, glIsProgram returns GL_FALSE.

Notes

No error is generated if program​ is not a valid program object name.

A program object marked for deletion with glDeleteProgram but still in use as part of current rendering state is still considered a program object and glIsProgram will return GL_TRUE.

Associated Gets

glGet with the argument GL_CURRENT_PROGRAM

glGetActiveAttrib with arguments program​ and the index of an active attribute variable

glGetActiveUniform with arguments program​ and the index of an active uniform variable

glGetAttachedShaders with argument program​

glGetAttribLocation with arguments program​ and the name of an attribute variable

glGetProgram with arguments program​ and the parameter to be queried

glGetProgramInfoLog with argument program​

glGetUniform with arguments program​ and the location of a uniform variable

glGetUniformLocation with arguments program​ and the name of a uniform variable

See Also

glCreateProgram, glCreateShaderProgram, glDeleteProgram

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/.