Revision: 222
Author:
connec...@gmail.com
Date: Sat Jul 13 14:04:46 2013
Log: emergency fix for matrix stack leak.
http://code.google.com/p/syphon-implementations/source/detail?r=222
Modified:
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShader.mat
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShaderCloth.mat
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/SyphonServerAndClient.unity
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/ServerWatcherUtility.mm
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonClientUnity.m
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnity.mm
/trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnityPlugin.xcodeproj/project.pbxproj
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShader.mat
Tue Jul 2 19:25:51 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShader.mat
Sat Jul 13 14:04:46 2013
Binary file, no diff available.
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShaderCloth.mat
Fri Jul 12 15:00:14 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Resources/syphonSupportedShaderCloth.mat
Sat Jul 13 14:04:46 2013
Binary file, no diff available.
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/SyphonServerAndClient.unity
Fri Jul 12 15:00:14 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/SyphonServerAndClient.unity
Sat Jul 13 14:04:46 2013
Binary file, no diff available.
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/ServerWatcherUtility.mm
Tue Jul 2 19:22:30 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/ServerWatcherUtility.mm
Sat Jul 13 14:04:46 2013
@@ -208,6 +208,8 @@
void handleTextureSizeChanged(SyphonCacheData* ptr){
// void *args[] = { &ptr, &(ptr->textureWidth),
&(ptr->textureHeight) };
// mono_runtime_invoke(textureSizeChanged, NULL, args, NULL);
+ //
+ NSLog(@"changing texture size: %i/%i",ptr->textureWidth,
ptr->textureHeight);
OnTextureSizeChangedDelegate((int)ptr, ptr->textureWidth,
ptr->textureHeight);
}
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonClientUnity.m
Fri Jul 12 15:00:14 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonClientUnity.m
Sat Jul 13 14:04:46 2013
@@ -143,7 +143,10 @@
//perform callback to unity here because the w/h changed
ptr->textureWidth = (int)surfaceSize.width;
ptr->textureHeight = (int)surfaceSize.height;
- NSLog(@"w/h: %i, %i", ptr->textureWidth, ptr->textureHeight);
+ GLint texcount = 0;
+ glGetIntegerv(GL_TEXTURE_STACK_DEPTH, &texcount);
+
+ NSLog(@"w/h: %i, %i, count: %i", ptr->textureWidth,
ptr->textureHeight, texcount);
// ptr->updateTextureSizeFlag = true;
handleTextureSizeChanged(ptr);
@@ -151,7 +154,15 @@
glBindTexture(GL_TEXTURE_RECTANGLE_EXT, 0);
glDisable(GL_TEXTURE_RECTANGLE_EXT);
-
+
+ //POP MATRIX STATE CODE
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_TEXTURE);
+ glPopMatrix();
+
glPopClientAttrib();
glPopAttrib();
@@ -159,6 +170,7 @@
glBindFramebufferEXT(GL_READ_FRAMEBUFFER, previousReadFBO);
glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER, previousDrawFBO);
+ if(image)
[image release];
return;
}
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnity.mm Fri
Jul 12 15:00:14 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnity.mm Sat
Jul 13 14:04:46 2013
@@ -200,8 +200,8 @@
void cacheGraphicsContext(){
if(cachedContext != CGLGetCurrentContext()){
cachedContext = CGLGetCurrentContext();
- if(syphonFBO){
- //NSLog(@"CACHING CONTEXT + DELETING FBO at RESOURCE
ID: %i", syphonFBO);
+ if(syphonFBO){
+// NSLog(@"CACHING CONTEXT + DELETING FBO at RESOURCE ID: %i",
syphonFBO);
glDeleteFramebuffersEXT(1, &syphonFBO);
glGenFramebuffersEXT(1, &syphonFBO);
}
@@ -213,7 +213,7 @@
//don't destroy/create if it's not initialized yet!
if((*list_iter)->initialized){
syphonServerDestroyResources(
(*list_iter)->syphonServer);
- // NSLog(@"destroying resources.");
+ // NSLog(@"destroying resources.");
(*list_iter)->syphonServer = nil;
syphonServerCreate((*list_iter));
}
@@ -232,7 +232,7 @@
if(ptr->pluginType != PLUGIN_SYPHON)
return;
-
+
//if it's a server
if(ptr != nil && ptr->isAServer && ptr->initialized &&
ptr->serverName != nil){
//serialize destruction to same thread as drawing
=======================================
--- /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnityPlugin.xcodeproj/project.pbxproj
Fri Jul 12 15:00:14 2013
+++ /trunk/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityPlugin/SyphonUnityPlugin.xcodeproj/project.pbxproj
Sat Jul 13 14:04:46 2013
@@ -249,7 +249,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "\nrm -r -f
\"/Users/bc/syphon-implementations-proper/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Plugins/$PRODUCT_NAME.bundle\"\ncp
-r -f \"$TARGET_BUILD_DIR/$PRODUCT_NAME.bundle\"
\"/Users/bc/syphon-implementations-proper/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Plugins/$PRODUCT_NAME.bundle\"\n";
+ shellScript = "\n#rm -r -f
\"/Users/bc/syphon-implementations-proper/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Plugins/$PRODUCT_NAME.bundle\"\n#cp
-r -f \"$TARGET_BUILD_DIR/$PRODUCT_NAME.bundle\"
\"/Users/bc/syphon-implementations-proper/Syphon
Implementations/Unity3D/Unity3D-3_5/SyphonUnityExample/Assets/Plugins/$PRODUCT_NAME.bundle\"\n";
};
BD48069C1239AFCA00DFB19E /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;