Provides functions for creating and destroying shaders.
More...
#include <kinc/global.h>
#include <kinc/backend/graphics4/shader.h>
Go to the source code of this file.
|
|
typedef enum kinc_g4_shader_type | kinc_g4_shader_type_t |
|
typedef struct kinc_g4_shader | kinc_g4_shader_t |
|
| enum | kinc_g4_shader_type {
KINC_G4_SHADER_TYPE_FRAGMENT
, KINC_G4_SHADER_TYPE_VERTEX
, KINC_G4_SHADER_TYPE_COMPUTE
, KINC_G4_SHADER_TYPE_GEOMETRY
,
KINC_G4_SHADER_TYPE_TESSELLATION_CONTROL
, KINC_G4_SHADER_TYPE_TESSELLATION_EVALUATION
, KINC_G4_SHADER_TYPE_COUNT
} |
|
| KINC_FUNC void | kinc_g4_shader_init (kinc_g4_shader_t *shader, const void *data, size_t length, kinc_g4_shader_type_t type) |
| | Initializes a shader based on system-specific shader-data. The system-specific shader-data is usually created per system by the krafix-shader-compiler which is automatically called by kincmake.
|
| KINC_FUNC int | kinc_g4_shader_init_from_source (kinc_g4_shader_t *shader, const char *source, kinc_g4_shader_type_t type) |
| | Initializes a shader from GLSL-source-code. This only works on some platforms and only if KRAFIX_LIBRARY define has been set and the krafix-shader-compiler was compiled in library-mode and linked into the application.
|
| KINC_FUNC void | kinc_g4_shader_destroy (kinc_g4_shader_t *shader) |
| | Destroys a shader.
|
Provides functions for creating and destroying shaders.
◆ kinc_g4_shader_destroy()
| KINC_FUNC void kinc_g4_shader_destroy |
( |
kinc_g4_shader_t * | shader | ) |
|
Destroys a shader.
- Parameters
-
| shader | The shader to destroy |
◆ kinc_g4_shader_init()
| KINC_FUNC void kinc_g4_shader_init |
( |
kinc_g4_shader_t * | shader, |
|
|
const void * | data, |
|
|
size_t | length, |
|
|
kinc_g4_shader_type_t | type ) |
Initializes a shader based on system-specific shader-data. The system-specific shader-data is usually created per system by the krafix-shader-compiler which is automatically called by kincmake.
- Parameters
-
| shader | The shader to initialize |
| data | The system-specific shader-data |
| length | The length of the system-specific shader-data in bytes |
| type | The type of the shader |
◆ kinc_g4_shader_init_from_source()
| KINC_FUNC int kinc_g4_shader_init_from_source |
( |
kinc_g4_shader_t * | shader, |
|
|
const char * | source, |
|
|
kinc_g4_shader_type_t | type ) |
Initializes a shader from GLSL-source-code. This only works on some platforms and only if KRAFIX_LIBRARY define has been set and the krafix-shader-compiler was compiled in library-mode and linked into the application.
- Parameters
-
| shader | The shader to initialize |
| source | The GLSL-shader-source-code |
| type | The type of the shader |
- Returns
- The number of errors the compiler encountered - hopefully it's zero.