expose some more stuff

This commit is contained in:
David Rose 2002-01-13 19:34:07 +00:00
parent 38bb65887c
commit 650f84aeef
3 changed files with 112 additions and 4 deletions

View File

@ -18,6 +18,103 @@
#include <notify.h>
////////////////////////////////////////////////////////////////////
// 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

View File

@ -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;

View File

@ -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);