summaryrefslogtreecommitdiff
path: root/patches/OpenCSG-1.3.1-FBO.patch
blob: f4b3fcce971ec5d3af12828c17536d75d69cf10a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
Only in OpenCSG-1.3.1-fbopatch/: lib
diff -ur OpenCSG-1.3.1/Makefile OpenCSG-1.3.1-fbopatch/Makefile
--- OpenCSG-1.3.1/Makefile	2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/Makefile	2011-11-23 21:44:21.285641445 -0600
@@ -1,4 +1,4 @@
-SUBDIRS = glew src example
+SUBDIRS = src
 
 all:
 	for X in $(SUBDIRS); do make -C $$X ; done
Only in OpenCSG-1.3.1-fbopatch/src: area.o
Only in OpenCSG-1.3.1-fbopatch/src: batch.o
Only in OpenCSG-1.3.1-fbopatch/src: channelManager.o
Only in OpenCSG-1.3.1-fbopatch/src: context.o
diff -ur OpenCSG-1.3.1/src/frameBufferObject.cpp OpenCSG-1.3.1-fbopatch/src/frameBufferObject.cpp
--- OpenCSG-1.3.1/src/frameBufferObject.cpp	2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObject.cpp	2011-11-23 22:19:33.545641258 -0600
@@ -3,8 +3,8 @@
 //
 // This library is free software; you can redistribute it and/or 
 // modify it under the terms of the GNU General Public License, 
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
 // with the CGAL library and distribute executables.
 //
 // This library is distributed in the hope that it will be useful, 
@@ -59,6 +59,7 @@
             glGenRenderbuffers(1, &depthID); 
             glGenTextures(1, &textureID);
 
+            glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferID);
             glBindFramebuffer(GL_FRAMEBUFFER, framebufferID);
             glBindTexture(GL_TEXTURE_2D, textureID);
             glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_INT, 0);
@@ -78,7 +79,7 @@
                 return false;
             }
 
-            glBindFramebuffer(GL_FRAMEBUFFER, 0);
+            glBindFramebuffer(GL_FRAMEBUFFER, oldFramebufferID);
             glBindTexture(GL_TEXTURE_2D, 0);
 
             textureTarget = GL_TEXTURE_2D;
@@ -135,7 +136,7 @@
         // Unbinds frame buffer texture.
         bool FrameBufferObject::EndCapture()
         {
-            glBindFramebuffer(GL_FRAMEBUFFER, 0);
+            glBindFramebuffer(GL_FRAMEBUFFER, oldFramebufferID);
             return true;
         }
 
diff -ur OpenCSG-1.3.1/src/frameBufferObjectExt.cpp OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.cpp
--- OpenCSG-1.3.1/src/frameBufferObjectExt.cpp	2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.cpp	2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
 //
 // This library is free software; you can redistribute it and/or 
 // modify it under the terms of the GNU General Public License, 
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
 // with the CGAL library and distribute executables.
 //
 // This library is distributed in the hope that it will be useful, 
@@ -60,6 +60,7 @@
             glGenRenderbuffersEXT(1, &depthID); 
             glGenTextures(1, &textureID);
 
+            glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &oldFramebufferID);
             glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebufferID);	
             glBindTexture(GL_TEXTURE_2D, textureID);
             glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_INT, 0);
@@ -79,7 +80,7 @@
                 return false;
             }
 
-            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFramebufferID);
             glBindTexture(GL_TEXTURE_2D, 0);
 
             textureTarget = GL_TEXTURE_2D;
@@ -136,7 +137,7 @@
         // Unbinds frame buffer texture.
         bool FrameBufferObjectExt::EndCapture()
         {
-            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+            glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFramebufferID);
             return true;
         }
 
diff -ur OpenCSG-1.3.1/src/frameBufferObjectExt.h OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.h
--- OpenCSG-1.3.1/src/frameBufferObjectExt.h	2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.h	2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
 //
 // This library is free software; you can redistribute it and/or 
 // modify it under the terms of the GNU General Public License, 
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
 // with the CGAL library and distribute executables.
 //
 // This library is distributed in the hope that it will be useful, 
@@ -85,6 +85,7 @@
             unsigned int depthID;
 
             unsigned int framebufferID;
+            int oldFramebufferID;
 
             bool         initialized;
         };
Only in OpenCSG-1.3.1-fbopatch/src: frameBufferObjectExt.o
diff -ur OpenCSG-1.3.1/src/frameBufferObject.h OpenCSG-1.3.1-fbopatch/src/frameBufferObject.h
--- OpenCSG-1.3.1/src/frameBufferObject.h	2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObject.h	2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
 //
 // This library is free software; you can redistribute it and/or 
 // modify it under the terms of the GNU General Public License, 
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation. 
+// As a special exception, you have permission to link this library 
 // with the CGAL library and distribute executables.
 //
 // This library is distributed in the hope that it will be useful, 
@@ -85,6 +85,7 @@
             unsigned int depthID;
 
             unsigned int framebufferID;
+            int oldFramebufferID;
 
             bool         initialized;
         };
Only in OpenCSG-1.3.1-fbopatch/src: frameBufferObject.o
Only in OpenCSG-1.3.1-fbopatch/src: occlusionQuery.o
Only in OpenCSG-1.3.1-fbopatch/src: offscreenBuffer.o
Only in OpenCSG-1.3.1-fbopatch/src: opencsgRender.o
Only in OpenCSG-1.3.1-fbopatch/src: openglHelper.o
Only in OpenCSG-1.3.1-fbopatch/src: pBufferTexture.o
Only in OpenCSG-1.3.1-fbopatch/src: primitiveHelper.o
Only in OpenCSG-1.3.1-fbopatch/src: primitive.o
Only in OpenCSG-1.3.1-fbopatch/src: renderGoldfeather.o
Only in OpenCSG-1.3.1-fbopatch/src: renderSCS.o
Only in OpenCSG-1.3.1-fbopatch/src: RenderTexture.o
Only in OpenCSG-1.3.1-fbopatch/src: scissorMemo.o
Only in OpenCSG-1.3.1-fbopatch/src: settings.o
Only in OpenCSG-1.3.1-fbopatch/src: stencilManager.o
contact: Jan Huwald // Impressum