Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GraphicsPipe Class Reference

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

Inheritance diagram for GraphicsPipe:
TypedReferenceCount TypedObject ReferenceCount

Public Types

enum  BufferCreationFlags {
  BF_refuse_parasite = 1, BF_require_parasite = 2, BF_refuse_window = 4, BF_require_window = 8,
  BF_require_callback_window = 16, BF_can_bind_color = 64, BF_can_bind_every = 128, BF_resizeable = 256,
  BF_size_track_host = 512, BF_rtt_cumulative = 1024, BF_fb_props_optional = 2048, BF_size_square = 4096,
  BF_size_power_2 = 8192, BF_can_bind_layered = 16384
}
 
enum  OutputTypes { OT_window = 1, OT_fullscreen_window = 2, OT_buffer = 4, OT_texture_buffer = 8 }
 

Public Member Functions

int getDisplayHeight ()
 Returns the height of the entire display, if it is known. More...
 
DisplayInformation getDisplayInformation ()
 Gets the pipe's DisplayInformation. More...
 
int getDisplayWidth ()
 Returns the width of the entire display, if it is known. More...
 
str getInterfaceName ()
 
int getSupportedTypes ()
 Returns the mask of bits that represents the kinds of GraphicsOutput objects this pipe might be able to successfully create. More...
 
bool isValid ()
 Returns false if this pipe is known to be invalid, meaning that an attempt to create a GraphicsWindow with the pipe will certainly fail. More...
 
 lookupCpuData ()
 Looks up the detailed CPU information and stores it in _display_information, if supported by the OS. More...
 
bool supportsType (int flags)
 A convenience function to ask if a particular type or types of GraphicsObjects are supported. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Public Attributes

int display_height
 Returns the height of the entire display, if it is known. More...
 
DisplayInformation display_information
 Gets the pipe's DisplayInformation. More...
 
int display_width
 Returns the width of the entire display, if it is known. More...
 
String interface_name
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 

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.

Member Enumeration Documentation

◆ BufferCreationFlags

Enumerator
BF_refuse_parasite 

Flags that control what type of output is returned.

BF_require_parasite 
BF_refuse_window 
BF_require_window 
BF_require_callback_window 
BF_can_bind_color 

Need capability: bind the color bitplane to a tex.

BF_can_bind_every 

Need capability: bind all bitplanes to a tex.

BF_resizeable 

Buffer should allow set_size.

BF_size_track_host 

Buffer should track the host size.

BF_rtt_cumulative 

Buffer supports cumulative render-to-texture.

BF_fb_props_optional 

FrameBufferProperties can be ignored.

BF_size_square 

x_size must equal y_size (e.g. for cube maps)

BF_size_power_2 

x_size and y_size must each be a power of two

BF_can_bind_layered 

Need capability: support RTM_bind_layered.

◆ OutputTypes

Enumerator
OT_window 
OT_fullscreen_window 
OT_buffer 
OT_texture_buffer 

Member Function Documentation

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getDisplayHeight()

int getDisplayHeight ( )

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

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

◆ getDisplayInformation()

DisplayInformation getDisplayInformation ( )

Gets the pipe's DisplayInformation.

◆ getDisplayWidth()

int getDisplayWidth ( )

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.

◆ getInterfaceName()

str getInterfaceName ( )

◆ getSupportedTypes()

int getSupportedTypes ( )

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.

◆ isValid()

bool isValid ( )

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.

◆ lookupCpuData()

lookupCpuData ( )

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

This may take a second or two.

◆ supportsType()

bool supportsType ( int  flags)

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.

Member Data Documentation

◆ display_height

int display_height

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

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

◆ display_information

DisplayInformation display_information

Gets the pipe's DisplayInformation.

◆ display_width

int display_width

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.

◆ interface_name

String interface_name