28 #include "ascension/error.h" |
28 #include "ascension/error.h" |
29 #include "ascension/context.h" |
29 #include "ascension/context.h" |
30 #include "ascension/scene.h" |
30 #include "ascension/scene.h" |
31 #include "ascension/behavior.h" |
31 #include "ascension/behavior.h" |
32 #include "ascension/shader.h" |
32 #include "ascension/shader.h" |
33 #include "ascension/2d.h" |
33 #include "ascension/sprite.h" |
34 |
34 |
35 #include <cx/tree.h> |
35 #include <cx/tree.h> |
36 #include <cx/array_list.h> |
36 #include <cx/array_list.h> |
37 |
37 |
38 #include <GL/glew.h> |
38 #include <GL/glew.h> |
93 CxIterator iter_blend_rect = cxListIterator(blend_rect); |
93 CxIterator iter_blend_rect = cxListIterator(blend_rect); |
94 CxIterator iter_blend_uv = cxListIterator(blend_uv); |
94 CxIterator iter_blend_uv = cxListIterator(blend_uv); |
95 |
95 |
96 // TODO: implement interleaving by depth |
96 // TODO: implement interleaving by depth |
97 if (cxIteratorValid(iter_opaque_rect)) { |
97 if (cxIteratorValid(iter_opaque_rect)) { |
|
98 // TODO: add abstraction, because otherwise this will explode really fast when we start adding primitive shaders |
98 glDisable(GL_BLEND); |
99 glDisable(GL_BLEND); |
99 const AscShaderProgram *shader = asc_sprite_shader_rect(); |
100 const AscShaderProgram *shader = asc_sprite_shader_rect(); |
100 asc_shader_use(shader, &scene->camera); |
101 asc_shader_use(shader, &scene->camera); |
101 cx_foreach(const AscSprite*, node, iter_opaque_rect) { |
102 cx_foreach(const AscSprite*, node, iter_opaque_rect) { |
102 asc_sprite_draw(shader, node); |
103 asc_sprite_draw(shader, node); |