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

wdxGraphicsBuffer9 Class Reference

An offscreen render buffer. More...

#include "wdxGraphicsBuffer9.h"

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

List of all members.

Public Member Functions

 wdxGraphicsBuffer9 (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 TypeHandle get_type () const
virtual void process_events ()
 Do whatever processing is necessary to ensure that the window responds to user events.
void register_shared_depth_buffer (GraphicsOutput *graphics_output)
 Register/save who is sharing the depth buffer.
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.
virtual bool share_depth_buffer (GraphicsOutput *graphics_output)
 Will attempt to use the depth buffer of the input graphics_output.
void unregister_shared_depth_buffer (GraphicsOutput *graphics_output)
 Unregister who is sharing the depth buffer.
virtual void unshare_depth_buffer ()
 Discontinue sharing the depth buffer.

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 DXGraphicsStateGuardian9
class DXTextureContext9

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 33 of file wdxGraphicsBuffer9.h.


Member Function Documentation

bool wdxGraphicsBuffer9::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 129 of file wdxGraphicsBuffer9.cxx.

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

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

Closes the buffer right now.

Called from the window thread.

Reimplemented from GraphicsBuffer.

Definition at line 739 of file wdxGraphicsBuffer9.cxx.

void wdxGraphicsBuffer9::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 162 of file wdxGraphicsBuffer9.cxx.

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

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

Opens the window right now.

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

Reimplemented from GraphicsBuffer.

Definition at line 762 of file wdxGraphicsBuffer9.cxx.

void wdxGraphicsBuffer9::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 719 of file wdxGraphicsBuffer9.cxx.

void wdxGraphicsBuffer9::register_shared_depth_buffer ( GraphicsOutput graphics_output)

Register/save who is sharing the depth buffer.

Definition at line 907 of file wdxGraphicsBuffer9.cxx.

Referenced by share_depth_buffer().

void wdxGraphicsBuffer9::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 590 of file wdxGraphicsBuffer9.cxx.

References GraphicsOutput::count_textures(), Texture::get_format(), GraphicsOutput::get_texture(), GraphicsOutput::get_texture_plane(), Texture::get_texture_type(), and Texture::prepare_now().

bool wdxGraphicsBuffer9::share_depth_buffer ( GraphicsOutput graphics_output) [virtual]

Will attempt to use the depth buffer of the input graphics_output.

The buffer sizes must be exactly the same.

Reimplemented from GraphicsOutput.

Definition at line 839 of file wdxGraphicsBuffer9.cxx.

References GraphicsOutput::get_x_size(), GraphicsOutput::get_y_size(), register_shared_depth_buffer(), and unshare_depth_buffer().

void wdxGraphicsBuffer9::unregister_shared_depth_buffer ( GraphicsOutput graphics_output)

Unregister who is sharing the depth buffer.

Definition at line 923 of file wdxGraphicsBuffer9.cxx.

Referenced by unshare_depth_buffer().

void wdxGraphicsBuffer9::unshare_depth_buffer ( ) [virtual]

Discontinue sharing the depth buffer.

Reimplemented from GraphicsOutput.

Definition at line 888 of file wdxGraphicsBuffer9.cxx.

References unregister_shared_depth_buffer().

Referenced by share_depth_buffer().


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