Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
GraphicsPipe Class Reference

An object to create GraphicsOutputs that share a particular 3-D API. More...

#include "graphicsPipe.h"

Inheritance diagram for GraphicsPipe:
TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase eglGraphicsPipe IPhoneGraphicsPipe OsMesaGraphicsPipe osxGraphicsPipe TinyOffscreenGraphicsPipe WinGraphicsPipe x11GraphicsPipe wdxGraphicsPipe8 wdxGraphicsPipe9 wglGraphicsPipe glxGraphicsPipe

List of all members.

Public Types

enum  BufferCreationFlags {
  BF_refuse_parasite = 0x0001, BF_require_parasite = 0x0002, BF_refuse_window = 0x0004, BF_require_window = 0x0008,
  BF_require_callback_window = 0x0010, BF_can_bind_color = 0x0040, BF_can_bind_every = 0x0080, BF_resizeable = 0x0100,
  BF_size_track_host = 0x0200, BF_rtt_cumulative = 0x0400, BF_fb_props_optional = 0x0800, BF_size_square = 0x1000,
  BF_size_power_2 = 0x2000
}
enum  OutputTypes { OT_window = 0x0001, OT_fullscreen_window = 0x0002, OT_buffer = 0x0004, OT_texture_buffer = 0x0008 }
enum  PreferredWindowThread { PWT_app, PWT_draw }

Public Member Functions

virtual TypeHandle force_init_type ()
GraphicsDeviceget_device () const
 Returns a pointer to device object.
int get_display_height () const
 Returns the height of the entire display, if it is known.
DisplayInformationget_display_information ()
 Gets the pipe's DisplayInformation.
int get_display_width () const
 Returns the width of the entire display, if it is known.
virtual string get_interface_name () const =0
virtual PreferredWindowThread get_preferred_window_thread () const
 Returns an indication of the thread in which this GraphicsPipe requires its window processing to be performed: typically either the app thread (e.g.
int get_supported_types () const
 Returns the mask of bits that represents the kinds of GraphicsOutput objects this pipe might be able to successfully create.
virtual TypeHandle get_type () const
bool is_valid () const
 Returns false if this pipe is known to be invalid, meaning that an attempt to create a GraphicsWindow with the pipe will certainly fail.
virtual void lookup_cpu_data ()
 Looks up the detailed CPU information and stores it in _display_information, if supported by the OS.
virtual PT (GraphicsDevice) make_device(void *scrn
bool supports_type (int flags) const
 A convenience function to ask if a particular type or types of GraphicsObjects are supported.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

virtual void close_gsg (GraphicsStateGuardian *gsg)
 This will be called in the draw thread (the same thread in which the GSG was created via make_gsg, above) to close the indicated GSG and free its associated graphics objects just before it is destructed.
virtual PT (GraphicsOutput) make_output(const string &name
virtual PT (GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine)
 PT (GraphicsDevice) _device

Protected Attributes

int _display_height
DisplayInformation_display_information
int _display_width
bool _is_valid
LightMutex _lock
int _supported_types
virtual const
FrameBufferProperties const
WindowProperties int
GraphicsEngine
engine
virtual const
FrameBufferProperties
fb_prop
virtual const
FrameBufferProperties const
WindowProperties int 
flags
virtual const
FrameBufferProperties const
WindowProperties int
GraphicsEngine
GraphicsStateGuardian
gsg
virtual const
FrameBufferProperties const
WindowProperties int
GraphicsEngine
GraphicsStateGuardian
GraphicsOutput
host
virtual const
FrameBufferProperties const
WindowProperties int
GraphicsEngine
GraphicsStateGuardian
GraphicsOutput int bool & 
precertify
virtual const
FrameBufferProperties const
WindowProperties int
GraphicsEngine
GraphicsStateGuardian
GraphicsOutput int 
retry
virtual const
FrameBufferProperties const
WindowProperties
win_prop

Static Protected Attributes

static const int strip_properties []

Friends

class GraphicsEngine

Detailed Description

An object to create GraphicsOutputs that share a particular 3-D API.

Normally, there will only be one GraphicsPipe in an application, although it is possible to have multiple of these at once if there are multiple different API's available in the same machine.

Often, the GraphicsPipe corresponds to a physical output device, hence the term "pipe", but this is not necessarily the case.

The GraphicsPipe is used by the GraphicsEngine object to create and destroy windows; it keeps ownership of the windows it creates.

M. Asad added new/interim functionality where GraphicsPipe now contains a device interface to directx/opengl which will be used to handle multiple windows from same device.

Definition at line 58 of file graphicsPipe.h.


Member Function Documentation

void GraphicsPipe::close_gsg ( GraphicsStateGuardian gsg) [protected, virtual]

This will be called in the draw thread (the same thread in which the GSG was created via make_gsg, above) to close the indicated GSG and free its associated graphics objects just before it is destructed.

This method exists to provide a hook for the graphics pipe to do any necessary cleanup, if any.

Definition at line 115 of file graphicsPipe.cxx.

References GraphicsStateGuardian::close_gsg().

Returns a pointer to device object.

Definition at line 102 of file graphicsPipe.I.

Referenced by wdxGraphicsWindow8::open_window(), and wdxGraphicsWindow9::open_window().

int GraphicsPipe::get_display_height ( ) const [inline]

Returns the height of the entire display, if it is known.

This may return 0. See the caveats for get_display_width().

Definition at line 92 of file graphicsPipe.I.

Referenced by eglGraphicsWindow::set_properties_now(), and x11GraphicsWindow::set_properties_now().

Gets the pipe's DisplayInformation.

Definition at line 161 of file graphicsPipe.cxx.

int GraphicsPipe::get_display_width ( ) const [inline]

Returns the width of the entire display, if it is known.

This may return 0. This is not a guarantee that windows (particularly fullscreen windows) may not be created larger than this width, but it is intended to provide a hint to the application.

Definition at line 80 of file graphicsPipe.I.

Referenced by eglGraphicsWindow::set_properties_now(), and x11GraphicsWindow::set_properties_now().

GraphicsPipe::PreferredWindowThread GraphicsPipe::get_preferred_window_thread ( ) const [virtual]

Returns an indication of the thread in which this GraphicsPipe requires its window processing to be performed: typically either the app thread (e.g.

X) or the draw thread (Windows).

Reimplemented in eglGraphicsPipe, x11GraphicsPipe, IPhoneGraphicsPipe, and osxGraphicsPipe.

Definition at line 86 of file graphicsPipe.cxx.

int GraphicsPipe::get_supported_types ( ) const [inline]

Returns the mask of bits that represents the kinds of GraphicsOutput objects this pipe might be able to successfully create.

The return value is the union of bits in GraphicsPipe::OutputTypes that represents the set of GraphicsOutput types.

A 1 bit in a particular position is not a guarantee of success, but a 0 bit is a guarantee of failure.

Definition at line 47 of file graphicsPipe.I.

static void GraphicsPipe::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedReferenceCount.

Reimplemented in eglGraphicsPipe, wdxGraphicsPipe8, wdxGraphicsPipe9, glxGraphicsPipe, x11GraphicsPipe, IPhoneGraphicsPipe, wglGraphicsPipe, OsMesaGraphicsPipe, osxGraphicsPipe, TinyOffscreenGraphicsPipe, and WinGraphicsPipe.

Definition at line 147 of file graphicsPipe.h.

References TypedReferenceCount::init_type().

Referenced by WinGraphicsPipe::init_type(), TinyOffscreenGraphicsPipe::init_type(), osxGraphicsPipe::init_type(), OsMesaGraphicsPipe::init_type(), and IPhoneGraphicsPipe::init_type().

bool GraphicsPipe::is_valid ( ) const [inline]

Returns false if this pipe is known to be invalid, meaning that an attempt to create a GraphicsWindow with the pipe will certainly fail.

Returns true if the pipe is probably valid (is this case, an attempt to create a GraphicsWindow should succeed, but might still fail).

Use the GraphicsEngine class to create a GraphicsWindow on a particular pipe.

Definition at line 30 of file graphicsPipe.I.

void GraphicsPipe::lookup_cpu_data ( ) [virtual]

Looks up the detailed CPU information and stores it in _display_information, if supported by the OS.

This may take a second or two.

Reimplemented in WinGraphicsPipe.

Definition at line 173 of file graphicsPipe.cxx.

bool GraphicsPipe::supports_type ( int  flags) const [inline]

A convenience function to ask if a particular type or types of GraphicsObjects are supported.

The parameter is a union of one or more bits defined in GrpahicsPipe::OutputTypes.

Returns true if all of the requested types are listed in the supported_types mask, false if any one of them is not. This is not a guarantee that the indicated output type will successfully be created when it is attempted.

Definition at line 66 of file graphicsPipe.I.


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