|
Banjo API 1.0.0-rc.2
Low-level C99 game development API
|
#include <banjo/app.h>#include <banjo/main.h>#include <banjo/bitmap.h>#include <banjo/draw.h>#include <banjo/event.h>#include <banjo/log.h>#include <banjo/memory.h>#include <banjo/pixel.h>#include <banjo/random.h>#include <banjo/system.h>#include <banjo/window.h>Go to the source code of this file.
Data Structures | |
| struct | distribution |
Macros | |
| #define | FB_PIXEL_MODE BJ_PIXEL_MODE_XRGB8888 |
| #define | WINDOW_W 800 |
| #define | WINDOW_H 600 |
| #define | BORDER_W 25 |
| #define | BORDER_H 15 |
| #define | GRAPH_W (WINDOW_W - BORDER_W * 2) |
| #define | GRAPH_H (WINDOW_H - 100) |
| #define | N_DISTRIBUTIONS 3 |
Functions | |
| static void | init_distributions (void) |
| static void | run_distributions () |
| static uint32_t | darken_color (uint32_t pixel, double factor, bj_bitmap *bmp) |
| void | draw (bj_bitmap *bmp) |
| static void | on_draw (struct bj_window *w, struct bj_render_target *target, const struct bj_rect *dirty, void *user_data) |
| static void | roll (void) |
| void | key_callback (bj_window *p_window, const bj_key_event *e, void *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 | |
| size_t | n_steps_base = 524288 |
| distribution | distributions [3] |
| bj_window * | window = 0 |
| struct distribution |
Definition at line 41 of file random_distribution.c.
| Data Fields | ||
|---|---|---|
| uint32_t | color | |
| size_t | max_y | |
| size_t | min_y | |
| size_t | n_steps | |
| const char * | name | |
| size_t | result[(800 - 25 *2)] | |
| #define BORDER_H 15 |
Definition at line 34 of file random_distribution.c.
Referenced by draw().
| #define BORDER_W 25 |
Definition at line 33 of file random_distribution.c.
Referenced by draw().
| #define FB_PIXEL_MODE BJ_PIXEL_MODE_XRGB8888 |
Definition at line 28 of file random_distribution.c.
| #define GRAPH_H (WINDOW_H - 100) |
Definition at line 37 of file random_distribution.c.
Referenced by draw().
Definition at line 36 of file random_distribution.c.
Referenced by draw(), and run_distributions().
| #define N_DISTRIBUTIONS 3 |
Definition at line 39 of file random_distribution.c.
Referenced by draw(), and run_distributions().
| #define WINDOW_H 600 |
Definition at line 31 of file random_distribution.c.
| #define WINDOW_W 800 |
Definition at line 30 of file random_distribution.c.
|
static |
Definition at line 128 of file random_distribution.c.
Referenced by draw().
| void draw | ( | bj_bitmap * | bmp | ) |
Definition at line 141 of file random_distribution.c.
|
static |
Definition at line 54 of file random_distribution.c.
Referenced by setup().
| void key_callback | ( | bj_window * | p_window, |
| const bj_key_event * | e, | ||
| void * | data ) |
Definition at line 229 of file random_distribution.c.
| int main | ( | int | argc, |
| char * | argv[] ) |
Definition at line 282 of file random_distribution.c.
|
static |
Definition at line 206 of file random_distribution.c.
|
static |
Definition at line 221 of file random_distribution.c.
Referenced by key_callback(), and setup().
|
static |
Definition at line 71 of file random_distribution.c.
Referenced by roll().
|
static |
Definition at line 249 of file random_distribution.c.
|
static |
Definition at line 267 of file random_distribution.c.
|
static |
Definition at line 276 of file random_distribution.c.
| distribution distributions[3] |
Definition at line 52 of file random_distribution.c.
Referenced by draw(), init_distributions(), and run_distributions().
| size_t n_steps_base = 524288 |
Definition at line 50 of file random_distribution.c.
Referenced by key_callback(), and run_distributions().
| bj_window* window = 0 |
Definition at line 53 of file random_distribution.c.