Panda3D
graphicsPipe.I
1 // Filename: graphicsPipe.I
2 // Created by: frang (07Mar99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: GraphicsPipe::is_valid
18 // Access: Published
19 // Description: Returns false if this pipe is known to be invalid,
20 // meaning that an attempt to create a GraphicsWindow
21 // with the pipe will certainly fail. Returns true if
22 // the pipe is probably valid (is this case, an attempt
23 // to create a GraphicsWindow should succeed, but might
24 // still fail).
25 //
26 // Use the GraphicsEngine class to create a
27 // GraphicsWindow on a particular pipe.
28 ////////////////////////////////////////////////////////////////////
29 INLINE bool GraphicsPipe::
30 is_valid() const {
31  return _is_valid;
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: GraphicsPipe::get_supported_types
36 // Access: Published
37 // Description: Returns the mask of bits that represents the kinds of
38 // GraphicsOutput objects this pipe might be able to
39 // successfully create. The return value is the union
40 // of bits in GraphicsPipe::OutputTypes that represents
41 // the set of GraphicsOutput types.
42 //
43 // A 1 bit in a particular position is not a guarantee
44 // of success, but a 0 bit is a guarantee of failure.
45 ////////////////////////////////////////////////////////////////////
46 INLINE int GraphicsPipe::
48  return _supported_types;
49 }
50 
51 ////////////////////////////////////////////////////////////////////
52 // Function: GraphicsPipe::supports_type
53 // Access: Published
54 // Description: A convenience function to ask if a particular type or
55 // types of GraphicsObjects are supported. The
56 // parameter is a union of one or more bits defined in
57 // GrpahicsPipe::OutputTypes.
58 //
59 // Returns true if all of the requested types are listed
60 // in the supported_types mask, false if any one of them
61 // is not. This is not a guarantee that the indicated
62 // output type will successfully be created when it is
63 // attempted.
64 ////////////////////////////////////////////////////////////////////
65 INLINE bool GraphicsPipe::
66 supports_type(int flags) const {
67  return (_supported_types & flags) == flags;
68 }
69 
70 ////////////////////////////////////////////////////////////////////
71 // Function: GraphicsPipe::get_display_width
72 // Access: Published
73 // Description: Returns the width of the entire display, if it is
74 // known. This may return 0. This is not a guarantee
75 // that windows (particularly fullscreen windows) may
76 // not be created larger than this width, but it is
77 // intended to provide a hint to the application.
78 ////////////////////////////////////////////////////////////////////
79 INLINE int GraphicsPipe::
81  return _display_width;
82 }
83 
84 ////////////////////////////////////////////////////////////////////
85 // Function: GraphicsPipe::get_display_height
86 // Access: Published
87 // Description: Returns the height of the entire display, if it is
88 // known. This may return 0. See the caveats for
89 // get_display_width().
90 ////////////////////////////////////////////////////////////////////
91 INLINE int GraphicsPipe::
93  return _display_height;
94 }
95 
96 ////////////////////////////////////////////////////////////////////
97 // Function: GraphicsPipe::get_device
98 // Access: Public
99 // Description: Returns a pointer to device object
100 ////////////////////////////////////////////////////////////////////
102 get_device() const {
103  return _device;
104 }
105 
int get_display_width() const
Returns the width of the entire display, if it is known.
Definition: graphicsPipe.I:80
int get_display_height() const
Returns the height of the entire display, if it is known.
Definition: graphicsPipe.I:92
int get_supported_types() const
Returns the mask of bits that represents the kinds of GraphicsOutput objects this pipe might be able ...
Definition: graphicsPipe.I:47
bool supports_type(int flags) const
A convenience function to ask if a particular type or types of GraphicsObjects are supported...
Definition: graphicsPipe.I:66
An abstract device object that is part of Graphics Pipe.
bool is_valid() const
Returns false if this pipe is known to be invalid, meaning that an attempt to create a GraphicsWindow...
Definition: graphicsPipe.I:30
GraphicsDevice * get_device() const
Returns a pointer to device object.
Definition: graphicsPipe.I:102