#pragma once

#include <stdbool.h>

typedef struct Gfx    Gfx;
typedef struct IsoGfx IsoGfx;

typedef struct IsoBackend IsoBackend;

/// Initialize the backend.
IsoBackend* IsoBackendInit(const IsoGfx*);

/// Shut down the backend.
void IsoBackendShutdown(IsoBackend**);

/// Notify the backend of a window resize event.
/// This allows the backend to determine how to position and scale the iso
/// screen buffer on the graphics window.
void IsoBackendResizeWindow(IsoBackend*, const IsoGfx*, int width, int height);

/// Render the iso screen to the graphics window.
void IsoBackendRender(const IsoBackend*, const IsoGfx*);

/// Map window coordinates to iso space coordinates.
/// This takes into account any possible resizing done by the backend in
/// response to calls to IsoBackendResizeWindow().
bool IsoBackendGetMousePosition(
    const IsoBackend*, double window_x, double window_y, double* x, double* y);