Documentation

peak_init

PEAK int peak_init(void)
Initialize platform context and load necessary DLLs.

peak_quit

PEAK void peak_quit(void)
Close platform context.

peak_window_open

PEAK PeakWindow peak_window_open(const char *name, uint32_t width, uint32_t height, uint32_t flags)
Open a window.

peak_window_close

PEAK void peak_window_close(PeakWindow *window)
Close a window.

peak_window_run

PEAK void peak_window_run(PeakWindow *win, int (*peak_tick)(PeakWindow *win, void *userdata), void *userdata)
Hijacking the main loop makes life easier on platforms like web

peak_window_epoll

PEAK int peak_window_epoll(PeakWindow *win, PeakEvent *ev)
Poll a window for events.

peak_window_backbuffer

PEAK uint32_t* peak_window_backbuffer(PeakWindow *win, size_t *width, size_t *height)
Get the windows backbuffer.

peak_window_clear

PEAK void peak_window_clear(PeakWindow *win, float r, float g, float b, float a)
Clear window to color.

peak_window_present

PEAK void peak_window_present(PeakWindow *win)
Present window backbuffer.

peak_audio_start

PEAK int peak_audio_start(uint32_t channels, uint32_t rate, void (*fill)(int16_t *out, size_t frames, void *userdata), void *userdata)
Device pulls interleaved s16le

peak_audio_stop

PEAK void peak_audio_stop(void)
Stop audio.

peak_get_time

PEAK uint64_t peak_get_time(void)
Get time in nanoseconds.

peak_sleep_ns

PEAK void peak_sleep_ns(int64_t ns)
Sleep for nanoseconds!!!

peak_file_exists

PEAK int peak_file_exists(const char *path)
Does this file exist?

peak_file_alloc

PEAK void *peak_file_alloc(const char *path, unsigned long *buf_size)
Allocate an entire file.

peak_vulkan_get_extensions

PEAK const char **peak_vulkan_get_extensions(uint32_t *count)
Get vulkan extensions.

peak_vulkan_create_surface

PEAK int peak_vulkan_create_surface(PeakWindow *win, void *instance, const void *allocator, void *out_surface)
Create a vulkan surface for a window. Needs PEAK_VULKAN.

peak_log_printf

PEAK void peak_log_printf(PeakLogLevel level, const char *src, ...)
Printf with log level.

peak_debug_malloc_impl

PEAK void *peak_debug_malloc_impl(size_t size, const char *file, int line, const char *func)
Malloc for debuggin.

peak_debug_free_impl

PEAK void peak_debug_free_impl(void *ptr, const char *file, int line, const char *func)
Free for debugging.

peak_debug_realloc_impl

PEAK void *peak_debug_realloc_impl(void *ptr, size_t size, const char *file, int line, const char *func)
Realloc for debugging.

peak_debug_memory_report

PEAK void peak_debug_memory_report(void)
Report memory.