#ifndef RT_RENCOM_RENDERER_API_H
#define RT_RENCOM_RENDERER_API_H

#include "runtime/runtime.h"

/* Defines the outward facing renderer api */

#ifdef _WIN32
struct HINSTANCE__;
struct HWND__;
#elif defined(RT_USE_XLIB)
struct _XDisplay;
#endif

/* Platform specific init info for the renderer */
typedef struct {
#ifdef _WIN32
    struct HINSTANCE__ *hInstance;
    struct HWND__ *hWnd;
#elif defined(RT_USE_XLIB)
    struct _XDisplay *display;
    unsigned long window;
#endif

    unsigned int width;
    unsigned int height;
    int is_fullscreen;
} rt_renderer_init_info;

typedef rt_result rt_renderer_init_fn(const rt_renderer_init_info *info);
typedef void rt_renderer_shutdown_fn(void);

typedef enum {
    RT_SHADER_STAGE_VERTEX,
    RT_SHADER_STAGE_FRAGMENT,
    RT_SHADER_STAGE_COMPUTE,
} rt_shader_stage;


/* Public renderer interface */
typedef struct {
    rt_renderer_init_fn *Init;
    rt_renderer_shutdown_fn *Shutdown;
} rt_renderer_api;


/* Global renderer object */
RT_DLLIMPORT extern rt_renderer_api g_renderer;

RT_DLLEXPORT rt_result rtLoadRenderer(void);

#endif
