Created
May 28, 2014 08:48
-
-
Save Noxalus/0b991c99cc122b031dd5 to your computer and use it in GitHub Desktop.
Add UIWebView to SDLwindow*
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDLwindow* sdlWindow = getWindow(); | |
SDL_SysWMinfo info; | |
window* window; | |
SDL_VERSION(&info.version); | |
if (SDL_GetWindowWMInfo(sdlWindow, &info)) | |
{ | |
window = (info.info.uikit.window); | |
// Create the web view | |
UIWebView* webView = [[IOSWebView alloc] initWithFrame:window.bounds]; | |
[webView setBackgroundColor: [UIColor clearColor]]; | |
[webView setOpaque:NO]; | |
// Add the web view to the current window | |
[window addSubview:webView]; | |
// Load the user interface | |
NSURL *url = [NSURL fileURLWithPath:@"interface.html"]; | |
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; | |
[webView loadRequest:requestObj]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment