20#define BJ_VERSION_RELEASE 0
21#define BJ_VERSION_DEV 1
22#define BJ_VERSION_BETA 2
23#define BJ_VERSION_RC 3
29#define BJ_VERSION_VARIANT(version) ((version) & 0x3U)
34#define BJ_VERSION_MAJOR(version) (((version) >> 22U) & 0x3FFU)
39#define BJ_VERSION_MINOR(version) (((version) >> 12U) & 0x3FFU)
44#define BJ_VERSION_PATCH(version) (((version) >> 2U) & 0x3FFU)
52#define BJ_MAKE_VERSION(major, minor, patch, variant) \
53 ((((uint32_t)(major)) << 22U) | (((uint32_t)(minor)) << 12U) | \
54 (((uint32_t)(patch)) << 2U) | ((uint32_t)(variant)))
56#define BJ_VERSION_MAJOR_NUMBER 0
57#define BJ_VERSION_MINOR_NUMBER 1
58#define BJ_VERSION_PATCH_NUMBER 0
59#define BJ_VERSION_VARIANT_NUMBER BJ_VERSION_DEV
62#define BJ_VERSION BJ_MAKE_VERSION(BJ_VERSION_MAJOR_NUMBER, BJ_VERSION_MINOR_NUMBER, BJ_VERSION_PATCH_NUMBER, BJ_VERSION_VARIANT_NUMBER)
65#define BJ_NAME "Banjo"
70#if defined(__EMSCRIPTEN__)
71# define BJ_OS_EMSCRIPTEN
72#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
74#elif defined(__linux__) || defined(__gnu_linux__)
78# include <TargetConditionals.h>
81# elif TARGET_IPHONE_SIMULATOR
83# define BJ_OS_IOS_SIMULATOR
88# define BJ_OS_APPLE_UNKNOWN
104#if defined(BJ_COMPILER_DOXYGEN)
105# define BJ_COMPILER_NAME "Doxygen"
106# define BJ_COMPILER_VERSION 0
107#elif defined(__EMSCRIPTEN__)
108# include <emscripten/version.h>
109# define BJ_COMPILER_EMSCRIPTEN
110# define BJ_COMPILER_NAME "Emscripten"
111# define BJ_COMPILER_VERSION __EMSCRIPTEN_major__
112#elif defined(__GNUC__) && !defined(__clang__)
113# define BJ_COMPILER_GCC
114# define BJ_COMPILER_NAME "GCC"
115# define BJ_COMPILER_VERSION __GNUC__
116#elif defined(__clang__)
117# define BJ_COMPILER_CLANG
118# define BJ_COMPILER_NAME "Clang"
119# define BJ_COMPILER_VERSION __clang_major__
120#elif defined(_MSC_VER)
121# define BJ_COMPILER_MSVC
122# define BJ_COMPILER_NAME "MSVC"
123# define BJ_COMPILER_VERSION _MSC_VER
124#elif defined(__MINGW32__)
125# define BJ_COMPILER_MINGW
126# define BJ_COMPILER_NAME "MinGW"
127# define BJ_COMPILER_VERSION 0
129# define BJ_COMPILER_UNKNOWN
130# define BJ_COMPILER_NAME "Unknown"
131# define BJ_COMPILER_VERSION 0
140#if defined(NDEBUG) || defined(BJ_COMPILER_DOXYGEN)
141# define BJ_BUILD_RELEASE
145#if !defined(NDEBUG) || defined(BJ_COMPILER_DOXYGEN)
146# define BJ_BUILD_DEBUG
154#if defined(BANJO_STATIC) || defined(BJ_COMPILER_DOXYGEN)
156# define BANJO_NO_EXPORT
161# define BANJO_EXPORT __declspec(dllexport)
163# define BANJO_EXPORT __declspec( dllexport )
166# ifndef BANJO_NO_EXPORT
167# define BANJO_NO_EXPORT
172# define BANJO_EXPORT __attribute__((visibility("default")))
174# define BANJO_EXPORT __attribute__((visibility("default")))
177# ifndef BANJO_NO_EXPORT
178# define BANJO_NO_EXPORT __attribute__((visibility("hidden")))
188#if defined(__cplusplus)
189 #if defined(__GNUC__) || defined(__clang__)
190 #define BJ_RESTRICT __restrict__
191 #elif defined(_MSC_VER)
192 #define BJ_RESTRICT __restrict
198 #if defined(BJ_COMPILER_DOXYGEN) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
199 #define BJ_RESTRICT restrict
200 #elif defined(__GNUC__) || defined(__clang__)
201 #define BJ_RESTRICT __restrict__
202 #elif defined(_MSC_VER)
203 #define BJ_RESTRICT __restrict
216 #if defined(BJ_API_FORCE_INLINE)
217 #define BJ_INLINE __forceinline
219 #if !defined(__cplusplus) && !defined(inline)
220 #define BJ_INLINE __inline
222 #define BJ_INLINE inline
225#elif defined(__GNUC__) || defined(__clang__)
226 #if defined(BJ_API_FORCE_INLINE)
227 #define BJ_INLINE inline __attribute__((always_inline))
229 #define BJ_INLINE inline
232 #if defined(BJ_COMPILER_DOXYGEN) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
233 #define BJ_INLINE inline
258#define BJ_FALSE ((bj_bool)0)
267#define BJ_TRUE ((bj_bool)1)
bj_audio_format
Audio sample format descriptor.
Definition audio.h:51
Describe properties of an audio device.
Definition audio.h:105
bj_blit_op
Raster operation (ROP) to apply during blitting.
Definition bitmap.h:48
Parser context and argument list descriptor.
Definition cli.h:161
Descriptor for a single command line argument.
Definition cli.h:139
bj_bool checks_log
Checks log failures.
Definition api.h:283
const char * name
API name (see BJ_NAME).
Definition api.h:271
bj_bool pedantic
Extra runtime checks enabled.
Definition api.h:286
uint32_t version
Packed API version (see BJ_VERSION).
Definition api.h:272
bj_bool log_color
Colored log output enabled.
Definition api.h:285
bj_bool backend_win32
Built with Win32 window support.
Definition api.h:280
bj_bool backend_alsa
Built with ALSA audio.
Definition api.h:276
bj_bool fastmath
Built with fast-math optimizations.
Definition api.h:284
const char * compiler_name
Compiler name string.
Definition api.h:273
bj_bool backend_x11
Built with X11 window support.
Definition api.h:281
bj_bool backend_emscripten
Built with Emscripten support.
Definition api.h:278
bj_bool debug
Non-zero if built with debug info.
Definition api.h:275
bj_bool backend_cocoa
Built with Cocoa/macOS support.
Definition api.h:277
bj_bool checks_abort
Checks abort execution on failure.
Definition api.h:282
int compiler_version
Compiler version number.
Definition api.h:274
bj_bool backend_mme
Built with Windows MME audio.
Definition api.h:279
struct bj_mat3x3 bj_mat3
Definition api.h:340
enum bj_callback_result bj_callback_result
Definition api.h:314
struct bj_stream bj_stream
Definition api.h:352
#define BANJO_EXPORT
Definition api.h:155
uint32_t bj_bool
Boolean type used throughout the Banjo API.
Definition api.h:249
struct bj_bitmap bj_bitmap
Definition api.h:331
struct bj_renderer bj_renderer
Definition api.h:349
struct bj_window bj_window
Definition api.h:357
struct bj_vec4 bj_quat
Definition api.h:355
struct bj_audio_device bj_audio_device
Definition api.h:328
struct bj_mat4x4 bj_mat4
Definition api.h:343
const struct bj_build_info * bj_build_information(void)
Get runtime build information for the loaded Banjo binaries.
Structure holding build information of the binary.
Definition api.h:270
bj_error_code
A numeric representation of an error in Banjo.
Definition error.h:70
Error structure.
Definition error.h:131
bj_key
List of possible keys on a keyboard.
Definition event.h:57
bj_event_type
Identify the type of a generic event.
Definition event.h:339
bj_event_action
Define event action types for keys or mouse buttons.
Definition event.h:294
Represent a mouse cursor movement event.
Definition event.h:312
Represent a mouse enter or leave event.
Definition event.h:303
Represent a generic window-related event.
Definition event.h:351
Represent a keyboard key event.
Definition event.h:330
bj_log_level
Log Levels.
Definition log.h:30
struct bj_mat3x2: 3×2 column-major matrix backed by struct bj_vec2.
Definition mat.h:35
struct bj_mat4x3: 4×3 column-major matrix backed by struct bj_vec3.
Definition mat.h:53
struct bj_mat4x4: 4×4 column-major matrix backed by struct bj_vec4.
Definition mat.h:43
Represents a rectangle with position and dimensions.
Definition rect.h:19
struct bj_vec2: 2D vector of bj_real values.
Definition vec.h:26
struct bj_vec3: 3D vector of bj_real values.
Definition vec.h:38
struct bj_vec4: 4D vector of bj_real values.
Definition vec.h:51
Custom allocation callbacks.
Definition memory.h:71
Angular.
Definition physics_2d.h:226
2D point mass state and physical properties.
Definition physics_2d.h:78
Rigid body with translational and angular components.
Definition physics_2d.h:268
bj_pixel_mode
Representation of a pixel encoding.
Definition pixel.h:16
PCG32 generator state.
Definition random.h:46
bj_renderer_type
Renderer backend type.
Definition renderer.h:33
bj_shader_flag
Shader input control flags.
Definition shader.h:52
bj_seek_origin
Position in a bj_stream to use for origin.
Definition stream.h:22
Structure representing a simple stopwatch.
Definition time.h:97
bj_window_flag
A set of flags describing some properties of a bj_window.
Definition window.h:44
Define parameters for generating simple waveforms.
Definition audio.h:251