Untitled
Loading...
Searching...
No Matches
shaders.h File Reference

Initialization for ShaderPrograms. More...

Go to the source code of this file.

Functions

char * read_file (const char *filename)
 Reads a file into raw bytes.
GLuint create_compute_shader (const char *filename)
 Creates a compute shader.
GLuint compile_shader (GLenum type, const char *filename)
 Compiles a non-compute shader.
GLuint create_shader_program (const char *vertex_path, const char *fragment_path)
 Compiles and links vert and frag pairs.
void SHADERS_INIT ()
 Deletes and then recompiles and links all engine shaders.

Detailed Description

Initialization for ShaderPrograms.

Definition in file shaders.h.

Function Documentation

◆ read_file()

char * read_file ( const char * filename)

Reads a file into raw bytes.

Parameters
filenameThe file to read.
Returns
The byte buffer.
Warning
Must be freed.

Definition at line 10 of file shaders.c.

References read_file(), and size.

Referenced by compile_gbuffer_frag_shader(), compile_postprocess_shader(), compile_shader(), compile_uber_frag_shader(), create_compute_shader(), and read_file().

◆ create_compute_shader()

GLuint create_compute_shader ( const char * filename)

Creates a compute shader.

Parameters
filenameThe path to file.
Returns
The handle for the shader.

Definition at line 34 of file shaders.c.

References create_compute_shader(), and read_file().

Referenced by create_compute_shader(), init_audio_shader(), init_cull_clusers_compute_shader(), init_cull_draw_calls_compute_shader(), init_dof_shader(), and init_lightmap_bounce_compute_shader().

◆ compile_shader()

GLuint compile_shader ( GLenum type,
const char * filename )

Compiles a non-compute shader.

Parameters
typeThe type of shader to compile.
filenameThe path to the shader.
Returns
The handle for the shader.

Definition at line 77 of file shaders.c.

References compile_shader(), and read_file().

Referenced by compile_shader(), create_gbuffer_program(), create_geometry_shader_program(), create_postprocess_program(), create_shader_program(), and create_ubershader_program().

◆ create_shader_program()

GLuint create_shader_program ( const char * vertex_path,
const char * fragment_path )

Compiles and links vert and frag pairs.

Parameters
vertex_pathThe path to the vert shader.
fragment_pathThe path to the frag shader.
Returns
The handle to the linked shader.

Definition at line 377 of file shaders.c.

References compile_shader(), and create_shader_program().

Referenced by create_shader_program(), init_bloom_shader(), init_brdf_shader(), init_depth_pre_pass_shader(), init_dof_shader(), init_lightmap_shader(), init_shadow_map_shader(), init_sky_shader(), init_ssao_shader(), init_text_shader(), init_ui_shader(), and init_wireframe_shader().

◆ SHADERS_INIT()