Banjo API 1.0.0-rc.2
Low-level C99 game development API
Loading...
Searching...
No Matches
Core
Collaboration diagram for Core:

Topics

 Application
 Main Entry Point

Files

file  assert.h

Data Structures

struct  bj_build_info

Macros

#define BJ_FALSE   ((bj_bool)0)
#define BJ_TRUE   ((bj_bool)1)

Typedefs

typedef uint32_t bj_bool

Functions

const struct bj_build_infobj_build_information (void)

Convenience typedefs for public API types

By default, Banjo provides typedefs that allow writing type names without the struct or enum keywords (e.g., bj_vec2 instead of struct bj_vec2).

To disable these typedefs and use explicit struct/enum keywords everywhere, define BJ_NO_TYPEDEF before including Banjo headers.

typedef struct bj_angular_2d bj_angular_2d
typedef struct bj_cli bj_cli
typedef struct bj_cli_argument bj_cli_argument
typedef struct bj_audio_device bj_audio_device
typedef struct bj_audio_play_note_data bj_audio_play_note_data
typedef struct bj_audio_properties bj_audio_properties
typedef struct bj_bitmap bj_bitmap
typedef struct bj_build_info bj_build_info
typedef struct bj_button_event bj_button_event
typedef struct bj_cursor_event bj_cursor_event
typedef struct bj_enter_event bj_enter_event
typedef struct bj_error bj_error
typedef struct bj_event bj_event
typedef struct bj_key_event bj_key_event
typedef struct bj_mat3x2 bj_mat3x2
typedef struct bj_mat3x3 bj_mat3
typedef struct bj_mat3x3 bj_mat3x3
typedef struct bj_mat4x3 bj_mat4x3
typedef struct bj_mat4x4 bj_mat4
typedef struct bj_mat4x4 bj_mat4x4
typedef struct bj_memory_callbacks bj_memory_callbacks
typedef struct bj_particle_2d bj_particle_2d
typedef struct bj_pcg32 bj_pcg32
typedef struct bj_rect bj_rect
typedef struct bj_render_target bj_render_target
typedef struct bj_rigid_body_2d bj_rigid_body_2d
typedef struct bj_stopwatch bj_stopwatch
typedef struct bj_stream bj_stream
typedef struct bj_vec2 bj_vec2
typedef struct bj_vec3 bj_vec3
typedef struct bj_vec4 bj_quat
typedef struct bj_vec4 bj_vec4
typedef struct bj_window bj_window
typedef struct bj_address bj_address
typedef struct bj_tcp_listener bj_tcp_listener
typedef struct bj_tcp_stream bj_tcp_stream
typedef struct bj_udp bj_udp
typedef struct bj_datagram bj_datagram

Platform detection

One of these will be defined to indicate the target OS.

#define BJ_OS_UNKNOWN

Compiler detection

One of these will be defined to indicate the compiler in use.

Additionally BJ_COMPILER_NAME and BJ_COMPILER_VERSION are provided.

#define BJ_COMPILER_NAME   "Doxygen"
#define BJ_COMPILER_VERSION   0

Build configuration

Exactly one of BJ_BUILD_DEBUG or BJ_BUILD_RELEASE is defined.

#define BJ_BUILD_RELEASE
#define BJ_BUILD_DEBUG

Export/visibility helpers

BANJO_EXPORT marks public symbols.

BANJO_NO_EXPORT hides symbols.

#define BANJO_EXPORT
#define BANJO_NO_EXPORT

Restrict qualifier macro

#define BJ_RESTRICT   restrict

Inline helper macro

#define BJ_INLINE   inline

Detailed Description

General-purpose API.


Data Structure Documentation

◆ bj_build_info

struct bj_build_info

Structure holding build information of the binary.

Examples
banjo-info.c.

Definition at line 278 of file api.h.

Data Fields
bj_bool backend_alsa Built with ALSA audio.
bj_bool backend_cocoa Built with Cocoa/macOS support.
bj_bool backend_emscripten Built with Emscripten support.
bj_bool backend_mme Built with Windows MME audio.
bj_bool backend_wayland Built with Wayland window support.
bj_bool backend_win32 Built with Win32 window support.
bj_bool backend_x11 Built with X11 window support.
bj_bool checks_abort Checks abort execution on failure.
bj_bool checks_log Checks log failures.
const char * compiler_name Compiler name string.
int compiler_version Compiler version number.
bj_bool debug Non-zero if built with debug info.
bj_bool fastmath Built with fast-math optimizations.
bj_bool log_color Colored log output enabled.
const char * name API name (see BJ_NAME).
bj_bool pedantic Extra runtime checks enabled.
const char * variant API name variant (see BJ_NAME_VARIANT).
uint32_t version Packed API version (see BJ_VERSION).

Macro Definition Documentation

◆ BANJO_EXPORT

#define BANJO_EXPORT

Definition at line 163 of file api.h.

Referenced by bj_accept_tcp(), bj_address_count(), bj_address_equals(), bj_address_next(), bj_address_port(), bj_address_reset(), bj_address_string(), bj_allocate_bitmap(), bj_allocate_stream(), bj_app_fixed_step_rate(), bj_app_frame_rate(), bj_apply_angular_torque_2d(), bj_apply_drag_2d(), bj_apply_gravity_2d(), bj_apply_particle_force_2d(), bj_apply_point_gravity_2d(), bj_apply_point_gravity_softened_2d(), bj_apply_rigidbody_force_2d(), bj_assign_bitmap(), bj_audio_playing(), bj_begin(), bj_begin_system(), bj_bernoulli_distribution(), bj_bind_window(), bj_bitmap_height(), bj_bitmap_mode(), bj_bitmap_pixel(), bj_bitmap_pixels(), bj_bitmap_stride(), bj_bitmap_width(), bj_blit(), bj_blit_mask(), bj_blit_mask_stretched(), bj_blit_stretched(), bj_blit_text(), bj_build_information(), bj_calloc(), bj_check_circle_segment_hit(), bj_check_segments_hit(), bj_clear_bitmap(), bj_clear_error(), bj_close_audio_device(), bj_close_datagram(), bj_close_on_escape(), bj_close_stream(), bj_close_tcp_listener(), bj_close_tcp_stream(), bj_close_udp(), bj_compute_bitmap_stride(), bj_compute_kinematics_2d(), bj_compute_kinematics_velocity_2d(), bj_compute_particle_drag_coefficient_2d(), bj_compute_particle_drag_force_2d(), bj_compute_pixel_mode(), bj_connect_tcp(), bj_connect_tcp_to(), bj_convert_bitmap(), bj_copy_bitmap(), bj_copy_error(), bj_create_bitmap(), bj_create_bitmap_from_file(), bj_create_bitmap_from_pixels(), bj_datagram_addr(), bj_datagram_data(), bj_datagram_len(), bj_datagram_port(), bj_destroy_bitmap(), bj_dispatch_event(), bj_dispatch_events(), bj_draw_circle(), bj_draw_filled_circle(), bj_draw_filled_rectangle(), bj_draw_filled_triangle(), bj_draw_line(), bj_draw_polyline(), bj_draw_rectangle(), bj_draw_text(), bj_draw_textf(), bj_draw_triangle(), bj_enable_colorkey(), bj_end(), bj_end_system(), bj_error_code(), bj_error_matches(), bj_error_matches_kind(), bj_error_message(), bj_format_version(), bj_free(), bj_free_address(), bj_get_cli_help_string(), bj_get_key(), bj_get_log_level(), bj_get_log_level_string(), bj_get_pixel_value(), bj_get_stream_length(), bj_get_tcp_keepalive(), bj_get_tcp_recv_timeout(), bj_get_tcp_send_timeout(), bj_get_window_flags(), bj_get_window_size(), bj_init_bitmap(), bj_invalidate_rect(), bj_is_window_fullscreen(), bj_key_name(), bj_library_symbol(), bj_listen_tcp(), bj_load_library(), bj_log_message(), bj_make_bitmap_pixel(), bj_make_bitmap_rgb(), bj_make_pixel_rgb(), bj_malloc(), bj_memcmp(), bj_memcpy(), bj_memmove(), bj_memset(), bj_memzero(), bj_normal_double_distribution(), bj_normal_double_minmax_distribution(), bj_normal_float_distribution(), bj_normal_float_minmax_distribution(), bj_normal_long_double_distribution(), bj_normal_long_double_minmax_distribution(), bj_open_audio_device(), bj_open_stream_file(), bj_open_stream_read(), bj_open_udp(), bj_parse_cli(), bj_pause_audio_device(), bj_play_audio_device(), bj_play_audio_note(), bj_poll_events(), bj_prefix_error(), bj_prefix_error_fmt(), bj_print_cli_help(), bj_print_cli_help_action(), bj_propagate_error(), bj_propagate_prefixed_error(), bj_put_pixel(), bj_quit_app(), bj_read_stream(), bj_realloc(), bj_rect_intersection(), bj_rect_union(), bj_render_target_bitmap(), bj_reset_audio_device(), bj_reset_bitmap(), bj_resolve_address(), bj_run_app(), bj_seek_stream(), bj_set_bitmap_color(), bj_set_button_callback(), bj_set_cursor_callback(), bj_set_draw_callback(), bj_set_enter_callback(), bj_set_error(), bj_set_error_fmt(), bj_set_fixed_step_rate(), bj_set_frame_rate(), bj_set_key_callback(), bj_set_log_level(), bj_set_memory_defaults(), bj_set_resize_callback(), bj_set_tcp_keepalive(), bj_set_tcp_recv_timeout(), bj_set_tcp_send_timeout(), bj_set_window_fullscreen(), bj_set_window_should_close(), bj_shader_bitmap(), bj_should_close_window(), bj_step_angular_2d(), bj_step_particle_2d(), bj_step_rigid_body_2d(), bj_stop_audio_device(), bj_store_cli_bool(), bj_store_cli_cstring(), bj_store_cli_double(), bj_store_cli_int(), bj_store_cli_uint(), bj_tcp_available(), bj_tcp_listener_port(), bj_tcp_local_address(), bj_tcp_peek(), bj_tcp_peer_address(), bj_tcp_recv(), bj_tcp_send(), bj_tcp_shutdown(), bj_tcp_simulate_loss(), bj_tcp_wait(), bj_tell_stream(), bj_udp_available(), bj_udp_local_address(), bj_udp_local_port(), bj_udp_recv(), bj_udp_send(), bj_udp_send_to(), bj_udp_simulate_loss(), bj_udp_wait(), bj_unbind_window(), bj_uniform_double_distribution(), bj_uniform_float_distribution(), bj_uniform_int32_distribution(), bj_uniform_long_double_distribution(), bj_unload_library(), bj_unset_memory_defaults(), bj_validate_cli(), and bj_video_backends().

◆ BANJO_NO_EXPORT

#define BANJO_NO_EXPORT

Definition at line 164 of file api.h.

◆ BJ_BUILD_DEBUG

#define BJ_BUILD_DEBUG

Set when Banjo was built on debug mode (NDEBUG not defined).

Definition at line 154 of file api.h.

◆ BJ_BUILD_RELEASE

#define BJ_BUILD_RELEASE

Set when Banjo was built on release mode (NDEBUG defined).

Definition at line 149 of file api.h.

◆ BJ_COMPILER_NAME

#define BJ_COMPILER_NAME   "Doxygen"

Definition at line 113 of file api.h.

◆ BJ_COMPILER_VERSION

#define BJ_COMPILER_VERSION   0

Definition at line 114 of file api.h.

◆ BJ_FALSE

#define BJ_FALSE   ((bj_bool)0)

Boolean false value (0).

See also
bj_bool
BJ_TRUE

Definition at line 266 of file api.h.

Referenced by bj_mat3_invert(), and bj_mat4_invert().

◆ BJ_INLINE

#define BJ_INLINE   inline

BJ_INLINE expands to an inline specifier appropriate for the toolchain.

If BJ_API_FORCE_INLINE is defined, stronger inlining is requested.

Definition at line 241 of file api.h.

Referenced by bj_galileo_position(), bj_galileo_velocity(), bj_mat3_add(), bj_mat3_col(), bj_mat3_copy(), bj_mat3_determinant(), bj_mat3_from_mat3x2(), bj_mat3_invert(), bj_mat3_invert_unsafe(), bj_mat3_mul(), bj_mat3_mul_scalar(), bj_mat3_row(), bj_mat3_set_identity(), bj_mat3_set_ortho(), bj_mat3_set_rotation_z(), bj_mat3_set_scaling_xy(), bj_mat3_set_shear_xy(), bj_mat3_set_translation(), bj_mat3_set_viewport(), bj_mat3_sub(), bj_mat3_transform_point(), bj_mat3_transform_vec3(), bj_mat3_translate(), bj_mat3_transpose(), bj_mat3x2_from_mat3(), bj_mat3x2_mul(), bj_mat3x2_set_identity(), bj_mat3x2_set_rotation_z(), bj_mat3x2_set_scaling_xy(), bj_mat3x2_set_translation(), bj_mat3x2_transform_dir(), bj_mat3x2_transform_point(), bj_mat4_add(), bj_mat4_col(), bj_mat4_copy(), bj_mat4_from_mat4x3(), bj_mat4_invert(), bj_mat4_invert_unsafe(), bj_mat4_mul(), bj_mat4_mul_scalar(), bj_mat4_orthonormalize(), bj_mat4_rotate_arcball(), bj_mat4_rotate_axis_angle(), bj_mat4_rotate_x(), bj_mat4_rotate_y(), bj_mat4_rotate_z(), bj_mat4_row(), bj_mat4_scale_axes(), bj_mat4_set_frustum(), bj_mat4_set_identity(), bj_mat4_set_lookat(), bj_mat4_set_ortho(), bj_mat4_set_outer_product(), bj_mat4_set_perspective(), bj_mat4_set_translation(), bj_mat4_set_viewport(), bj_mat4_sub(), bj_mat4_transform_vec4(), bj_mat4_translate(), bj_mat4_transpose(), bj_mat4x3_from_mat4(), bj_mat4x3_mul(), bj_mat4x3_set_identity(), bj_mat4x3_set_rotation_x(), bj_mat4x3_set_rotation_y(), bj_mat4x3_set_rotation_z(), bj_mat4x3_set_scaling_xyz(), bj_mat4x3_set_translation(), bj_mat4x3_transform_dir(), bj_mat4x3_transform_point(), bj_newton_gravitation(), bj_newton_plummer_gravitation(), bj_pcg32_generator(), bj_quat_conjugate(), bj_quat_dot(), bj_quat_from_axis_angle(), bj_quat_from_mat4(), bj_quat_identity(), bj_quat_inverse(), bj_quat_mul(), bj_quat_norm(), bj_quat_norm2(), bj_quat_normalize(), bj_quat_rotate_vec3(), bj_quat_rotate_vec4(), bj_quat_slerp(), bj_quat_to_mat4(), bj_vec2_add(), bj_vec2_add_scaled(), bj_vec2_distance(), bj_vec2_distance_sq(), bj_vec2_dot(), bj_vec2_len(), bj_vec2_map(), bj_vec2_max(), bj_vec2_min(), bj_vec2_mul_comp(), bj_vec2_normalize(), bj_vec2_normalize_unsafe(), bj_vec2_perp_dot(), bj_vec2_scale(), bj_vec2_scale_to_len(), bj_vec2_sub(), bj_vec3_add(), bj_vec3_add_scaled(), bj_vec3_cross(), bj_vec3_distance(), bj_vec3_distance_sq(), bj_vec3_dot(), bj_vec3_len(), bj_vec3_map(), bj_vec3_max(), bj_vec3_min(), bj_vec3_normalize(), bj_vec3_normalize_unsafe(), bj_vec3_reflect(), bj_vec3_scale(), bj_vec3_scale_to_len(), bj_vec3_sub(), bj_vec4_add(), bj_vec4_add_scaled(), bj_vec4_cross_xyz(), bj_vec4_dot(), bj_vec4_len(), bj_vec4_map(), bj_vec4_max(), bj_vec4_min(), bj_vec4_normalize(), bj_vec4_normalize_unsafe(), bj_vec4_reflect(), bj_vec4_scale(), and bj_vec4_sub().

◆ BJ_OS_UNKNOWN

#define BJ_OS_UNKNOWN

Definition at line 92 of file api.h.

◆ BJ_RESTRICT

#define BJ_RESTRICT   restrict

BJ_RESTRICT expands to the appropriate restrict qualifier per toolchain.

Definition at line 207 of file api.h.

Referenced by bj_apply_point_gravity_2d(), bj_apply_point_gravity_softened_2d(), bj_mat3_add(), bj_mat3_col(), bj_mat3_copy(), bj_mat3_determinant(), bj_mat3_from_mat3x2(), bj_mat3_invert(), bj_mat3_invert_unsafe(), bj_mat3_mul(), bj_mat3_mul_scalar(), bj_mat3_row(), bj_mat3_set_identity(), bj_mat3_set_ortho(), bj_mat3_set_rotation_z(), bj_mat3_set_scaling_xy(), bj_mat3_set_shear_xy(), bj_mat3_set_translation(), bj_mat3_set_viewport(), bj_mat3_sub(), bj_mat3_transform_point(), bj_mat3_transform_vec3(), bj_mat3_translate(), bj_mat3_transpose(), bj_mat3x2_from_mat3(), bj_mat3x2_mul(), bj_mat3x2_set_identity(), bj_mat3x2_set_rotation_z(), bj_mat3x2_set_scaling_xy(), bj_mat3x2_set_translation(), bj_mat3x2_transform_dir(), bj_mat3x2_transform_point(), bj_mat4_add(), bj_mat4_col(), bj_mat4_copy(), bj_mat4_from_mat4x3(), bj_mat4_invert(), bj_mat4_invert_unsafe(), bj_mat4_mul(), bj_mat4_mul_scalar(), bj_mat4_orthonormalize(), bj_mat4_rotate_arcball(), bj_mat4_row(), bj_mat4_scale_axes(), bj_mat4_set_frustum(), bj_mat4_set_identity(), bj_mat4_set_lookat(), bj_mat4_set_ortho(), bj_mat4_set_outer_product(), bj_mat4_set_perspective(), bj_mat4_set_translation(), bj_mat4_set_viewport(), bj_mat4_sub(), bj_mat4_transform_vec4(), bj_mat4_translate(), bj_mat4_transpose(), bj_mat4x3_from_mat4(), bj_mat4x3_mul(), bj_mat4x3_set_identity(), bj_mat4x3_set_rotation_x(), bj_mat4x3_set_rotation_y(), bj_mat4x3_set_rotation_z(), bj_mat4x3_set_scaling_xyz(), bj_mat4x3_set_translation(), bj_mat4x3_transform_dir(), bj_mat4x3_transform_point(), bj_quat_from_mat4(), and bj_quat_to_mat4().

◆ BJ_TRUE

#define BJ_TRUE   ((bj_bool)1)

Boolean true value (1).

See also
bj_bool
BJ_FALSE
Examples
drawing_2d.c.

Definition at line 275 of file api.h.

Referenced by bj_mat3_invert(), bj_mat4_invert(), and draw().

Typedef Documentation

◆ bj_address

typedef struct bj_address bj_address

Definition at line 355 of file api.h.

◆ bj_angular_2d

typedef struct bj_angular_2d bj_angular_2d

Definition at line 322 of file api.h.

◆ bj_audio_device

Examples
audio_pcm.c.

Definition at line 325 of file api.h.

◆ bj_audio_play_note_data

typedef struct bj_audio_play_note_data bj_audio_play_note_data

Definition at line 326 of file api.h.

◆ bj_audio_properties

typedef struct bj_audio_properties bj_audio_properties

Definition at line 327 of file api.h.

◆ bj_bitmap

◆ bj_bool

typedef uint32_t bj_bool

Boolean type used throughout the Banjo API.

Defined as a 32-bit unsigned integer for portability and ABI clarity.

See also
BJ_FALSE
BJ_TRUE

Definition at line 257 of file api.h.

◆ bj_build_info

typedef struct bj_build_info bj_build_info

Definition at line 329 of file api.h.

◆ bj_button_event

typedef struct bj_button_event bj_button_event

Definition at line 330 of file api.h.

◆ bj_cli

typedef struct bj_cli bj_cli

Definition at line 323 of file api.h.

◆ bj_cli_argument

typedef struct bj_cli_argument bj_cli_argument

Definition at line 324 of file api.h.

◆ bj_cursor_event

typedef struct bj_cursor_event bj_cursor_event

Definition at line 331 of file api.h.

◆ bj_datagram

typedef struct bj_datagram bj_datagram
Examples
net_udp_broadcast_recv.c, net_udp_client.c, and net_udp_server.c.

Definition at line 359 of file api.h.

◆ bj_enter_event

typedef struct bj_enter_event bj_enter_event

Definition at line 332 of file api.h.

◆ bj_error

◆ bj_event

typedef struct bj_event bj_event

Definition at line 334 of file api.h.

◆ bj_key_event

typedef struct bj_key_event bj_key_event

Definition at line 335 of file api.h.

◆ bj_mat3

typedef struct bj_mat3x3 bj_mat3

Definition at line 337 of file api.h.

◆ bj_mat3x2

typedef struct bj_mat3x2 bj_mat3x2

Definition at line 336 of file api.h.

◆ bj_mat3x3

typedef struct bj_mat3x3 bj_mat3x3

Definition at line 338 of file api.h.

◆ bj_mat4

typedef struct bj_mat4x4 bj_mat4

Definition at line 340 of file api.h.

◆ bj_mat4x3

typedef struct bj_mat4x3 bj_mat4x3

Definition at line 339 of file api.h.

◆ bj_mat4x4

typedef struct bj_mat4x4 bj_mat4x4

Definition at line 341 of file api.h.

◆ bj_memory_callbacks

typedef struct bj_memory_callbacks bj_memory_callbacks

Definition at line 342 of file api.h.

◆ bj_particle_2d

typedef struct bj_particle_2d bj_particle_2d

Definition at line 343 of file api.h.

◆ bj_pcg32

typedef struct bj_pcg32 bj_pcg32

Definition at line 344 of file api.h.

◆ bj_quat

typedef struct bj_vec4 bj_quat

Definition at line 352 of file api.h.

◆ bj_rect

typedef struct bj_rect bj_rect

Definition at line 345 of file api.h.

◆ bj_render_target

◆ bj_rigid_body_2d

typedef struct bj_rigid_body_2d bj_rigid_body_2d

Definition at line 347 of file api.h.

◆ bj_stopwatch

typedef struct bj_stopwatch bj_stopwatch

Definition at line 348 of file api.h.

◆ bj_stream

typedef struct bj_stream bj_stream

Definition at line 349 of file api.h.

◆ bj_tcp_listener

Examples
net_tcp_nonblocking.c, net_tcp_server.c, and net_tcp_timeout.c.

Definition at line 356 of file api.h.

◆ bj_tcp_stream

◆ bj_udp

typedef struct bj_udp bj_udp

◆ bj_vec2

typedef struct bj_vec2 bj_vec2

Definition at line 350 of file api.h.

◆ bj_vec3

typedef struct bj_vec3 bj_vec3

Definition at line 351 of file api.h.

◆ bj_vec4

typedef struct bj_vec4 bj_vec4

Definition at line 353 of file api.h.

◆ bj_window

Function Documentation

◆ bj_build_information()

const struct bj_build_info * bj_build_information ( void )

Get runtime build information for the loaded Banjo binaries.

The returned pointer is owned by the library and remains valid for the lifetime of the process. The content is immutable.

Returns
Pointer to a struct bj_build_info structure describing the runtime build.
Examples
banjo-info.c.

Referenced by main().