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;
}
Exemplo n.º 2
0
effVOID EFF3DHtmlWindow::Initialise()
{

	EFF3DDevice * device = EFF3DGetDevice();

	if ( device == NULL )
	{
		return;
	}

	Awesomium::WebCore * webCore = device->GetWebCore();

    if ( webView == NULL)
    {
        webView = webCore->CreateWebView(width, height);

		/*EFFInputManager * inputManager = EFF3DGetDevice()->GetInputManager();

		inputManager->OnKeyPressed += EFFEventCall(this, &EFF3DWebGUIWindow::KeyPressed);
		inputManager->OnKeyReleased += EFFEventCall(this, &EFF3DWebGUIWindow::KeyReleased);

		inputManager->OnMouseMove += EFFEventCall(this, &EFF3DWebGUIWindow::MouseMoved);
		inputManager->OnMouseButtonPressed += EFFEventCall(this, &EFF3DWebGUIWindow::MousePressed);
		inputManager->OnMouseButtonReleased += EFFEventCall(this, &EFF3DWebGUIWindow::MouseReleased);

		clientHandler.onTitleChanged = OnTitleChanged;
		clientHandler.onURLChanged = OnURLChanged;
		webView->setClientHandler(&clientHandler);*/
    }


}
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; }
}