You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/04/30 02:27:31 UTC
[3/3] mac commit: Added WebGL support.
Added WebGL support.
Project: http://git-wip-us.apache.org/repos/asf/cordova-osx/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-osx/commit/c69e8754
Tree: http://git-wip-us.apache.org/repos/asf/cordova-osx/tree/c69e8754
Diff: http://git-wip-us.apache.org/repos/asf/cordova-osx/diff/c69e8754
Branch: refs/heads/2.7.x
Commit: c69e875482f7bd96774d2c81cc2effdaa4648eec
Parents: e5ce543
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Apr 29 16:05:49 2013 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Apr 29 17:27:22 2013 -0700
----------------------------------------------------------------------
.../CordovaFramework/Classes/CDVViewController.m | 10 ++++++++++
bin/templates/project/__TESTING__/config.xml | 4 +---
2 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/c69e8754/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVViewController.m b/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
index 0321d18..b0aa043 100644
--- a/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
+++ b/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
@@ -77,6 +77,16 @@
for (NSString* pluginName in self.startupPluginNames) {
[self getCommandInstance:pluginName];
}
+
+ // initialize items based on settings
+
+ BOOL enableWebGL = [[self.settings objectForKey:@"EnableWebGL"] boolValue];
+ WebPreferences* prefs = [self.webView preferences];
+
+ // Note that this preference may not be Mac App Store safe
+ if (enableWebGL && [prefs respondsToSelector:@selector(setWebGLEnabled:)]) {
+ [prefs performSelector:@selector(setWebGLEnabled:) withObject:[NSNumber numberWithBool:enableWebGL]];
+ }
}
- (void) __init
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/c69e8754/bin/templates/project/__TESTING__/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/__TESTING__/config.xml b/bin/templates/project/__TESTING__/config.xml
index 685aeaf..bc5a9f8 100644
--- a/bin/templates/project/__TESTING__/config.xml
+++ b/bin/templates/project/__TESTING__/config.xml
@@ -20,9 +20,7 @@
#
-->
<widget>
- <!--
- <preference name="MyPreferenceName" value="true" />
- -->
+ <preference name="EnableWebGL" value="false" />
<content src="index.html" />