Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
WebBrowserTexture Class Reference

A Wrapper class for Awesomium webview. More...

#include "WebBrowserTexture.h"

Inheritance diagram for WebBrowserTexture:
Texture TypedWritableReferenceCount Namable TypedWritable ReferenceCount MemoryBase TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 WebBrowserTexture (const string &name, AwWebView *aw_web_view=NULL)
 This initializes a web browser texture with the given AwWebView class.
virtual ~WebBrowserTexture ()
 Standard destructor...
virtual bool cull_callback (CullTraverser *trav, const CullTraverserData &data) const
 This function will be called during the cull traversal to update the WebBrowserTexture.
virtual TypeHandle force_init_type ()
bool get_flip_texture_active () const
 Returns whether automatic texture flipping is enabled.
virtual TypeHandle get_type () const
bool get_update_active () const
 Gets whether or not this texture is updating itself every time it is rendered.
AwWebViewget_web_view () const
 Gets the current internal AwWebView of this texture.
virtual bool has_cull_callback () const
 Should be overridden by derived classes to return true if cull_callback() has been defined.
void set_flip_texture_active (bool active_flag)
 This toggles on/off automatic flipping of the of the texture at a source level.
void set_update_active (bool active_flag)
 Gives the ability to toggle updating this texture or not.
void set_web_view (AwWebView *aw_web_view)
 Sets the internal AwWebView of this texture.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

void do_reload_ram_image ()
 A WebBrowserTexture must always keep its ram image.
bool get_keep_ram_image () const
 Standard destructor...

Protected Attributes

AwWebView_aw_web_view
bool _flip_texture_active
bool _update_active

Detailed Description

A Wrapper class for Awesomium webview.

This implements most of Awesomium's features and updates on the cull_traverser callback much much like a movie texture.

The use of class means that you will have to follow Awesomium license agreement give below http://www.khrona.com/products/awesomium/licensing/

Definition at line 34 of file WebBrowserTexture.h.


Constructor & Destructor Documentation

WebBrowserTexture::WebBrowserTexture ( const string &  name,
AwWebView aw_web_view = NULL 
)

This initializes a web browser texture with the given AwWebView class.

Definition at line 45 of file WebBrowserTexture.cxx.

References set_web_view().

Standard destructor...

doesn't do anything. All destructing happens in parent texture class.

Definition at line 62 of file WebBrowserTexture.cxx.


Member Function Documentation

bool WebBrowserTexture::cull_callback ( CullTraverser trav,
const CullTraverserData data 
) const [virtual]

This function will be called during the cull traversal to update the WebBrowserTexture.

This method calls the render method of AwWebView but does not call the update method of AwWebCore.

Reimplemented from Texture.

Definition at line 188 of file WebBrowserTexture.cxx.

References Texture::get_texture_type(), Texture::get_x_size(), Texture::get_y_size(), and ConstPointerToArray< Element >::p().

A WebBrowserTexture must always keep its ram image.

This is essentially a sub.

Definition at line 84 of file WebBrowserTexture.cxx.

Returns whether automatic texture flipping is enabled.

Definition at line 175 of file WebBrowserTexture.cxx.

bool WebBrowserTexture::get_keep_ram_image ( ) const [protected, virtual]

Standard destructor...

doesn't do anything. All destructing happens in parent texture class.

Reimplemented from Texture.

Definition at line 74 of file WebBrowserTexture.cxx.

Gets whether or not this texture is updating itself every time it is rendered.

Definition at line 147 of file WebBrowserTexture.cxx.

Gets the current internal AwWebView of this texture.

Definition at line 123 of file WebBrowserTexture.cxx.

bool WebBrowserTexture::has_cull_callback ( ) const [virtual]

Should be overridden by derived classes to return true if cull_callback() has been defined.

Otherwise, returns false to indicate cull_callback() does not need to be called for this node during the cull traversal.

This one returns true because it uses the cull traverser method to do the texture udpate.

Reimplemented from Texture.

Definition at line 101 of file WebBrowserTexture.cxx.

void WebBrowserTexture::set_flip_texture_active ( bool  active_flag)

This toggles on/off automatic flipping of the of the texture at a source level.

Awesomium renders things that are flipped vertically. This enables automatic flipping of that.

Since it is doing byte manipulation, this can get rather slow. Turning this on should be avoided. Instead, flipping should be taken care of via UV coordinates or shaders.

Definition at line 165 of file WebBrowserTexture.cxx.

void WebBrowserTexture::set_update_active ( bool  active_flag)

Gives the ability to toggle updating this texture or not.

This can be disabled to improve performance so that only the one that needs to be active is active.

Definition at line 136 of file WebBrowserTexture.cxx.

void WebBrowserTexture::set_web_view ( AwWebView aw_web_view)

Sets the internal AwWebView of this texture.

After calling this, the texture will automatically set it's width and height to match the AwWebView at the next time it is culled and rendered.

Definition at line 113 of file WebBrowserTexture.cxx.

Referenced by WebBrowserTexture().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations