Panda3D
graphicsWindow.I
1 // Filename: graphicsWindow.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: GraphicsWindow::is_closed
18 // Access: Published
19 // Description: Returns true if the window has not yet been opened,
20 // or has been fully closed, false if it is open. The
21 // window is not opened immediately after
22 // GraphicsEngine::make_window() is called; nor is it
23 // closed immediately after
24 // GraphicsEngine::remove_window() is called. Either
25 // operation may take a frame or two.
26 ////////////////////////////////////////////////////////////////////
27 INLINE bool GraphicsWindow::
28 is_closed() const {
29  return !_properties.get_open();
30 }
31 
32 ////////////////////////////////////////////////////////////////////
33 // Function: GraphicsWindow::is_fullscreen
34 // Access: Published
35 // Description: Returns true if the window has been opened as a
36 // fullscreen window, false otherwise.
37 ////////////////////////////////////////////////////////////////////
38 INLINE bool GraphicsWindow::
39 is_fullscreen() const {
40  return _properties.get_fullscreen();
41 }
42 
43 ////////////////////////////////////////////////////////////////////
44 // Function: GraphicsWindow::set_unexposed_draw
45 // Access: Published
46 // Description: If this flag is false, the window is redrawn only
47 // after it has received a recent "unexpose" or "draw"
48 // event from the underlying windowing systme. If this
49 // flag is true, the window is redrawn every frame
50 // regardless. Setting this false may prevent the
51 // window from redrawing unnecessarily when it is
52 // hidden, and may play nicer with other windows on the
53 // desktop, but may adversely affect frame rate even
54 // when the window is fully visible; setting it true will
55 // ensure that the window contents are always current.
56 ////////////////////////////////////////////////////////////////////
57 INLINE void GraphicsWindow::
58 set_unexposed_draw(bool unexposed_draw) {
59  _unexposed_draw = unexposed_draw;
60 }
61 
62 
63 ////////////////////////////////////////////////////////////////////
64 // Function: GraphicsWindow::get_unexposed_draw
65 // Access: Published
66 // Description: See set_unexposed_draw().
67 ////////////////////////////////////////////////////////////////////
68 INLINE bool GraphicsWindow::
70  return _unexposed_draw;
71 }
72 
73 ////////////////////////////////////////////////////////////////////
74 // Function: GraphicsWindow::get_window_handle
75 // Access: Published
76 // Description: Returns the WindowHandle corresponding to this window
77 // on the desktop. This is mainly useful for
78 // communicating with external libraries. Use
79 // window_handle->get_os_handle()->get_handle(), or
80 // window_handle->get_string_handle(), to get the actual
81 // OS-specific window handle object, whatever type that
82 // might be.
83 ////////////////////////////////////////////////////////////////////
86  return _window_handle;
87 }
88 
This object represents a window on the desktop, not necessarily a Panda window.
Definition: windowHandle.h:40
bool get_unexposed_draw() const
See set_unexposed_draw().
WindowHandle * get_window_handle() const
Returns the WindowHandle corresponding to this window on the desktop.
bool get_open() const
Returns true if the window is open.
bool get_fullscreen() const
Returns true if the window is in fullscreen mode.
void set_unexposed_draw(bool unexposed_draw)
If this flag is false, the window is redrawn only after it has received a recent "unexpose" or "draw"...
bool is_closed() const
Returns true if the window has not yet been opened, or has been fully closed, false if it is open...
bool is_fullscreen() const
Returns true if the window has been opened as a fullscreen window, false otherwise.