aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-15 15:31:13 -0400
committerDrew DeVault <sir@cmpwn.com>2017-06-15 15:31:13 -0400
commit2443a070e75e33285b6d5ed0ce89c989956b9065 (patch)
tree1ae59cb449eb6e1dc212e60dbb9d33545735cd6f /include
parent4a9966b1a47d497ccc9473a24ba56b3d0eef72d2 (diff)
Add colored quad and ellipse rendering primitives
Diffstat (limited to 'include')
-rw-r--r--include/render/gles3.h3
-rw-r--r--include/wlr/render.h10
-rw-r--r--include/wlr/render/interface.h4
3 files changed, 17 insertions, 0 deletions
diff --git a/include/render/gles3.h b/include/render/gles3.h
index 5efb197e..9acc1088 100644
--- a/include/render/gles3.h
+++ b/include/render/gles3.h
@@ -13,6 +13,9 @@ struct wlr_surface_state {
struct wlr_surface *gles3_surface_init();
+extern const GLchar quad_vertex_src[];
+extern const GLchar quad_fragment_src[];
+extern const GLchar ellipse_fragment_src[];
extern const GLchar vertex_src[];
extern const GLchar fragment_src_RGB[];
extern const GLchar fragment_src_RGBA[];
diff --git a/include/wlr/render.h b/include/wlr/render.h
index 88aa615e..3c0bd04b 100644
--- a/include/wlr/render.h
+++ b/include/wlr/render.h
@@ -29,6 +29,16 @@ struct wlr_surface *wlr_render_surface_init(struct wlr_renderer *r);
bool wlr_render_with_matrix(struct wlr_renderer *r,
struct wlr_surface *surface, const float (*matrix)[16]);
/**
+ * Renders a solid quad in the specified color.
+ */
+void wlr_render_colored_quad(struct wlr_renderer *r,
+ const float (*color)[4], const float (*matrix)[16]);
+/**
+ * Renders a solid ellipse in the specified color.
+ */
+void wlr_render_colored_ellipse(struct wlr_renderer *r,
+ const float (*color)[4], const float (*matrix)[16]);
+/**
* Destroys this wlr_renderer. Surfaces must be destroyed separately.
*/
void wlr_renderer_destroy(struct wlr_renderer *renderer);
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 80471ac8..a934f49e 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -19,6 +19,10 @@ struct wlr_renderer_impl {
struct wlr_surface *(*surface_init)(struct wlr_renderer_state *state);
bool (*render_with_matrix)(struct wlr_renderer_state *state,
struct wlr_surface *surface, const float (*matrix)[16]);
+ void (*render_quad)(struct wlr_renderer_state *state,
+ const float (*color)[4], const float (*matrix)[16]);
+ void (*render_ellipse)(struct wlr_renderer_state *state,
+ const float (*color)[4], const float (*matrix)[16]);
void (*destroy)(struct wlr_renderer_state *state);
};