Difference between revisions of "GLAPI/glCompileShader"

From OpenGL.org
Jump to: navigation, search
m (fixed sort key)
(See Also)
(6 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
== Function Definition ==
 
== Function Definition ==
  
   void '''glCompileShader'''(GLuint ''shader'');
+
   void '''glCompileShader'''(GLuint {{param|shader}});
  
 
; shader
 
; shader
Line 15: Line 15:
 
== Description ==
 
== Description ==
  
'''glCompileShader''' compiles the source code strings that have been stored in the shader object specified by ''shader''.
+
'''glCompileShader''' compiles the source code strings that have been stored in the shader object specified by {{param|shader}}.
  
The compilation status will be stored as part of the shader object's state. This value will be set to {{code|GL_TRUE}} if the shader was compiled without errors and is ready for use, and {{code|GL_FALSE}} otherwise. It can be queried by calling [[GLAPI/glGetShader|glGetShader]] with arguments ''shader'' and {{code|GL_COMPILE_STATUS}}.
+
The compilation status will be stored as part of the shader object's state. This value will be set to {{enum|GL_TRUE}} if the shader was compiled without errors and is ready for use, and {{enum|GL_FALSE}} otherwise. It can be queried by calling {{apifunc|glGetShader}} with arguments {{param|shader}} and {{enum|GL_COMPILE_STATUS}}.
  
Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification. Whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling [[GLAPI/glGetShaderInfoLog|glGetShaderInfoLog]].
+
Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification. Whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling {{apifunc|glGetShaderInfoLog}}.
  
 
== Errors ==
 
== Errors ==
  
{{code|GL_INVALID_VALUE}} is generated if ''shader'' is not a value generated by OpenGL.
+
{{enum|GL_INVALID_VALUE}} is generated if {{param|shader}} is not a value generated by OpenGL.
  
{{code|GL_INVALID_OPERATION}} is generated if ''shader'' is not a shader object.
+
{{enum|GL_INVALID_OPERATION}} is generated if {{param|shader}} is not a shader object.
  
 
== Associated Gets ==
 
== Associated Gets ==
  
[[GLAPI/glGetShaderInfoLog|glGetShaderInfoLog]] with argument ''shader''
+
{{apifunc|glGetShaderInfoLog}} with argument {{param|shader}}
  
[[GLAPI/glGetShader|glGetShader]] with arguments ''shader'' and {{code|GL_COMPILE_STATUS}}
+
{{apifunc|glGetShader}} with arguments {{param|shader}} and {{enum|GL_COMPILE_STATUS}}
  
[[GLAPI/glIsShader|glIsShader]]
+
{{apifunc|glIsShader}}
  
 
== See Also ==
 
== See Also ==
  
[[GLAPI/glCreateShader|glCreateShader]], [[GLAPI/glLinkProgram|glLinkProgram]], [[GLAPI/glShaderSource|glShaderSource]]
+
{{apifunc|glAttachShader}}, {{apifunc|glCreateShader}}, {{apifunc|glCreateShaderProgram}}, {{apifunc|glLinkProgram}}, {{apifunc|glReleaseShaderCompiler}}, {{apifunc|glShaderSource}}, {{apifunc|glShaderBinary}}
  
 
== Copyright ==
 
== Copyright ==
Line 43: Line 43:
 
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|CompileShader]]
+
[[Category:Core API Reference|CompileShader]]
 +
[[Category:Core API Ref Shader Program Creation|CompileShader]]

Revision as of 14:44, 20 October 2012

glCompileShader
Core in version 4.5
Core since version 2.0

glCompileShader: Compiles a shader object

Function Definition

 void glCompileShader(GLuint shader​);
shader
Specifies the shader object to be compiled.

Description

glCompileShader compiles the source code strings that have been stored in the shader object specified by shader​.

The compilation status will be stored as part of the shader object's state. This value will be set to GL_TRUE if the shader was compiled without errors and is ready for use, and GL_FALSE otherwise. It can be queried by calling glGetShader with arguments shader​ and GL_COMPILE_STATUS.

Compilation of a shader can fail for a number of reasons as specified by the OpenGL Shading Language Specification. Whether or not the compilation was successful, information about the compilation can be obtained from the shader object's information log by calling glGetShaderInfoLog.

Errors

GL_INVALID_VALUE is generated if shader​ is not a value generated by OpenGL.

GL_INVALID_OPERATION is generated if shader​ is not a shader object.

Associated Gets

glGetShaderInfoLog with argument shader​

glGetShader with arguments shader​ and GL_COMPILE_STATUS

glIsShader

See Also

glAttachShader, glCreateShader, glCreateShaderProgram, glLinkProgram, glReleaseShaderCompiler, glShaderSource, glShaderBinary

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