summaryrefslogtreecommitdiff
path: root/OpenCSG-Reset-Hack.patch
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-09 02:32:56 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2009-12-09 02:32:56 (GMT)
commitff545392b9eabb0ff8b9e61e37a027d55967de9b (patch)
tree37f62bfdebe3065bf61c87fc6d0fd5e8ab604e0a /OpenCSG-Reset-Hack.patch
parent071b6abc220a7dc738d2a0314556b8eaa79f75db (diff)
EOL fix
git-svn-id: http://svn.clifford.at/openscad/trunk@146 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'OpenCSG-Reset-Hack.patch')
-rw-r--r--OpenCSG-Reset-Hack.patch94
1 files changed, 47 insertions, 47 deletions
diff --git a/OpenCSG-Reset-Hack.patch b/OpenCSG-Reset-Hack.patch
index 4968707..493a11b 100644
--- a/OpenCSG-Reset-Hack.patch
+++ b/OpenCSG-Reset-Hack.patch
@@ -33,50 +33,50 @@ index e02dd83..4f978d5 100644
--- a/src/offscreenBuffer.cpp
+++ b/src/offscreenBuffer.cpp
@@ -22,19 +22,41 @@
- #include "offscreenBuffer.h"
- #include "frameBufferObject.h"
- #include "pBufferTexture.h"
-+#include "channelManager.h"
-+
-+static bool reset_f = false;
-+static bool reset_p = false;
-
- namespace OpenCSG {
-
-+ void reset()
-+ {
-+ reset_f = true;
-+ reset_p = true;
-+ OpenCSG::ChannelManager::gOffscreenBuffer = NULL;
-+ }
-+
- namespace OpenGL {
-
- OffscreenBuffer* getOffscreenBuffer(bool fbo) {
-- static FrameBufferObject* f = new FrameBufferObject;
-- static PBufferTexture* p = new PBufferTexture;
--
-- if (fbo)
-- return f;
-- else
-+ static FrameBufferObject* f = NULL;
-+ static PBufferTexture* p = NULL;
-+
-+ if (fbo) {
-+ if (reset_f || f == NULL) {
-+ delete f;
-+ f = new FrameBufferObject;
-+ reset_f = false;
-+ }
-+ return f;
-+ } else {
-+ if (reset_p || p == NULL) {
-+ delete p;
-+ p = new PBufferTexture;
-+ reset_p = false;
-+ }
- return p;
-+ }
- }
-
- } // namespace OpenGL
+ #include "offscreenBuffer.h"
+ #include "frameBufferObject.h"
+ #include "pBufferTexture.h"
++#include "channelManager.h"
++
++static bool reset_f = false;
++static bool reset_p = false;
+
+ namespace OpenCSG {
+
++ void reset()
++ {
++ reset_f = true;
++ reset_p = true;
++ OpenCSG::ChannelManager::gOffscreenBuffer = NULL;
++ }
++
+ namespace OpenGL {
+
+ OffscreenBuffer* getOffscreenBuffer(bool fbo) {
+- static FrameBufferObject* f = new FrameBufferObject;
+- static PBufferTexture* p = new PBufferTexture;
+-
+- if (fbo)
+- return f;
+- else
++ static FrameBufferObject* f = NULL;
++ static PBufferTexture* p = NULL;
++
++ if (fbo) {
++ if (reset_f || f == NULL) {
++ delete f;
++ f = new FrameBufferObject;
++ reset_f = false;
++ }
++ return f;
++ } else {
++ if (reset_p || p == NULL) {
++ delete p;
++ p = new PBufferTexture;
++ reset_p = false;
++ }
+ return p;
++ }
+ }
+
+ } // namespace OpenGL
contact: Jan Huwald // Impressum