|
Banjo API 1.0.0-rc.2
Low-level C99 game development API
|
#include <banjo/app.h>#include <banjo/main.h>#include <banjo/assert.h>#include <banjo/bitmap.h>#include <banjo/draw.h>#include <banjo/event.h>#include <banjo/log.h>#include <banjo/mat.h>#include <banjo/physics.h>#include <banjo/physics_2d.h>#include <banjo/pixel.h>#include <banjo/system.h>#include <banjo/time.h>#include <banjo/vec.h>#include <banjo/window.h>#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | planet_t |
Macros | |
| #define | SCREEN_WIDTH 800 |
| #define | SCREEN_HEIGHT 600 |
| #define | CANVAS_WIDTH SCREEN_WIDTH |
| #define | CANVAS_HEIGHT SCREEN_HEIGHT |
| #define | FB_PIXEL_MODE BJ_PIXEL_MODE_XRGB8888 |
| #define | G_SUN BJ_F(120.0) |
| #define | SOFTENING BJ_F(6.0) |
| #define | M_SUN BJ_F(1000.0) |
| #define | M_MERCURY BJ_F(0.055) |
| #define | M_VENUS BJ_F(0.815) |
| #define | M_EARTH BJ_F(1.0) |
| #define | M_MARS BJ_F(0.107) |
| #define | M_JUPITER BJ_F(317.8) |
| #define | N_PLANETS 5 |
| #define | N_ASTEROIDS 800 |
Functions | |
| static void | on_draw (struct bj_window *, struct bj_render_target *, const struct bj_rect *, void *) |
| static void | update_projection () |
| static bj_real | orbital_speed_soft (bj_real G, bj_real M, bj_real r, bj_real eps) |
| static void | init_sun () |
| static void | init_planet (planet_t *p, bj_real r, bj_real mass, uint32_t color, bj_real draw_r, bj_real phase) |
| static void | init_asteroids () |
| static void | initialize () |
| static void | physics (bj_real dt) |
| static void | draw (bj_bitmap *framebuffer) |
| static void * | setup (struct bj_app *app, void *init_data) |
| static void | fixed_step (struct bj_app *app, struct bj_tick_info tick, void *user_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_window * | window = 0 |
| bj_mat3x3 | projection |
| planet_t | planets [5] |
| bj_particle_2d | sun = {0} |
| bj_particle_2d | asteroids [800] |
| uint32_t | asteroid_color |
| struct planet_t |
Definition at line 66 of file physics_particle.c.
| Data Fields | ||
|---|---|---|
| bj_particle_2d | body | |
| uint32_t | color | |
| bj_real | radius | |
| #define CANVAS_HEIGHT SCREEN_HEIGHT |
Definition at line 40 of file physics_particle.c.
Referenced by update_projection().
| #define CANVAS_WIDTH SCREEN_WIDTH |
Definition at line 39 of file physics_particle.c.
Referenced by update_projection().
| #define FB_PIXEL_MODE BJ_PIXEL_MODE_XRGB8888 |
Definition at line 42 of file physics_particle.c.
| #define G_SUN BJ_F(120.0) |
Definition at line 54 of file physics_particle.c.
Referenced by init_asteroids(), init_planet(), and physics().
| #define M_EARTH BJ_F(1.0) |
Definition at line 59 of file physics_particle.c.
Referenced by initialize().
| #define M_JUPITER BJ_F(317.8) |
Definition at line 61 of file physics_particle.c.
Referenced by initialize().
| #define M_MARS BJ_F(0.107) |
Definition at line 60 of file physics_particle.c.
Referenced by initialize().
| #define M_MERCURY BJ_F(0.055) |
Definition at line 57 of file physics_particle.c.
Referenced by initialize().
| #define M_SUN BJ_F(1000.0) |
Definition at line 56 of file physics_particle.c.
Referenced by init_asteroids(), init_planet(), and init_sun().
| #define M_VENUS BJ_F(0.815) |
Definition at line 58 of file physics_particle.c.
Referenced by initialize().
| #define N_ASTEROIDS 800 |
Definition at line 76 of file physics_particle.c.
Referenced by draw(), init_asteroids(), and physics().
| #define N_PLANETS 5 |
Definition at line 72 of file physics_particle.c.
| #define SCREEN_HEIGHT 600 |
Definition at line 38 of file physics_particle.c.
| #define SCREEN_WIDTH 800 |
Definition at line 37 of file physics_particle.c.
| #define SOFTENING BJ_F(6.0) |
Definition at line 55 of file physics_particle.c.
Referenced by init_asteroids(), init_planet(), and physics().
|
static |
Definition at line 194 of file physics_particle.c.
|
static |
Definition at line 257 of file physics_particle.c.
|
static |
Definition at line 125 of file physics_particle.c.
Referenced by initialize().
|
static |
Definition at line 108 of file physics_particle.c.
Referenced by initialize().
|
static |
Definition at line 97 of file physics_particle.c.
Referenced by initialize().
|
static |
Definition at line 147 of file physics_particle.c.
Referenced by setup().
| int main | ( | int | argc, |
| char * | argv[] ) |
Definition at line 278 of file physics_particle.c.
|
static |
Definition at line 238 of file physics_particle.c.
Definition at line 91 of file physics_particle.c.
Referenced by init_asteroids(), and init_planet().
|
static |
Definition at line 183 of file physics_particle.c.
Referenced by fixed_step().
|
static |
Definition at line 216 of file physics_particle.c.
|
static |
Definition at line 262 of file physics_particle.c.
|
static |
Definition at line 272 of file physics_particle.c.
|
static |
Definition at line 80 of file physics_particle.c.
Referenced by setup().
| uint32_t asteroid_color |
Definition at line 78 of file physics_particle.c.
Referenced by draw(), and init_asteroids().
| bj_particle_2d asteroids[800] |
Definition at line 77 of file physics_particle.c.
Referenced by draw(), init_asteroids(), and physics().
| planet_t planets[5] |
Definition at line 73 of file physics_particle.c.
Referenced by draw(), initialize(), and physics().
| bj_mat3x3 projection |
Definition at line 45 of file physics_particle.c.
Referenced by draw(), and update_projection().
| bj_particle_2d sun = {0} |
Definition at line 74 of file physics_particle.c.
Referenced by draw(), init_sun(), and physics().
| bj_window* window = 0 |
Definition at line 44 of file physics_particle.c.