Panda3D
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
GraphicsBuffer Class Reference

An offscreen buffer for rendering into. More...

#include "graphicsBuffer.h"

Inheritance diagram for GraphicsBuffer:
GraphicsOutput GraphicsOutputBase DrawableRegion TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase eglGraphicsBuffer eglGraphicsPixmap glxGraphicsBuffer glxGraphicsPixmap OsMesaGraphicsBuffer osxGraphicsBuffer TinyGraphicsBuffer wdxGraphicsBuffer8 wdxGraphicsBuffer9 wglGraphicsBuffer

List of all members.

Public Member Functions

virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const
virtual void process_events ()
 Honor any requests recently made via request_open() or request_close().
virtual void request_close ()
 This is called by the GraphicsEngine to request that the buffer (or whatever) close itself or, in general, make itself invalid, at the next call to process_events().
virtual void request_open ()
 This is called by the GraphicsEngine to request that the buffer (or whatever) open itself or, in general, make itself valid, at the next call to process_events().
virtual void set_close_now ()
 This is called by the GraphicsEngine to insist that the buffer be closed immediately.
void set_size (int x, int y)
 This is called by the GraphicsEngine to request that the buffer resize itself.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Types

enum  OpenRequest { OR_none, OR_open, OR_close }

Protected Member Functions

 GraphicsBuffer (GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host)
 Normally, the GraphicsBuffer constructor is not called directly; these are created instead via the GraphicsEngine::make_buffer() function.
virtual void close_buffer ()
 Closes the buffer right now.
virtual bool open_buffer ()
 Opens the buffer right now.

Protected Attributes

OpenRequest _open_request

Detailed Description

An offscreen buffer for rendering into.

This is similar in function to a GraphicsWindow, except that the output is not visible to the user.

Definition at line 30 of file graphicsBuffer.h.


Constructor & Destructor Documentation

GraphicsBuffer::GraphicsBuffer ( GraphicsEngine engine,
GraphicsPipe pipe,
const string &  name,
const FrameBufferProperties fb_prop,
const WindowProperties win_prop,
int  flags,
GraphicsStateGuardian gsg,
GraphicsOutput host 
) [protected]

Normally, the GraphicsBuffer constructor is not called directly; these are created instead via the GraphicsEngine::make_buffer() function.

Definition at line 27 of file graphicsBuffer.cxx.

References GraphicsOutput::get_name().


Member Function Documentation

void GraphicsBuffer::close_buffer ( ) [protected, virtual]

Closes the buffer right now.

Called from the window thread.

Reimplemented in wglGraphicsBuffer, wdxGraphicsBuffer9, wdxGraphicsBuffer8, glxGraphicsPixmap, eglGraphicsPixmap, OsMesaGraphicsBuffer, osxGraphicsBuffer, eglGraphicsBuffer, glxGraphicsBuffer, and TinyGraphicsBuffer.

Definition at line 155 of file graphicsBuffer.cxx.

Referenced by process_events(), and set_close_now().

bool GraphicsBuffer::open_buffer ( ) [protected, virtual]

Opens the buffer right now.

Called from the window thread. Returns true if the buffer is successfully opened, or false if there was a problem.

Reimplemented in wglGraphicsBuffer, wdxGraphicsBuffer9, wdxGraphicsBuffer8, glxGraphicsPixmap, eglGraphicsPixmap, OsMesaGraphicsBuffer, osxGraphicsBuffer, eglGraphicsBuffer, glxGraphicsBuffer, and TinyGraphicsBuffer.

Definition at line 168 of file graphicsBuffer.cxx.

Referenced by process_events().

void GraphicsBuffer::process_events ( ) [virtual]

Honor any requests recently made via request_open() or request_close().

This function is called only within the window thread.

Reimplemented from GraphicsOutput.

Reimplemented in wglGraphicsBuffer, wdxGraphicsBuffer8, and wdxGraphicsBuffer9.

Definition at line 125 of file graphicsBuffer.cxx.

References close_buffer(), open_buffer(), and GraphicsOutput::set_inverted().

void GraphicsBuffer::request_close ( ) [virtual]

This is called by the GraphicsEngine to request that the buffer (or whatever) close itself or, in general, make itself invalid, at the next call to process_events().

By that time we promise the gsg pointer will be cleared.

Reimplemented from GraphicsOutput.

Definition at line 98 of file graphicsBuffer.cxx.

void GraphicsBuffer::request_open ( ) [virtual]

This is called by the GraphicsEngine to request that the buffer (or whatever) open itself or, in general, make itself valid, at the next call to process_events().

Reimplemented from GraphicsOutput.

Definition at line 84 of file graphicsBuffer.cxx.

void GraphicsBuffer::set_close_now ( ) [virtual]

This is called by the GraphicsEngine to insist that the buffer be closed immediately.

This is only called from the buffer thread.

Reimplemented from GraphicsOutput.

Definition at line 110 of file graphicsBuffer.cxx.

References close_buffer().

void GraphicsBuffer::set_size ( 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.

Definition at line 67 of file graphicsBuffer.cxx.

References GraphicsOutput::set_size_and_recalc().


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