GraphicsPipe

from panda3d.core import GraphicsPipe
class GraphicsPipe

Bases:

Bases: TypedReferenceCount

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.

Inheritance diagram

Inheritance diagram of GraphicsPipe

enum BufferCreationFlags
enumerator BF_refuse_parasite = 1

Flags that control what type of output is returned.

enumerator BF_require_parasite = 2
enumerator BF_refuse_window = 4
enumerator BF_require_window = 8
enumerator BF_require_callback_window = 16
enumerator BF_can_bind_color = 64

Need capability: bind the color bitplane to a tex.

enumerator BF_can_bind_every = 128

Need capability: bind all bitplanes to a tex.

enumerator BF_resizeable = 256

Buffer should allow set_size.

enumerator BF_size_track_host = 512

Buffer should track the host size.

enumerator BF_rtt_cumulative = 1024

Buffer supports cumulative render-to-texture.

enumerator BF_fb_props_optional = 2048

FrameBufferProperties can be ignored.

enumerator BF_size_square = 4096

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

enumerator BF_size_power_2 = 8192

x_size and y_size must each be a power of two

enumerator BF_can_bind_layered = 16384

Need capability: support RTM_bind_layered.

enum OutputTypes
enumerator OT_window = 1
enumerator OT_fullscreen_window = 2
enumerator OT_buffer = 4
enumerator OT_texture_buffer = 8
property display_height int

Returns the height of the entire display, if it is known. This may return 0. See the caveats for get_display_width().

property display_information DisplayInformation

Gets the pipe’s DisplayInformation.

property display_width int

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.

property display_zoom float

Returns the display zoom factor configured in the operating system. If the operating system automatically scales windows to match the DPI (such as when dpi-aware is set to false), this will be 1.0. Otherwise, this will be set to a value approximating the density of the monitor divided by the standard density of the operating system (usually 96), yielding a value like 1.5 or 2.0.

New in version 1.10.8.

static get_class_type() TypeHandle
get_display_height() int

Returns the height of the entire display, if it is known. This may return 0. See the caveats for get_display_width().

get_display_information() DisplayInformation

Gets the pipe’s DisplayInformation.

get_display_width() int

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.

get_display_zoom() float

Returns the display zoom factor configured in the operating system. If the operating system automatically scales windows to match the DPI (such as when dpi-aware is set to false), this will be 1.0. Otherwise, this will be set to a value approximating the density of the monitor divided by the standard density of the operating system (usually 96), yielding a value like 1.5 or 2.0.

New in version 1.10.8.

get_interface_name() str
get_supported_types() int

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.

property interface_name string
is_valid() bool

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.

lookup_cpu_data()

Looks up the detailed CPU information and stores it in _display_information, if supported by the OS. This may take a second or two.

supports_type(flags: int) bool

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.