void AwesomeSilkApp::setup() { setWindowPos(Vec2i(100,200)); // set Awesomium logging to verbose Awesomium::WebConfig cnf; cnf.log_level = Awesomium::kLogLevel_Verbose; #if defined( CINDER_MAC ) std::string frameworkPath = ( getAppPath() / "Contents" / "MacOS" ).string(); cnf.package_path = Awesomium::WebString::CreateFromUTF8( frameworkPath.c_str(), frameworkPath.size() ); #endif // initialize the Awesomium web engine mWebCorePtr = Awesomium::WebCore::Initialize( cnf ); // create a webview mWebViewPtr = mWebCorePtr->CreateWebView( getWindowWidth(), getWindowHeight() ); mWebViewPtr->LoadURL( Awesomium::WebURL( Awesomium::WSLit( "http://localhost/~vgusev/silk/silk/WebContent/silk.html" ) ) ); mWebViewPtr->Focus(); // load and create a "loading" icon try { mLoadingTexture = gl::Texture( loadImage( loadAsset( "loading.png" ) ) ); } catch( const std::exception &e ) { console() << "Error loading asset: " << e.what() << std::endl; } DialogWebViewListener *listener = new DialogWebViewListener(); mWebViewPtr->set_dialog_listener(listener); mTextureSyphon.setName("Cinder Texture"); useSyphon = false; }
void _TBOX_PREFIX_App::setup() { // set Awesomium logging to verbose Awesomium::WebConfig cnf; cnf.log_level = Awesomium::kLogLevel_Verbose; // initialize the Awesomium web engine mWebCorePtr = Awesomium::WebCore::Initialize( cnf ); // create a webview mWebViewPtr = mWebCorePtr->CreateWebView( getWindowWidth(), getWindowHeight() ); mWebViewPtr->LoadURL( Awesomium::WebURL( Awesomium::WSLit( "http://libcinder.org" ) ) ); mWebViewPtr->Focus(); // load and create a "loading" icon try { mLoadingTexture = gl::Texture( loadImage( loadAsset( "loading.png" ) ) ); } catch( const std::exception &e ) { console() << "Error loading asset: " << e.what() << std::endl; } }