Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
ParasiteBuffer Class Reference

This is a special GraphicsOutput type that acts a lot like a GraphicsBuffer, effectively allowing rendering to an offscreen buffer, except it does not create any framebuffer space for itself. More...

Inheritance diagram for ParasiteBuffer:
GraphicsOutput GraphicsOutputBase DrawableRegion TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject

List of all members.

Public Member Functions

 setSize (int x, int y)
 This is called by the GraphicsEngine to request that the buffer resize itself.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This is a special GraphicsOutput type that acts a lot like a GraphicsBuffer, effectively allowing rendering to an offscreen buffer, except it does not create any framebuffer space for itself.

Instead, it renders into the framebuffer owned by some other GraphicsOutput.

The x_size and y_size must therefore fit within the bounds of the source GraphicsOutput.

Since the framebuffer will be subsequently cleared when the actual owner draws in it later, this only makes sense if we are going to copy the contents of the framebuffer to a texture immediately after we draw it. Thus, has_texture() is implicitly true for a ParasiteBuffer.

This class is useful to render offscreen to a texture while preventing the waste of framebuffer memory for API's that are unable to render directly into a texture (and must render into a separate framebuffer first and then copy to texture). It is also the only way to render to a texture on API's that do not support offscreen rendering.


Member Function Documentation

static TypeHandle getClassType ( ) [static]

Reimplemented from GraphicsOutput.

setSize ( int  x,
int  y 
)

This is called by the GraphicsEngine to request that the buffer resize itself.

Although calls to get the size will return the new value, much of the actual resizing work doesn't take place until the next begin_frame. Not all buffers are resizeable.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties