42 lines
936 B
C
42 lines
936 B
C
#ifndef __VHEX_DISPLAY_SHADER__
|
|
# define __VHEX_DISPLAY_SHADER__
|
|
|
|
#include <vhex/defs/attributes.h>
|
|
#include <vhex/defs/types.h>
|
|
|
|
/* dshader_surface - Describe the surface */
|
|
struct dshader_surface {
|
|
void *draw;
|
|
void *frag;
|
|
size_t width;
|
|
size_t height;
|
|
int x1;
|
|
int y1;
|
|
int x2;
|
|
int y2;
|
|
};
|
|
typedef struct dshader_surface dsurface_t;
|
|
|
|
/* dshader - display shader definition */
|
|
struct dshader_call {
|
|
int (*routine)(
|
|
struct dshader_surface *surface,
|
|
uint32_t *draw_args,
|
|
uint32_t *shader_args
|
|
);
|
|
uint32_t args[8];
|
|
};
|
|
typedef struct dshader_call dshader_call_t;
|
|
typedef struct dshader_call dshader_t;
|
|
|
|
/* DSHADER_LIST - helper to create a list of shader "on-the-fly" */
|
|
#define DSHADER_LIST(shader_list) (dshader_call_t*)&{ shader_list }
|
|
|
|
/* DSHADER - helper to create a shader object */
|
|
#define DSHADER(fct, ...) (dshader_call_t){ \
|
|
.routine = fct, \
|
|
.args = { __VA_ARGS__ } \
|
|
}
|
|
|
|
#endif /* __VHEX_DISPLAY_SHADER__ */
|