summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-11-09 13:38:36 -0800
committerVito Caputo <vcaputo@pengaru.com>2022-11-10 09:11:47 -0800
commitaa20a9ec8697a05d44e949ad6a1f2b2f6a3fe908 (patch)
tree6be3cf20e101e7ed37884081bf3c18fb4dc63b66 /src
parent474bbf1b635ba50fd2abf1cef24f352bd7916dd2 (diff)
libstage: bump libstage for new render_func
Newer libstage enables the render_func to free its stage node via return value. This is useful for fire-and-forget style ephemeral nodes that make for convenient autonomous stage nodes which remove themselves after running their course. Think bonus scores and little visual effects... Requires some mechanical changes to the existing render funcs, but nothing functionally has really changed.
Diffstat (limited to 'src')
-rw-r--r--src/clear-node.c4
-rw-r--r--src/shader-node.c4
-rw-r--r--src/tex-node.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/src/clear-node.c b/src/clear-node.c
index 19093e4..688b8f3 100644
--- a/src/clear-node.c
+++ b/src/clear-node.c
@@ -23,9 +23,11 @@
#include "macros.h"
-static void clear_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
+static stage_render_func_ret_t clear_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ return STAGE_RENDER_FUNC_RET_CONTINUE;
}
diff --git a/src/shader-node.c b/src/shader-node.c
index 5a21c89..3f1cce1 100644
--- a/src/shader-node.c
+++ b/src/shader-node.c
@@ -60,7 +60,7 @@ static const float texcoords[] = {
};
-static void shader_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
+static stage_render_func_ret_t shader_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
{
shader_node_t *shader_node = object;
unsigned n_uniforms;
@@ -93,6 +93,8 @@ static void shader_node_render(const stage_t *stage, void *object, float alpha,
glDrawArrays(GL_TRIANGLES, 0, 6);
glUseProgram(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
+
+ return STAGE_RENDER_FUNC_RET_CONTINUE;
}
diff --git a/src/tex-node.c b/src/tex-node.c
index 1fd0ac0..3c144d3 100644
--- a/src/tex-node.c
+++ b/src/tex-node.c
@@ -38,7 +38,7 @@ typedef struct tex_node_t {
/* Render simply renders a texd texture onto the screen */
-static void tex_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
+static stage_render_func_ret_t tex_node_render(const stage_t *stage, void *object, float alpha, void *render_ctxt)
{
tex_node_t *tex_node = object;
@@ -46,6 +46,8 @@ static void tex_node_render(const stage_t *stage, void *object, float alpha, voi
assert(tex_node);
tex_render(tex_node->tex, alpha, tex_node->projection_x, tex_node->model_x);
+
+ return STAGE_RENDER_FUNC_RET_CONTINUE;
}
© All Rights Reserved