Panda3D
|
An offscreen render buffer. More...
#include "wglGraphicsBuffer.h"
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 |
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.
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 287 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 125 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 270 of file wglGraphicsBuffer.cxx.
References wglGraphicsStateGuardian::get_supports_wgl_render_texture().
bool wglGraphicsBuffer::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 308 of file wglGraphicsBuffer.cxx.
References wglGraphicsStateGuardian::choose_pixel_format(), wglGraphicsStateGuardian::get_context(), wglGraphicsStateGuardian::get_fb_properties(), wglGraphicsStateGuardian::get_twindow_dc(), wglGraphicsStateGuardian::pfnum_supports_pbuffer(), FrameBufferProperties::subsumes(), and FrameBufferProperties::verify_hardware_software().
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 248 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 217 of file wglGraphicsBuffer.cxx.