97 // TODO: scene should know which shader we are going to activate s.t. it can pre-sort nodes |
97 // TODO: scene should know which shader we are going to activate s.t. it can pre-sort nodes |
98 const AscSpriteShader *shader = |
98 const AscSpriteShader *shader = |
99 sprite->texture->target == GL_TEXTURE_RECTANGLE |
99 sprite->texture->target == GL_TEXTURE_RECTANGLE |
100 ? asc_shader_lookup_or_create(ASC_SHADER_SPRITE_RECT, asc_sprite_shader_create, 1) |
100 ? asc_shader_lookup_or_create(ASC_SHADER_SPRITE_RECT, asc_sprite_shader_create, 1) |
101 : asc_shader_lookup_or_create(ASC_SHADER_SPRITE_UV, asc_sprite_shader_create, 0); |
101 : asc_shader_lookup_or_create(ASC_SHADER_SPRITE_UV, asc_sprite_shader_create, 0); |
|
102 if (shader == NULL) return; |
102 asc_shader_use(&shader->program, camera); |
103 asc_shader_use(&shader->program, camera); |
103 |
104 |
104 // Upload model matrix |
105 // Upload model matrix |
105 glUniformMatrix4fv(shader->program.model, 1, |
106 glUniformMatrix4fv(shader->program.model, 1, |
106 GL_FALSE, node->world_transform); |
107 GL_FALSE, node->world_transform); |