| 104 | } |
| 105 | |
| 106 | void render(wf::auxilliary_buffer_t& source, const wf::render_buffer_t& destination) |
| 107 | { |
| 108 | static const float vertexData[] = { |
| 109 | -1.0f, -1.0f, |
| 110 | 1.0f, -1.0f, |
| 111 | 1.0f, 1.0f, |
| 112 | -1.0f, 1.0f |
| 113 | }; |
| 114 | |
| 115 | static const float coordData[] = { |
| 116 | 0.0f, 0.0f, |
| 117 | 1.0f, 0.0f, |
| 118 | 1.0f, 1.0f, |
| 119 | 0.0f, 1.0f |
| 120 | }; |
| 121 | |
| 122 | wf::gles::run_in_context([&] |
| 123 | { |
| 124 | wf::gles::bind_render_buffer(destination); |
| 125 | program.use(wf::TEXTURE_TYPE_RGBA); |
| 126 | GL_CALL(glBindTexture(GL_TEXTURE_2D, wf::gles_texture_t::from_aux(source).tex_id)); |
| 127 | GL_CALL(glActiveTexture(GL_TEXTURE0)); |
| 128 | |
| 129 | program.attrib_pointer("position", 2, 0, vertexData); |
| 130 | program.attrib_pointer("uvPosition", 2, 0, coordData); |
| 131 | program.uniform1i("preserve_hue", preserve_hue); |
| 132 | |
| 133 | GL_CALL(glDisable(GL_BLEND)); |
| 134 | GL_CALL(glDrawArrays(GL_TRIANGLE_FAN, 0, 4)); |
| 135 | GL_CALL(glEnable(GL_BLEND)); |
| 136 | GL_CALL(glBindTexture(GL_TEXTURE_2D, 0)); |
| 137 | |
| 138 | program.deactivate(); |
| 139 | }); |
| 140 | } |
| 141 | |
| 142 | void fini() override |
| 143 | { |
nothing calls this directly
no test coverage detected