OpenGL Getting Shader Attached to Program

…衆ロ難τιáo~ 提交于 2019-12-04 06:57:25
  1. glGetAttachedShaders() to get the names of the shaders attached to the given program object.

  2. glGetShaderiv( ..., GL_SHADER_TYPE, ... ) to get the type (vertex, geometry, fragment) of shader.

  3. glGetShaderiv( ..., GL_SHADER_SOURCE_LENGTH, ... ) on each shader name to figure out how long the source is.

  4. glGetShaderSource() to get the source string for each attached shader.

EDIT: If all you need are the shader names & types you can stop after step 2.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!