Compile and link OpenGL shader programs. More...
#include <GL/glew.h>
Go to the source code of this file.
Functions | |
void | debug_program (GLuint program, const char *name) |
Check program link status and output shader compile logs. | |
void | compile_shader (GLint program, GLenum type, const GLchar *source) |
Compile a shader. | |
GLint | compile_program_tf (const char *name, const GLchar *vert, const GLchar *geom, const GLchar *frag, int nvaryings, const GLchar **varyings) |
Compile a program with transform feedback. | |
GLint | compile_program (const char *name, const GLchar *vert, const GLchar *geom, const GLchar *frag) |
Compile a program without transform feedback. |
Compile and link OpenGL shader programs.
Definition in file shader.h.
GLint compile_program | ( | const char * | name, |
const GLchar * | vert, | ||
const GLchar * | geom, | ||
const GLchar * | frag | ||
) |
Compile a program without transform feedback.
name | The name of the program for log messages. |
vert | The vertex shader source, or null. |
geom | The geometry shader source, or null. |
frag | The fragment shader source, or null. |
Definition at line 105 of file shader.c.
References compile_program_tf().
Referenced by fp32_colour_begin(), fp32_escaped_begin(), fp32_fillc_begin(), fp64_escaped_begin(), and fpxx_escaped_begin().
GLint compile_program_tf | ( | const char * | name, |
const GLchar * | vert, | ||
const GLchar * | geom, | ||
const GLchar * | frag, | ||
int | nvaryings, | ||
const GLchar ** | varyings | ||
) |
Compile a program with transform feedback.
name | The name of the program for log messages. |
vert | The vertex shader source, or null. |
geom | The geometry shader source, or null. |
frag | The fragment shader source, or null. |
nvaryings | The number of varyings to capture in transform feedback, or 0. |
varyings | The names of the varyings to capture in transform feedback, or 0. |
Definition at line 83 of file shader.c.
References compile_shader(), D, and debug_program().
Referenced by compile_program(), fp32_init_begin(), fp32_step_begin(), fp32_unescaped_begin(), fp64_init_begin(), fp64_step_begin(), fp64_unescaped_begin(), fpxx_approx_begin(), fpxx_init_begin(), fpxx_step_begin(), and fpxx_unescaped_begin().
void compile_shader | ( | GLint | program, |
GLenum | type, | ||
const GLchar * | source | ||
) |
Compile a shader.
Automatically adds extra sources (preamble, complex number functions, define for DE).
program | The program to link the shader to. |
type | The type of shader. |
source | The glsl source code. |
Definition at line 62 of file shader.c.
References config, D, DE, fp32_complex, fp32_preamble, FP64, fp64_complex, and fp64_preamble.
Referenced by compile_program_tf().
void debug_program | ( | GLuint | program, |
const char * | name | ||
) |
Check program link status and output shader compile logs.
program | The program to debug. |
name | The name of the progam for log messages. |
Definition at line 28 of file shader.c.
References D, LOG_ERROR, log_level, log_message, log_target, and LOG_WARN.
Referenced by compile_program_tf().