diff --git a/src/library/so/main.c b/src/library/so/main.c index 89ce2c7..832424b 100644 --- a/src/library/so/main.c +++ b/src/library/so/main.c @@ -5,12 +5,9 @@ #include #include -#include #include #include #include -#include -#include #include "../gl.h" @@ -671,7 +668,7 @@ void glDrawElements(uint32_t mode, unsigned int count, uint32_t type, const void real_glDrawElements(mode, count, type, indices); struct GLContext* c = _bolt_context(); struct GLProgram* current_program = c->programs[c->bound_program_id]; - if (type == GL_UNSIGNED_SHORT && mode == GL_TRIANGLES && count > 0 && current_program->is_2d) { + if (type == GL_UNSIGNED_SHORT && mode == GL_TRIANGLES && count > 0 && current_program->is_2d && c->current_draw_framebuffer == 0) { int element_binding; real_glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &element_binding); struct GLArrayBuffer* element_buffer = c->buffers[element_binding]; @@ -734,7 +731,7 @@ void glDrawElements(uint32_t mode, unsigned int count, uint32_t type, const void } } else if(icon_detected) { if (!angle_calculated) { - // angle is in radians from 0..360 where upright is 0 and angle increases CCW. + // angle is in radians from 0..2pi where upright is 0 and angle increases CCW. float pos_angle_rads = atan2f(pos_y_min - pos[1], pos_x_min - pos[0]); float uv_angle_rads = atan2f(uv[1] - first_vertex_v, uv[0] - first_vertex_u); angle = fmod(pos_angle_rads - uv_angle_rads, M_PI * 2);