Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends

wglGraphicsBuffer Class Reference

An offscreen render buffer. More...

#include "wglGraphicsBuffer.h"

Inheritance diagram for wglGraphicsBuffer:
GraphicsBuffer GraphicsOutput GraphicsOutputBase DrawableRegion TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Member Functions

 wglGraphicsBuffer (GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host)
virtual bool begin_frame (FrameMode mode, Thread *current_thread)
 This function will be called within the draw thread before beginning rendering for a given frame.
virtual void end_frame (FrameMode mode, Thread *current_thread)
 This function will be called within the draw thread after rendering is completed for a given frame.
virtual TypeHandle force_init_type ()
virtual bool get_supports_render_texture () const
 Returns true if this particular GraphicsOutput can render directly into a texture, or false if it must always copy-to-texture at the end of each frame to achieve this effect.
virtual TypeHandle get_type () const
virtual void process_events ()
 Do whatever processing is necessary to ensure that the window responds to user events.
virtual void select_cube_map (int cube_map_index)
 Called internally when the window is in render-to-a-texture mode and we are in the process of rendering the six faces of a cube map.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Protected Member Functions

virtual void close_buffer ()
 Closes the buffer right now.
virtual bool open_buffer ()
 Opens the window right now.

Friends

class wglGraphicsStateGuardian

Detailed Description

An offscreen render buffer.

In OpenGL under Windows, this simply renders into a window that is never made visible. There's a Windows interface for rendering into a DIB, but this puts restrictions on the kind of pixelformat we can use, and thus makes it difficult to support one GSG rendering into an offscreen buffer and also into a window.

Definition at line 38 of file wglGraphicsBuffer.h.


Member Function Documentation

bool wglGraphicsBuffer::begin_frame ( FrameMode  mode,
Thread current_thread 
) [virtual]

This function will be called within the draw thread before beginning rendering for a given frame.

It should do whatever setup is required, and return true if the frame should be rendered, or false if it should be skipped.

Reimplemented from GraphicsOutput.

Definition at line 69 of file wglGraphicsBuffer.cxx.

References GraphicsOutput::begin_frame_spam(), GraphicsOutput::clear_cube_map_selection(), wglGraphicsStateGuardian::get_context(), and GraphicsOutput::get_fb_properties().

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

Closes the buffer right now.

Called from the window thread.

Reimplemented from GraphicsBuffer.

Definition at line 282 of file wglGraphicsBuffer.cxx.

void wglGraphicsBuffer::end_frame ( FrameMode  mode,
Thread current_thread 
) [virtual]

This function will be called within the draw thread after rendering is completed for a given frame.

It should do whatever finalization is required.

Reimplemented from GraphicsOutput.

Definition at line 120 of file wglGraphicsBuffer.cxx.

References GraphicsOutput::clear_cube_map_selection(), GraphicsOutput::copy_to_textures(), GraphicsOutput::end_frame_spam(), and GraphicsOutput::trigger_flip().

bool wglGraphicsBuffer::get_supports_render_texture ( ) const [virtual]

Returns true if this particular GraphicsOutput can render directly into a texture, or false if it must always copy-to-texture at the end of each frame to achieve this effect.

Reimplemented from GraphicsOutput.

Definition at line 265 of file wglGraphicsBuffer.cxx.

References wglGraphicsStateGuardian::get_supports_wgl_render_texture().

bool wglGraphicsBuffer::open_buffer ( ) [protected, virtual]
void wglGraphicsBuffer::process_events ( ) [virtual]

Do whatever processing is necessary to ensure that the window responds to user events.

Also, honor any requests recently made via request_properties()

This function is called only within the window thread.

Reimplemented from GraphicsBuffer.

Definition at line 243 of file wglGraphicsBuffer.cxx.

void wglGraphicsBuffer::select_cube_map ( int  cube_map_index) [virtual]

Called internally when the window is in render-to-a-texture mode and we are in the process of rendering the six faces of a cube map.

This should do whatever needs to be done to switch the buffer to the indicated face.

Reimplemented from GraphicsOutput.

Definition at line 212 of file wglGraphicsBuffer.cxx.


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