MCPcopy Create free account
hub / github.com/DavidColson/Polybox / _sg_gl_query_pixels

Function _sg_gl_query_pixels

source/graphics_platform_d3d11.cpp:285–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected