Banjo API 1.0.0-rc.2
Low-level C99 game development API
Loading...
Searching...
No Matches
template.c
Go to the documentation of this file.
1
9
10#include <banjo/log.h> // Logging: bj_info, bj_warn, bj_error, bj_debug
11#include <banjo/main.h> // Lifecycle: bj_begin, bj_end
12#include <banjo/system.h> // Subsystem flags: BJ_VIDEO_SYSTEM, BJ_AUDIO_SYSTEM
13
14int main(int argc, char* argv[]) {
15 (void)argc;
16 (void)argv;
17
18 // Initialise Banjo subsystems. Choose what you need:
19 // BJ_VIDEO_SYSTEM - windows, rendering, events
20 // BJ_AUDIO_SYSTEM - audio playback
21 // Returns false on failure (unsupported platform, insufficient resources).
23 return 1;
24 }
25
26 // With Banjo initialised, use its features. Here we just log a message.
27 bj_info("Hello Banjo!");
28
29 // Always cleanup before exit to release all Banjo resources.
30 bj_end();
31 return 0;
32}
int main(int argc, char *argv[])
Definition audio_pcm.c:177
#define bj_info(...)
Log a message using the BJ_LOG_INFO level.
Definition log.h:141
bj_bool bj_begin(int systems, struct bj_error **error)
Initialises the system.
void bj_end(void)
De-initialises the system.
@ BJ_VIDEO_SYSTEM
Definition system.h:81
@ BJ_AUDIO_SYSTEM
Definition system.h:80
Logging utility functions.
Portable main() replacement with platform-aware entry shim.
Header file for system interactions.