Banjo API 1.0.0-rc.2
Low-level C99 game development API
Loading...
Searching...
No Matches
shaders.c File Reference
#include <banjo/app.h>
#include <banjo/main.h>
#include <banjo/bitmap.h>
#include <banjo/event.h>
#include <banjo/log.h>
#include <banjo/shader.h>
#include <banjo/system.h>
#include <banjo/time.h>
#include <banjo/window.h>
Include dependency graph for shaders.c:

Go to the source code of this file.

Macros

#define CANVAS_W   512
#define CANVAS_H   512

Functions

static bj_vec3 palette (bj_real t)
int shader_code (bj_vec3 *frag_color, const bj_vec2 frag_coords, void *data)
static void on_draw (struct bj_window *w, struct bj_render_target *target, const struct bj_rect *dirty, void *user_data)
static void * setup (struct bj_app *app, void *init_data)
static void step (struct bj_app *app, struct bj_tick_info tick, void *user_data)
static void teardown (struct bj_app *app, void *user_data)
int main (int argc, char *argv[])

Variables

bj_windowwindow = 0

Macro Definition Documentation

◆ CANVAS_H

#define CANVAS_H   512
Examples
drawing_2d.c, and shaders.c.

Definition at line 27 of file shaders.c.

Referenced by setup(), and setup().

◆ CANVAS_W

#define CANVAS_W   512
Examples
drawing_2d.c, and shaders.c.

Definition at line 26 of file shaders.c.

Referenced by setup(), and setup().

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 146 of file shaders.c.

◆ on_draw()

void on_draw ( struct bj_window * w,
struct bj_render_target * target,
const struct bj_rect * dirty,
void * user_data )
static

Definition at line 97 of file shaders.c.

◆ palette()

bj_vec3 palette ( bj_real t)
static
Examples
shaders.c.

Definition at line 33 of file shaders.c.

Referenced by shader_code().

◆ setup()

void * setup ( struct bj_app * app,
void * init_data )
static

Definition at line 113 of file shaders.c.

◆ shader_code()

int shader_code ( bj_vec3 * frag_color,
const bj_vec2 frag_coords,
void * data )
Examples
shaders.c.

Definition at line 56 of file shaders.c.

Referenced by on_draw().

◆ step()

void step ( struct bj_app * app,
struct bj_tick_info tick,
void * user_data )
static

Definition at line 129 of file shaders.c.

◆ teardown()

void teardown ( struct bj_app * app,
void * user_data )
static

Definition at line 140 of file shaders.c.

Variable Documentation

◆ window

bj_window* window = 0

Definition at line 29 of file shaders.c.