Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
Core
Collaboration diagram for Core:

Topics

 Main Entry Point

Files

file  assert.h

Data Structures

struct  bj_build_info

Macros

#define BJ_VERSION_VARIANT(version)
#define BJ_VERSION_MAJOR(version)
#define BJ_VERSION_MINOR(version)
#define BJ_VERSION_PATCH(version)
#define BJ_MAKE_VERSION(major, minor, patch, variant)
#define BJ_VERSION_MAJOR_NUMBER   0
#define BJ_VERSION_MINOR_NUMBER   1
#define BJ_VERSION_PATCH_NUMBER   0
#define BJ_VERSION_VARIANT_NUMBER   BJ_VERSION_DEV
#define BJ_VERSION   BJ_MAKE_VERSION(BJ_VERSION_MAJOR_NUMBER, BJ_VERSION_MINOR_NUMBER, BJ_VERSION_PATCH_NUMBER, BJ_VERSION_VARIANT_NUMBER)
#define BJ_NAME   "Banjo"
#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 enum bj_audio_format bj_audio_format
typedef enum bj_blit_op bj_blit_op
typedef enum bj_callback_result bj_callback_result
typedef enum bj_error_code bj_error_code
typedef enum bj_event_action bj_event_action
typedef enum bj_event_type bj_event_type
typedef enum bj_key bj_key
typedef enum bj_log_level bj_log_level
typedef enum bj_pixel_mode bj_pixel_mode
typedef enum bj_renderer_type bj_renderer_type
typedef enum bj_seek_origin bj_seek_origin
typedef enum bj_shader_flag bj_shader_flag
typedef enum bj_window_flag bj_window_flag
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_renderer bj_renderer
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
#define BJ_VERSION_RELEASE   0
#define BJ_VERSION_DEV   1
#define BJ_VERSION_BETA   2
#define BJ_VERSION_RC   3

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.

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_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.
uint32_t version Packed API version (see BJ_VERSION).

Macro Definition Documentation

◆ BANJO_EXPORT

#define BANJO_EXPORT

◆ BANJO_NO_EXPORT

#define BANJO_NO_EXPORT

◆ BJ_BUILD_DEBUG

#define BJ_BUILD_DEBUG

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

◆ BJ_BUILD_RELEASE

#define BJ_BUILD_RELEASE

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

◆ BJ_COMPILER_NAME

#define BJ_COMPILER_NAME   "Doxygen"

◆ BJ_COMPILER_VERSION

#define BJ_COMPILER_VERSION   0

◆ BJ_FALSE

#define BJ_FALSE   ((bj_bool)0)

Boolean false value (0).

See also
bj_bool
BJ_TRUE

◆ 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.

◆ BJ_MAKE_VERSION

#define BJ_MAKE_VERSION ( major,
minor,
patch,
variant )
Value:
((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | \
(((uint32_t)(patch)) << 2U) | ((uint32_t)(variant)))

Construct a packed 32-bit version value: [major:10 | minor:10 | patch:10 | variant:2].

Parameters
majorMajor version in [0, 1023].
minorMinor version in [0, 1023].
patchPatch version in [0, 1023].
variantVariant type (BJ_VERSION_VARIANT_*).
Returns
Packed version suitable for BJ_VERSION_* macros.

◆ BJ_NAME

#define BJ_NAME   "Banjo"

Library name string.

◆ BJ_OS_UNKNOWN

#define BJ_OS_UNKNOWN

◆ BJ_RESTRICT

#define BJ_RESTRICT   restrict

BJ_RESTRICT expands to the appropriate restrict qualifier per toolchain.

◆ BJ_TRUE

#define BJ_TRUE   ((bj_bool)1)

Boolean true value (1).

See also
bj_bool
BJ_FALSE

◆ BJ_VERSION

Current API version as a packed 32-bit representation.

◆ BJ_VERSION_BETA

#define BJ_VERSION_BETA   2

Beta release (e.g., 0.1.0-beta).

◆ BJ_VERSION_DEV

#define BJ_VERSION_DEV   1

Development build (e.g., 0.1.0-dev).

◆ BJ_VERSION_MAJOR

#define BJ_VERSION_MAJOR ( version)
Value:
(((version) >> 22U) & 0x3FFU)

Extract major version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Major version in [0, 1023].

◆ BJ_VERSION_MAJOR_NUMBER

#define BJ_VERSION_MAJOR_NUMBER   0

Current major version number.

◆ BJ_VERSION_MINOR

#define BJ_VERSION_MINOR ( version)
Value:
(((version) >> 12U) & 0x3FFU)

Extract minor version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Minor version in [0, 1023].

◆ BJ_VERSION_MINOR_NUMBER

#define BJ_VERSION_MINOR_NUMBER   1

Current minor version number.

◆ BJ_VERSION_PATCH

#define BJ_VERSION_PATCH ( version)
Value:
(((version) >> 2U) & 0x3FFU)

Extract patch version from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Patch version in [0, 1023].

◆ BJ_VERSION_PATCH_NUMBER

#define BJ_VERSION_PATCH_NUMBER   0

Current patch version number.

◆ BJ_VERSION_RC

#define BJ_VERSION_RC   3

Release candidate (e.g., 0.1.0-rc).

◆ BJ_VERSION_RELEASE

#define BJ_VERSION_RELEASE   0

Version variant types.

Stable release (e.g., 0.1.0).

◆ BJ_VERSION_VARIANT

#define BJ_VERSION_VARIANT ( version)
Value:
((version) & 0x3U)

Extract variant from a 32-bit version value.

Parameters
versionPacked version from BJ_MAKE_VERSION.
Returns
Variant in [0, 3].

◆ BJ_VERSION_VARIANT_NUMBER

#define BJ_VERSION_VARIANT_NUMBER   BJ_VERSION_DEV

Current version variant.

Typedef Documentation

◆ bj_angular_2d

typedef struct bj_angular_2d bj_angular_2d

◆ bj_audio_device

◆ bj_audio_format

◆ bj_audio_play_note_data

typedef struct bj_audio_play_note_data bj_audio_play_note_data

◆ bj_audio_properties

typedef struct bj_audio_properties bj_audio_properties

◆ bj_bitmap

typedef struct bj_bitmap bj_bitmap

◆ bj_blit_op

typedef enum bj_blit_op bj_blit_op

◆ 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

◆ bj_build_info

typedef struct bj_build_info bj_build_info

◆ bj_button_event

typedef struct bj_button_event bj_button_event

◆ bj_callback_result

◆ bj_cli

typedef struct bj_cli bj_cli

◆ bj_cli_argument

typedef struct bj_cli_argument bj_cli_argument

◆ bj_cursor_event

typedef struct bj_cursor_event bj_cursor_event

◆ bj_enter_event

typedef struct bj_enter_event bj_enter_event

◆ bj_error

typedef struct bj_error bj_error

◆ bj_error_code

◆ bj_event

typedef struct bj_event bj_event

◆ bj_event_action

◆ bj_event_type

◆ bj_key

typedef enum bj_key bj_key

◆ bj_key_event

typedef struct bj_key_event bj_key_event

◆ bj_log_level

typedef enum bj_log_level bj_log_level

◆ bj_mat3

typedef struct bj_mat3x3 bj_mat3

◆ bj_mat3x2

typedef struct bj_mat3x2 bj_mat3x2

◆ bj_mat3x3

typedef struct bj_mat3x3 bj_mat3x3

◆ bj_mat4

typedef struct bj_mat4x4 bj_mat4

◆ bj_mat4x3

typedef struct bj_mat4x3 bj_mat4x3

◆ bj_mat4x4

typedef struct bj_mat4x4 bj_mat4x4

◆ bj_memory_callbacks

typedef struct bj_memory_callbacks bj_memory_callbacks

◆ bj_particle_2d

typedef struct bj_particle_2d bj_particle_2d

◆ bj_pcg32

typedef struct bj_pcg32 bj_pcg32

◆ bj_pixel_mode

◆ bj_quat

typedef struct bj_vec4 bj_quat

◆ bj_rect

typedef struct bj_rect bj_rect

◆ bj_renderer

typedef struct bj_renderer bj_renderer

◆ bj_renderer_type

◆ bj_rigid_body_2d

typedef struct bj_rigid_body_2d bj_rigid_body_2d

◆ bj_seek_origin

◆ bj_shader_flag

◆ bj_stopwatch

typedef struct bj_stopwatch bj_stopwatch

◆ bj_stream

typedef struct bj_stream bj_stream

◆ bj_vec2

typedef struct bj_vec2 bj_vec2

◆ bj_vec3

typedef struct bj_vec3 bj_vec3

◆ bj_vec4

typedef struct bj_vec4 bj_vec4

◆ bj_window

typedef struct bj_window bj_window

◆ bj_window_flag

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.