| 283 | } |
| 284 | |
| 285 | static void _sg_gl_query_pixels(int x, int y, int w, int h, void *pixels) { |
| 286 | SOKOL_ASSERT(pixels); |
| 287 | GLuint gl_fb; |
| 288 | GLint dims[4]; |
| 289 | glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*)&gl_fb); |
| 290 | _SG_GL_CHECK_ERROR(); |
| 291 | glGetIntegerv(GL_VIEWPORT, dims); |
| 292 | int cur_height = dims[3]; |
| 293 | _SG_GL_CHECK_ERROR(); |
| 294 | #if defined(SOKOL_GLES2) // use NV extension instead |
| 295 | glReadBufferNV(gl_fb == 0 ? GL_BACK : GL_COLOR_ATTACHMENT0); |
| 296 | #else |
| 297 | glReadBuffer(gl_fb == 0 ? GL_BACK : GL_COLOR_ATTACHMENT0); |
| 298 | #endif |
| 299 | _SG_GL_CHECK_ERROR(); |
| 300 | glReadPixels(x, y, w, h, GL_RGBA, GL_UNSIGNED_BYTE, pixels); |
| 301 | _SG_GL_CHECK_ERROR(); |
| 302 | } |
| 303 | |
| 304 | #endif |
| 305 |
nothing calls this directly
no outgoing calls
no test coverage detected