You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.0 KiB
30 lines
1.0 KiB
8 years ago
|
#ifndef _WLR_RENDER_H
|
||
|
#define _WLR_RENDER_H
|
||
|
#include <stdint.h>
|
||
|
#include <wayland-server-protocol.h>
|
||
|
|
||
|
struct wlr_surface;
|
||
|
struct wlr_surface *wlr_surface_create();
|
||
|
void wlr_surface_attach_pixels(struct wlr_surface *tex, uint32_t format,
|
||
|
int width, int height, const unsigned char *pixels);
|
||
|
void wlr_surface_attach_shm(struct wlr_surface *tex, uint32_t format,
|
||
|
struct wl_shm_buffer *shm);
|
||
|
// TODO: EGL
|
||
|
void wlr_surface_destroy(struct wlr_surface *tex);
|
||
|
|
||
|
struct wlr_shader;
|
||
|
struct wlr_shader *wlr_shader_init(const char *vertex);
|
||
|
bool wlr_shader_add_format(struct wlr_shader *shader, uint32_t format,
|
||
|
const char *frag);
|
||
|
bool wlr_shader_use(struct wlr_shader *shader, uint32_t format);
|
||
|
void wlr_shader_destroy(struct wlr_shader *shader);
|
||
|
|
||
|
struct wlr_renderer;
|
||
|
struct wlr_renderer *wlr_renderer_init();
|
||
|
void wlr_renderer_set_shader(struct wlr_renderer *renderer,
|
||
|
struct wlr_shader *shader);
|
||
|
bool wlr_render_quad(struct wlr_renderer *renderer, struct wlr_surface *tex,
|
||
|
float x, float y, float width, float height);
|
||
|
|
||
|
#endif
|