diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-10-11 16:50:46 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-10-12 17:38:55 +0300 |
commit | 01745051de735c37a2d817c1a58fda4585b77698 (patch) | |
tree | 119e9593fead5a3858ac17ece3ccdf46e6ce031f /source/blender/blenlib/BLI_link_utils.h | |
parent | 9b692ecabd3ddf675b4c6e09999415138df598d4 (diff) |
DRW: Add DRW_shgroup_create_sub to create children shgroup
This makes is easy to create nested drawcalls that will inherit all the
parents properties. This is usefull if only a few uniforms changes for that
drawcall.
Diffstat (limited to 'source/blender/blenlib/BLI_link_utils.h')
-rw-r--r-- | source/blender/blenlib/BLI_link_utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_link_utils.h b/source/blender/blenlib/BLI_link_utils.h index 5322547ac08..7a1a13a6b31 100644 --- a/source/blender/blenlib/BLI_link_utils.h +++ b/source/blender/blenlib/BLI_link_utils.h @@ -47,6 +47,15 @@ (list)->last = link; \ } (void)0 +/* Use for inserting after a certain element. */ +#define BLI_LINKS_INSERT_AFTER(list, node, link) { \ + if ((node)->next == NULL) { \ + (list)->last = link; \ + } \ + (link)->next = (node)->next; \ + (node)->next = link; \ +} (void)0 + #define BLI_LINKS_FREE(list) { \ while (list) { \ void *next = list->next; \ |