From 9b5662b6359c30d2e716ab319fc1ca251e7c1c76 Mon Sep 17 00:00:00 2001 From: cxgeorge <> Date: Thu, 7 Mar 2002 05:36:47 +0000 Subject: [PATCH] add cursor-visible --- panda/src/chancfg/chancfg.cxx | 3 ++- panda/src/display/graphicsWindow.I | 13 +++++++++++++ panda/src/display/graphicsWindow.h | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/panda/src/chancfg/chancfg.cxx b/panda/src/chancfg/chancfg.cxx index 938ea4a135..577621bf96 100644 --- a/panda/src/chancfg/chancfg.cxx +++ b/panda/src/chancfg/chancfg.cxx @@ -389,7 +389,7 @@ ChanConfig::ChanConfig(GraphicsPipe* pipe, std::string cfg, Node *render, bool border = !chanconfig.GetBool("no-border", !W.getBorder()); bool fullscreen = chanconfig.GetBool("fullscreen", false); - // bool cursor = chanconfig.GetBool("cursor-visible", W.getCursor()); + bool use_cursor = chanconfig.GetBool("cursor-visible", W.getCursor()); int want_depth_bits = chanconfig.GetInt("want-depth-bits", 1); int want_color_bits = chanconfig.GetInt("want-color-bits", 1); @@ -412,6 +412,7 @@ ChanConfig::ChanConfig(GraphicsPipe* pipe, std::string cfg, Node *render, props._fullscreen = fullscreen; props._want_depth_bits = want_depth_bits; props._want_color_bits = want_color_bits; + props._bCursorIsVisible = use_cursor; // stereo prep? // DVR prep? diff --git a/panda/src/display/graphicsWindow.I b/panda/src/display/graphicsWindow.I index a538985b57..a51d69f488 100644 --- a/panda/src/display/graphicsWindow.I +++ b/panda/src/display/graphicsWindow.I @@ -43,6 +43,7 @@ INLINE GraphicsWindow::Properties::Properties(const Properties &InitProp) { _mask=InitProp._mask; _want_depth_bits=InitProp._want_depth_bits; _want_color_bits=InitProp._want_color_bits; + _bCursorIsVisible=InitProp._bCursorIsVisible; } //////////////////////////////////////////////////////////////////// @@ -107,6 +108,18 @@ set_fullscreen(bool fullscreen) { _fullscreen = fullscreen; } +/* +//////////////////////////////////////////////////////////////////// +// Function: GraphicsWindow::Properties::set_cursor_visible +// Access: Published +// Description: Specifies if mouse cursor is visible +//////////////////////////////////////////////////////////////////// +INLINE void GraphicsWindow::Properties:: +set_cursor_visible(bool IsVisible) { + _bCursorIsVisible=IsVisible; // note: gsg should override to implement +} +*/ + //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::Properties::set_mask // Access: Published diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index e5af6d657c..139465e49e 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -93,6 +93,7 @@ PUBLISHED: string _title; bool _border; bool _fullscreen; + bool _bCursorIsVisible; uint _mask; int _want_depth_bits; int _want_color_bits; @@ -135,6 +136,10 @@ PUBLISHED: INLINE void set_sync(const bool); INLINE bool get_sync() const; + // since this requires gsg modification, dont worry about implementing it yet + // since init control is good enough + // virtual void set_cursor_visible(bool bIsVisible); // should be overridden by gsg to implement + // resize the window to the given size virtual void resize(unsigned int xsize,unsigned int ysize);