|
@@ -148,6 +148,7 @@ GraphicsWindow(GraphicsPipe *pipe) : Configurable() {
|
|
|
_idle_callback = NULL;
|
|
_idle_callback = NULL;
|
|
|
_frame_number = 0;
|
|
_frame_number = 0;
|
|
|
_is_synced = false;
|
|
_is_synced = false;
|
|
|
|
|
+ _window_active = true;
|
|
|
_display_regions_stale = false;
|
|
_display_regions_stale = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -168,6 +169,7 @@ GraphicsWindow(GraphicsPipe *pipe,
|
|
|
_draw_callback = NULL;
|
|
_draw_callback = NULL;
|
|
|
_idle_callback = NULL;
|
|
_idle_callback = NULL;
|
|
|
_is_synced = false;
|
|
_is_synced = false;
|
|
|
|
|
+ _window_active = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
@@ -327,15 +329,6 @@ is_channel_defined(int index) const {
|
|
|
return (_channels[index] != (GraphicsChannel *)NULL);
|
|
return (_channels[index] != (GraphicsChannel *)NULL);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-// Function: GraphicsWindow::flag_redisplay
|
|
|
|
|
-// Access: Public, Virtual
|
|
|
|
|
-// Description:
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-void GraphicsWindow::
|
|
|
|
|
-flag_redisplay() {
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindow::declare_channel
|
|
// Function: GraphicsWindow::declare_channel
|
|
|
// Access: Protected
|
|
// Access: Protected
|
|
@@ -391,6 +384,80 @@ do_determine_display_regions() {
|
|
|
_display_regions_stale = false;
|
|
_display_regions_stale = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: GraphicsWindow::resized
|
|
|
|
|
+// Access: Public, Virtual
|
|
|
|
|
+// Description: Called whenever the window gets the resize event.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void GraphicsWindow::
|
|
|
|
|
+resized(const unsigned int x, const unsigned int y) {
|
|
|
|
|
+ Channels::iterator ci;
|
|
|
|
|
+ for (ci = _channels.begin(); ci != _channels.end(); ++ci) {
|
|
|
|
|
+ GraphicsChannel *chan = (*ci);
|
|
|
|
|
+ chan->window_resized(x, y);
|
|
|
|
|
+ }
|
|
|
|
|
+ _props._xsize = x;
|
|
|
|
|
+ _props._ysize = y;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: GraphicsWindow::make_scratch_display_region
|
|
|
|
|
+// Access: Public
|
|
|
|
|
+// Description: Allocates and returns a temporary DisplayRegion that
|
|
|
|
|
+// may be used to render offscreen into. This
|
|
|
|
|
+// DisplayRegion is not associated with any layer.
|
|
|
|
|
+//
|
|
|
|
|
+// To allocate a normal DisplayRegion for rendering, use
|
|
|
|
|
+// the interface provded in GraphicsLayer.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+PT(DisplayRegion) GraphicsWindow::
|
|
|
|
|
+make_scratch_display_region(int xsize, int ysize) const {
|
|
|
|
|
+ if (xsize > _props._xsize) {
|
|
|
|
|
+ display_cat.error()
|
|
|
|
|
+ << "GraphicsWindow::make_scratch_display_region() - x size is larger "
|
|
|
|
|
+ << "than window x size" << endl;
|
|
|
|
|
+ xsize = _props._xsize;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ysize > _props._ysize) {
|
|
|
|
|
+ display_cat.error()
|
|
|
|
|
+ << "GraphicsWindow::make_scratch_display_region() - y size is larger "
|
|
|
|
|
+ << "than window y size" << endl;
|
|
|
|
|
+ ysize = _props._ysize;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return new DisplayRegion(xsize, ysize);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: GraphicsWindow::make_current
|
|
|
|
|
+// Access: Public, Virtual
|
|
|
|
|
+// Description: Makes the window's graphics context the currently
|
|
|
|
|
+// active context that will be next rendered into by the
|
|
|
|
|
+// GSG, if this makes sense for the particular type of
|
|
|
|
|
+// GraphicsWindow.
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void GraphicsWindow::
|
|
|
|
|
+make_current(void) {
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: GraphicsWindow::unmake_current
|
|
|
|
|
+// Access: Public, Virtual
|
|
|
|
|
+// Description:
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void GraphicsWindow::
|
|
|
|
|
+unmake_current(void) {
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+// Function: GraphicsWindow::flag_redisplay
|
|
|
|
|
+// Access: Public, Virtual
|
|
|
|
|
+// Description:
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
|
|
+void GraphicsWindow::
|
|
|
|
|
+flag_redisplay() {
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindow::register_draw_function
|
|
// Function: GraphicsWindow::register_draw_function
|
|
|
// Access: Public, Virtual
|
|
// Access: Public, Virtual
|
|
@@ -450,71 +517,39 @@ end_frame() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: GraphicsWindow::resized
|
|
|
|
|
|
|
+// Function: GraphicsWindow::process_events
|
|
|
// Access: Public, Virtual
|
|
// Access: Public, Virtual
|
|
|
-// Description: Called whenever the window gets the resize event.
|
|
|
|
|
|
|
+// Description: Do whatever processing is necessary to ensure that
|
|
|
|
|
+// the window responds to user events.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindow::
|
|
void GraphicsWindow::
|
|
|
-resized(const unsigned int x, const unsigned int y) {
|
|
|
|
|
- Channels::iterator ci;
|
|
|
|
|
- for (ci = _channels.begin(); ci != _channels.end(); ++ci) {
|
|
|
|
|
- GraphicsChannel *chan = (*ci);
|
|
|
|
|
- chan->window_resized(x, y);
|
|
|
|
|
- }
|
|
|
|
|
- _props._xsize = x;
|
|
|
|
|
- _props._ysize = y;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-// Function: GraphicsWindow::make_scratch_display_region
|
|
|
|
|
-// Access: Public
|
|
|
|
|
-// Description: Allocates and returns a temporary DisplayRegion that
|
|
|
|
|
-// may be used to render offscreen into. This
|
|
|
|
|
-// DisplayRegion is not associated with any layer.
|
|
|
|
|
-//
|
|
|
|
|
-// To allocate a normal DisplayRegion for rendering, use
|
|
|
|
|
-// the interface provded in GraphicsLayer.
|
|
|
|
|
-////////////////////////////////////////////////////////////////////
|
|
|
|
|
-PT(DisplayRegion) GraphicsWindow::
|
|
|
|
|
-make_scratch_display_region(int xsize, int ysize) const {
|
|
|
|
|
- if (xsize > _props._xsize) {
|
|
|
|
|
- display_cat.error()
|
|
|
|
|
- << "GraphicsWindow::make_scratch_display_region() - x size is larger "
|
|
|
|
|
- << "than window x size" << endl;
|
|
|
|
|
- xsize = _props._xsize;
|
|
|
|
|
- }
|
|
|
|
|
- if (ysize > _props._ysize) {
|
|
|
|
|
- display_cat.error()
|
|
|
|
|
- << "GraphicsWindow::make_scratch_display_region() - y size is larger "
|
|
|
|
|
- << "than window y size" << endl;
|
|
|
|
|
- ysize = _props._ysize;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return new DisplayRegion(xsize, ysize);
|
|
|
|
|
|
|
+process_events() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: GraphicsWindow::make_current
|
|
|
|
|
|
|
+// Function: GraphicsWindow::deactivate_window
|
|
|
// Access: Public, Virtual
|
|
// Access: Public, Virtual
|
|
|
-// Description: Makes the window's graphics context the currently
|
|
|
|
|
-// active context that will be next rendered into by the
|
|
|
|
|
-// GSG, if this makes sense for the particular type of
|
|
|
|
|
-// GraphicsWindow.
|
|
|
|
|
|
|
+// Description: Indicates the window should stop rendering
|
|
|
|
|
+// temporarily, and does whatever else is associated
|
|
|
|
|
+// with that. This is normally called only by the
|
|
|
|
|
+// GraphicsWindow itself, or by the GSG.
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindow::
|
|
void GraphicsWindow::
|
|
|
-make_current(void) {
|
|
|
|
|
|
|
+deactivate_window() {
|
|
|
|
|
+ _window_active = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
-// Function: GraphicsWindow::unmake_current
|
|
|
|
|
|
|
+// Function: GraphicsWindow::reactivate_window
|
|
|
// Access: Public, Virtual
|
|
// Access: Public, Virtual
|
|
|
-// Description:
|
|
|
|
|
|
|
+// Description: Restores the normal window rendering behavior after a
|
|
|
|
|
+// previous call to deactivate_window().
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
void GraphicsWindow::
|
|
void GraphicsWindow::
|
|
|
-unmake_current(void) {
|
|
|
|
|
|
|
+reactivate_window() {
|
|
|
|
|
+ _window_active = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: GraphicsWindow::make_gsg
|
|
// Function: GraphicsWindow::make_gsg
|
|
|
// Access: Protected
|
|
// Access: Protected
|
|
@@ -659,7 +694,3 @@ get_depth_bitwidth(void) {
|
|
|
display_cat.warning() << "get_depth_bitwidth() unimplemented by " << get_type() << endl;
|
|
display_cat.warning() << "get_depth_bitwidth() unimplemented by " << get_type() << endl;
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-void GraphicsWindow::deactivate_window(void) { return; }
|
|
|
|
|
-void GraphicsWindow::reactivate_window(void) { return; }
|
|
|
|
|
-
|
|
|