chart2/source/view/main/OpenGLRender.cxx | 49 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-)
New commits: commit 310ffb8582e37f57dd1990877312da23f2bc8c28 Author: Markus Mohrhard <[email protected]> Date: Wed Jan 1 22:38:26 2014 +0100 temp Change-Id: I36ba16e8ccb8782c9fd85d7cf772d74ffab5a7f7 diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx index b630ec9..fe16400 100644 --- a/chart2/source/view/main/OpenGLRender.cxx +++ b/chart2/source/view/main/OpenGLRender.cxx @@ -25,6 +25,8 @@ using namespace com::sun::star; using namespace std; +#define RENDER_TO_FILE 0 + #define OPENGL_SHADER( ... )# __VA_ARGS__ #define GL_PI 3.14159f @@ -34,8 +36,6 @@ using namespace std; #define WGL_SAMPLES_ARB 0x2042 #endif -#define RENDER_TO_FILE 0 - const char *ColorFragmemtShader = OPENGL_SHADER ( varying vec3 fragmentColor; @@ -532,6 +532,29 @@ void OpenGLRender::prepareToRender() void OpenGLRender::renderToBitmap() { + if (m_iArbMultisampleSupported) + { + glBindFramebuffer(GL_FRAMEBUFFER, 0); + glBindFramebuffer(GL_READ_FRAMEBUFFER, m_frameBufferMS); + status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) + { + cout << "The frame buffer status is not complete!" << endl; + return -1; + } + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]); + status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) + { + cout << "The frame buffer status is not complete!" << endl; + return -1; + } + glBlitFramebuffer(0, 0 ,m_iWidth, m_iHeight, 0, 0,m_iWidth ,m_iHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR); + glBindFramebuffer(GL_READ_FRAMEBUFFER,0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER,0); + glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]); + } + #if RENDER_TO_FILE char fileName[256] = {0}; sprintf(fileName, "D:\\shaderout_%d_%d_%d.bmp", m_iWidth, m_iHeight, m_iFboIdx); @@ -1193,28 +1216,6 @@ int OpenGLRender::RenderBubble2FBO(int) { return -1; } - if (m_iArbMultisampleSupported) - { - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glBindFramebuffer(GL_READ_FRAMEBUFFER, m_frameBufferMS); - status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); - if (status != GL_FRAMEBUFFER_COMPLETE) - { - cout << "The frame buffer status is not complete!" << endl; - return -1; - } - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]); - status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); - if (status != GL_FRAMEBUFFER_COMPLETE) - { - cout << "The frame buffer status is not complete!" << endl; - return -1; - } - glBlitFramebuffer(0, 0 ,m_iWidth, m_iHeight, 0, 0,m_iWidth ,m_iHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR); - glBindFramebuffer(GL_READ_FRAMEBUFFER,0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER,0); - glBindFramebuffer(GL_FRAMEBUFFER, m_FboID[m_iFboIdx % 2]); - } return 0; } _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
