ShaderTool
0.1
Live tool for developing OpenGL shaders interactively
|
Go to the source code of this file.
Functions | |
char * | read_file (const char *const filename) |
Reads a file in a heap-allocated buffer. More... | |
int | compile_shaders (unsigned int *shader_program, const char *const fragment_shader_file) |
Compile shaders from source files. More... | |
int compile_shaders | ( | unsigned int * | shader_program, |
const char *const | fragment_shader_file | ||
) |
Compile shaders from source files.
This function reads the source files of the vertex and fragment shaders, compiles them, and links them together in a shader program.
shader_program | Pointer to the ID of the shader program where the shaders will be stored. |
fragment_shader_file | File name of the fragment shader. |
char* read_file | ( | const char *const | filename | ) |
Reads a file in a heap-allocated buffer.
This function computes the length of the file, allocate a buffer of the correct size, and reads the file in the buffer. Returns NULL
on error.
filename | The file to read. |
NULL
if there was an error.