#pragma once

#include "pxl8_types.h"

typedef struct pxl8_hal {
    void* (*create)(i32 render_w, i32 render_h,
                    const char* title, i32 win_w, i32 win_h);
    void (*destroy)(void* platform_data);
    u64 (*get_ticks)(void);
    void (*center_cursor)(void* platform_data);
    void (*present)(void* platform_data);
    void (*set_cursor)(void* platform_data, u32 cursor);
    void (*set_relative_mouse_mode)(void* platform_data, bool enabled);
    void (*upload_texture)(void* platform_data, const void* pixels, u32 w, u32 h,
                           u32 bpp, const u32* palette);

    void* (*audio_create)(i32 sample_rate, i32 channels);
    void (*audio_destroy)(void* audio_handle);
    void (*audio_start)(void* audio_handle);
    void (*audio_stop)(void* audio_handle);
    bool (*upload_audio)(void* audio_handle, const f32* stereo_samples, i32 sample_count);
    i32 (*audio_queued)(void* audio_handle);
} pxl8_hal;
