Banjo API 1.0.0-rc.2
Low-level C99 game development API
Loading...
Searching...
No Matches
shader.h
Go to the documentation of this file.
1
37#ifndef BJ_SHADER_H
38#define BJ_SHADER_H
39
40#include <banjo/api.h>
41#include <banjo/bitmap.h>
42#include <banjo/vec.h>
43
59typedef int (*bj_bitmap_shading_fn)(struct bj_vec3* out_color, const struct bj_vec2 pixel_coord, void* user_data);
60
148#ifndef BJ_NO_TYPEDEF
150#endif
151
162#define BJ_SHADER_STANDARD_FLAGS (BJ_SHADER_INVERT_Y | BJ_SHADER_CLAMP_COLOR | BJ_SHADER_NORMALIZE_COORDS | BJ_SHADER_CENTER_COORDS)
163
178 struct bj_bitmap* bitmap,
180 void* data,
181 uint8_t flags
182);
183
184#endif
General-purpose definitions for Banjo API.
bj_audio_play_note_data data
Definition audio_pcm.c:104
Header file for Bitmap type.
#define BANJO_EXPORT
Definition api.h:163
struct bj_bitmap bj_bitmap
Definition api.h:328
2D vector of bj_real components.
Definition vec.h:51
3D vector of bj_real components.
Definition vec.h:64
void bj_shader_bitmap(struct bj_bitmap *bitmap, bj_bitmap_shading_fn shader, void *data, uint8_t flags)
Applies a shader function to every pixel in a bitmap.
bj_shader_flag
Shader input control flags.
Definition shader.h:69
int(* bj_bitmap_shading_fn)(struct bj_vec3 *out_color, const struct bj_vec2 pixel_coord, void *user_data)
Function type for a bitmap shading operation.
Definition shader.h:59
@ BJ_SHADER_CENTER_COORDS
Centre pixel coordinates around the origin.
Definition shader.h:145
@ BJ_SHADER_CLAMP_COLOR
Clamp the output colour to the range [0.0, 1.0].
Definition shader.h:110
@ BJ_SHADER_INVERT_Y
Invert the Y coordinate of the input pixel.
Definition shader.h:99
@ BJ_SHADER_NORMALIZE_COORDS
Normalise pixel coordinates to the [0.0, 1.0] range.
Definition shader.h:124
@ BJ_SHADER_INVERT_X
Invert the X coordinate of the input pixel.
Definition shader.h:84
Fixed-size vector types (2D, 3D, 4D) and inline operations.