diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-25 19:53:04 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-26 18:29:49 +0300 |
commit | 18cca0e7043f9a7c38c7163f1fab5140eea82cae (patch) | |
tree | 80aab78a5f21b40d5725264ae79893e680f0e6ee /source/blender/gpu/intern/gpu_framebuffer.cc | |
parent | 9e23dbd060a1a23babecc8304c6ad79079835c09 (diff) |
Cleanup: GPU: Remove GPU_glew.h outside of GPU module
Remove use of GL* constants and types inside the codebase. There is still
a few occurence to get rid of.
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index c59a73ae508..4a6bb1f329d 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -1033,14 +1033,15 @@ void GPU_offscreen_draw_to_screen(GPUOffScreen *ofs, int x, int y) glBindFramebuffer(GL_READ_FRAMEBUFFER, GPU_framebuffer_default()); } -void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels) +void GPU_offscreen_read_pixels(GPUOffScreen *ofs, eGPUDataFormat type, void *pixels) { const int w = GPU_texture_width(ofs->color); const int h = GPU_texture_height(ofs->color); - BLI_assert(type == GL_UNSIGNED_BYTE || type == GL_FLOAT); + BLI_assert(ELEM(type, GPU_DATA_UNSIGNED_BYTE, GL_FLOAT)); + GLenum gl_type = (type == GPU_DATA_FLOAT) ? GL_FLOAT : GL_UNSIGNED_BYTE; - glReadPixels(0, 0, w, h, GL_RGBA, type, pixels); + glReadPixels(0, 0, w, h, GL_RGBA, gl_type, pixels); } int GPU_offscreen_width(const GPUOffScreen *ofs) |