1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sokol: add screenshot function to OpenGL based backends (#12169)

This commit is contained in:
Larpon
2021-10-13 20:22:58 +02:00
committed by GitHub
parent 97e999768a
commit 5bfa3d5530
5 changed files with 64 additions and 2 deletions

9
thirdparty/sokol/sokol_v.post.h vendored Normal file
View File

@@ -0,0 +1,9 @@
#if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES2) || defined(SOKOL_GLES3)
void v_sapp_gl_read_rgba_pixels(int x, int y, int width, int height, unsigned char* pixels) {
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
}
#else
void v_sapp_gl_read_rgba_pixels(int x, int y, int width, int height, unsigned char* pixels) {
// TODO
}
#endif