diff options
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/GPU_extensions.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_extensions.c | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 07269d3e2b5..0ae45775473 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -157,6 +157,8 @@ void GPU_offscreen_free(GPUOffScreen *ofs); void GPU_offscreen_bind(GPUOffScreen *ofs); void GPU_offscreen_unbind(GPUOffScreen *ofs); void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels); +int GPU_offscreen_width(GPUOffScreen *ofs); +int GPU_offscreen_height(GPUOffScreen *ofs); /* GPU Shader * - only for fragment shaders now diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index f5eaa716dfa..c7a421a49fc 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -905,10 +905,8 @@ void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex, i glMatrixMode(GL_PROJECTION); glPushMatrix(); - glLoadIdentity(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadIdentity(); } void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUSED(tex)) @@ -1096,6 +1094,16 @@ void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels) glReadPixels(0, 0, ofs->w, ofs->h, GL_RGBA, type, pixels); } +int GPU_offscreen_width(GPUOffScreen *ofs) +{ + return ofs->w; +} + +int GPU_offscreen_height(GPUOffScreen *ofs) +{ + return ofs->h; +} + /* GPUShader */ struct GPUShader { |