Skip to content

Instantly share code, notes, and snippets.

@Noxalus
Created May 28, 2014 08:48
Show Gist options
  • Save Noxalus/0b991c99cc122b031dd5 to your computer and use it in GitHub Desktop.
Save Noxalus/0b991c99cc122b031dd5 to your computer and use it in GitHub Desktop.
Add UIWebView to SDLwindow*
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