Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualnoizex

Posted 08 January 2013 - 07:04 AM

The thing that is confusing to me is the src_buffer parameter, I don't understand what kind of buffer I'm supposed to send in. Let's say I have loaded a website into a surface. The site then updates and I need to repaint the texture. How would I use surface->Paint() to do this?

Thanks once again!

Errm. Its not you thats sending data to Paint method, its the internals of Awesomium that do this. You have to define class that has Paint method and receive this data in that method, and use it to initialize/update texture. Its called automatically by Awesomium when it renders WebView, so you dont really need to call Paint yourself. Once you set the factory and load some page in WebView, you call webview->surface() to retrieve that Surface, which should have your page prepared as a texture (or a bitmap data if you use default BitmapSurface).

Check this example: http://wiki.awesomium.com/tutorials/tutorial-1-hello-awesomium.html

You want to do exactly the same but with your own class, that instead of keeping image data in memory, will upload it as a texture to GPU and keep handle to that texture, so you can retrieve it by calling surface->GetTexture() and then use that texture to draw a quad.

#3noizex

Posted 08 January 2013 - 07:03 AM

The thing that is confusing to me is the src_buffer parameter, I don't understand what kind of buffer I'm supposed to send in. Let's say I have loaded a website into a surface. The site then updates and I need to repaint the texture. How would I use surface->Paint() to do this?

Thanks once again!

Errm. Its not you thats sending data to Paint method, its the internals of Awesomium that do this. You have to create class that has Paint method and receive this data in that method, and use it to initialize/update texture. Its called automatically by Awesomium when it renders WebView, so you dont really need to call Paint yourself. Once you set the factory and load some page in WebView, you call webview->surface() to retrieve that Surface, which should have your page prepared as a texture (or a bitmap data if you use default BitmapSurface).

Check this example: http://wiki.awesomium.com/tutorials/tutorial-1-hello-awesomium.html

You want to do exactly the same but with your own class, that instead of keeping image data in memory, will upload it as a texture to GPU and keep handle to that texture, so you can retrieve it by calling surface->GetTexture() and then use that texture to draw a quad.

#2noizex

Posted 08 January 2013 - 07:03 AM

The thing that is confusing to me is the src_buffer parameter, I don't understand what kind of buffer I'm supposed to send in. Let's say I have loaded a website into a surface. The site then updates and I need to repaint the texture. How would I use surface->Paint() to do this?

Thanks once again!

Errm. Its not you thats sending data to Paint method, its the internals of Awesomium that do this. You have to create class that has Paint method and receive this data in that method, and use it to initialize/update texture. Its called automatically by Awesomium when it renders WebView, so you dont really need to call Paint yourself. Once you set the factory and load some page in WebView, you call webview->surface() to retrieve that Surface, which should have your page prepared as a texture (or a bitmap data if you use default BitmapSurface).

Check this example: http://wiki.awesomium.com/tutorials/tutorial-1-hello-awesomium.html

You want to do exactly the same but with your own class, that instead of keeping image data in memory, will upload it as a texture to GPU and keep handle to that texture, so you can retrieve it by calling surface->GetTexture() and then use that texture to draw a quad.

#1noizex

Posted 08 January 2013 - 07:01 AM

The thing that is confusing to me is the src_buffer parameter, I don't understand what kind of buffer I'm supposed to send in. Let's say I have loaded a website into a surface. The site then updates and I need to repaint the texture. How would I use surface->Paint() to do this?

Thanks once again!

 

 

Errm. Its not you thats sending data to Paint method, its the internals of Awesomium that do this. You have to create class that has Paint method and receive this data in that method, and use it to initialize/update texture. Its called automatically by Awesomium when it renders WebView, so you dont really need to call Paint yourself. Once you set the factory and load some page in WebView, you call webview->surface() to retrieve that Surface, which should have your page prepared as a texture (or a bitmap data if you use default BitmapSurface).


PARTNERS