- The renderer backend is now its own library, loaded at runtime. - Removed GLFW dependency, instead use win32 directly. - Broke linux window creation, because it's not implemented yet. - Maybe use GLFW for linux?
54 lines
1.2 KiB
C
54 lines
1.2 KiB
C
#ifndef VY_GFX_BACKEND_H
|
|
#define VY_GFX_BACKEND_H
|
|
|
|
/* Backend functions and types. */
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "gfx.h"
|
|
|
|
#ifdef _WIN32
|
|
struct HINSTANCE__;
|
|
struct HWND__;
|
|
#endif
|
|
|
|
struct vy_renderer_init_info_s {
|
|
#ifdef _WIN32
|
|
struct HINSTANCE__ *hInstance;
|
|
struct HWND__ *hWnd;
|
|
#endif
|
|
};
|
|
|
|
typedef struct {
|
|
const char *compute_source;
|
|
size_t compute_source_length;
|
|
} vy_compute_pipeline_info;
|
|
|
|
typedef struct {
|
|
const char *vertex_source;
|
|
size_t vertex_source_length;
|
|
|
|
const char *fragment_source;
|
|
size_t fragment_source_length;
|
|
} vy_graphics_pipeline_info;
|
|
|
|
typedef int vy_init_renderer_fn(const vy_renderer_init_info *info);
|
|
typedef void vy_shutdown_renderer_fn(void);
|
|
typedef vy_gfx_pipeline_id
|
|
vy_compile_compute_pipeline_fn(const vy_compute_pipeline_info *info);
|
|
typedef vy_gfx_pipeline_id
|
|
vy_compile_graphics_pipeline_fn(const vy_graphics_pipeline_info *info);
|
|
|
|
typedef struct {
|
|
vy_init_renderer_fn *Init;
|
|
vy_shutdown_renderer_fn *Shutdown;
|
|
vy_compile_compute_pipeline_fn *CompileComputePipeline;
|
|
vy_compile_graphics_pipeline_fn *CompileGraphicsPipeline;
|
|
} vy_renderer_api;
|
|
|
|
#ifndef VY_DONT_DEFINE_RENDERER_GLOBAL
|
|
extern vy_renderer_api g_renderer;
|
|
#endif
|
|
|
|
#endif
|