From 271471bbe6ad26a1b96b9bc76dfba4e5f70b2d89 Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Mon, 27 Mar 2017 01:43:12 -0400 Subject: OpenGL: remove matrix manip from framebuffer setup It doesn't really belong here... Any code using framebuffers will set up its own matrices. Part of T49450 --- source/blender/gpu/intern/gpu_framebuffer.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'source/blender') diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index e807c5523a6..5b3ffe9a93f 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -220,14 +220,9 @@ void GPU_texture_bind_as_framebuffer(GPUTexture *tex) glEnable(GL_MULTISAMPLE); } - /* push matrices and set default viewport and matrix */ + /* set default viewport */ glViewport(0, 0, GPU_texture_width(tex), GPU_texture_height(tex)); GG.currentfb = fb->object; - - glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); - glMatrixMode(GL_MODELVIEW); - gpuPushMatrix(); } void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot) @@ -258,14 +253,9 @@ void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot) glDrawBuffers(numslots, attachments); glReadBuffer(GL_COLOR_ATTACHMENT0 + slot); - /* push matrices and set default viewport and matrix */ + /* set default viewport */ glViewport(0, 0, GPU_texture_width(fb->colortex[slot]), GPU_texture_height(fb->colortex[slot])); GG.currentfb = fb->object; - - glMatrixMode(GL_PROJECTION); - gpuPushMatrix(); - glMatrixMode(GL_MODELVIEW); - gpuPushMatrix(); } void GPU_framebuffer_bind(GPUFrameBuffer *fb) @@ -308,12 +298,6 @@ void GPU_framebuffer_bind(GPUFrameBuffer *fb) void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUSED(tex)) { - /* restore matrix */ - glMatrixMode(GL_PROJECTION); - gpuPopMatrix(); - glMatrixMode(GL_MODELVIEW); - gpuPopMatrix(); - /* restore attributes */ glPopAttrib(); } -- cgit v1.2.3