From 650f84aeef7a3f16b451334898363b188ea4a24c Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 13 Jan 2002 19:34:07 +0000 Subject: [PATCH] expose some more stuff --- panda/src/display/graphicsWindow.I | 97 ++++++++++++++++++++++++++++ panda/src/display/graphicsWindow.cxx | 4 +- panda/src/display/graphicsWindow.h | 15 ++++- 3 files changed, 112 insertions(+), 4 deletions(-) diff --git a/panda/src/display/graphicsWindow.I b/panda/src/display/graphicsWindow.I index 23920519c4..77d5994e78 100644 --- a/panda/src/display/graphicsWindow.I +++ b/panda/src/display/graphicsWindow.I @@ -18,6 +18,103 @@ #include +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::Destructor +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE GraphicsWindow::Properties:: +~Properties() { +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_origin +// Access: Published +// Description: Specifies the origin on the screen (in pixels, +// relative to the top-left corner) at which the window +// should appear. This is the origin of the top-left +// corner of the useful part of the window, not +// including decorations. +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_origin(int xorg, int yorg) { + _xorg = xorg; + _yorg = yorg; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_size +// Access: Published +// Description: Specifies the requested size of the window, in +// pixels. This is the size of the useful part of the +// window, not including decorations. +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_size(int xsize, int ysize) { + _xsize = xsize; + _ysize = ysize; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_title +// Access: Published +// Description: Specifies the title that should be assigned to the +// window. +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_title(const string &title) { + _title = title; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_border +// Access: Published +// Description: Specifies whether the window should be created with a +// border (true, the default) or not (false). +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_border(bool border) { + _border = border; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_fullscreen +// Access: Published +// Description: Specifies whether the window should be opened in +// fullscreen mode (true) or normal windowed mode +// (false, the default). +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_fullscreen(bool fullscreen) { + _fullscreen = fullscreen; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_mask +// Access: Published +// Description: Specifies the set of graphics properties that are +// required for the context associated with the window. +// This should be the union of the appropriate bits +// defined in WindowModeType. +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_mask(uint mask) { + _mask = mask; +} + +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_bit_depth +// Access: Published +// Description: Specifies the minimum number of bits that are +// required for the depth buffer and color buffer, +// respectively. +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_bit_depth(int want_depth_bits, int want_color_bits) { + _want_depth_bits = want_depth_bits; + _want_color_bits = want_color_bits; +} + //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::get_properties // Access: Published diff --git a/panda/src/display/graphicsWindow.cxx b/panda/src/display/graphicsWindow.cxx index a2c1e1c464..e892702544 100644 --- a/panda/src/display/graphicsWindow.cxx +++ b/panda/src/display/graphicsWindow.cxx @@ -45,7 +45,7 @@ PStatCollector GraphicsWindow::_make_current_pcollector("Draw:Make current"); //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::Properties::Constructor -// Access: Public +// Access: Published // Description: //////////////////////////////////////////////////////////////////// GraphicsWindow::Properties:: @@ -54,7 +54,7 @@ Properties() { _yorg = 0; _xsize = 512; _ysize = 512; - _title = ""; + _title = "Panda"; _border = true; _fullscreen = false; _mask = W_RGBA | W_DOUBLE | W_DEPTH; diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index 0949b6afb1..40b852486b 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -69,10 +69,20 @@ class GraphicsWindow; // Description : //////////////////////////////////////////////////////////////////// class EXPCL_PANDA GraphicsWindow : public Configurable, public ReferenceCount { -public: +PUBLISHED: class EXPCL_PANDA Properties { - public: + PUBLISHED: Properties(); + INLINE ~Properties(); + + INLINE void set_origin(int xorg, int yorg); + INLINE void set_size(int xsize, int ysize); + INLINE void set_title(const string &title); + INLINE void set_border(bool border); + INLINE void set_fullscreen(bool fullscreen); + INLINE void set_mask(uint mask); + INLINE void set_bit_depth(int want_depth_bits, int want_color_bits); + public: int _xorg; int _yorg; @@ -86,6 +96,7 @@ public: int _want_color_bits; }; +public: class EXPCL_PANDA Callback { public: virtual void draw(bool);