osgViewer.GraphicsWindow¶
-
class
osgViewer.
GraphicsWindow
¶ Represents: c++ class Wraps: osgViewer::GraphicsWindow Bases: osg.GraphicsContext
,osgGA.GUIActionAdapter
Base class for providing Windowing API agnostic access to creating and managing graphics window and events. Note, the
osgViewer.GraphicsWindow
is subclassed fromosg.GraphicsContext
, and to provide an implementation you’ll need to implement its range of pure virtual functions, you’ll find these all have naming conventionmethodNameImplementation(..)
.osgViewer.GraphicsWindow
adds the event queue on top of theosg.GraphicsContext
, thereby adding a mechanism for adapting Windowing events as well as basics graphics context work, you should wire up customGraphicsWindowImplementation
to push their events through into theosgGA.EventQueue
.Here is example of getting default GraphicsWindow and setup cursor appearance:
Methods:
-
:
setEventQueue
(osgGA.EventQueue queue)¶ -
Parameters: queue ( osgGA.EventQueue
) –
-
:
getEventQueue
()¶ -
Return type: osgGA.EventQueue
-
:
checkEvents
()¶ Check events, return
true
if events have been received.Return type: bool
-
:
setWindowRectangle
(int x, int y, int width, int height)¶ Set the window’s position and size.
Parameters: - x (
int
) – - y (
int
) – - width (
int
) – - height (
int
) –
- x (
-
:
setWindowRectangleImplementation
(int x, int y, int width, int height)¶ Implementation of
setWindowRectangle
, should be implemented by derived classesParameters: - x (
int
) – - y (
int
) – - width (
int
) – - height (
int
) –
Return type: bool
- x (
-
:
getWindowRectangle
()¶ Get the window’s position and size.
-
:
setWindowDecoration
(bool wd)¶ Set Window decoration.
Parameters: wd ( bool
) –
-
:
setWindowDecorationImplementation
(bool wd)¶ Implementation of
setWindowDecoration
, should be implemented by derived classesParameters: wd ( bool
) –Return type: bool
-
:
getWindowDecoration
()¶ Set Window decoration.
Return type: bool
-
:
grabFocus
()¶ Get focus.
-
:
grabFocusIfPointerInWindow
()¶ Get focus on if the pointer is in this window.
-
:
raiseWindow
()¶ Raise the window to the top.
-
:
setWindowName
(std.string name)¶ Set the name of the window
Parameters: name ( std.string
) –
-
:
getWindowName
()¶ Return the name of the window
Return type: std.string
-
:
useCursor
(bool cursorOn)¶ Switch on/off the cursor.
Parameters: cursorOn ( bool
) –
-
:
setCursor
(osgViewer.GraphicsWindow.MouseCursor cursor)¶ Set mouse cursor to a specific shape.
Parameters: cursor ( osgViewer.GraphicsWindow.MouseCursor
) –
-
:
setSyncToVBlank
(bool on)¶ Set sync-to-vblank.
Parameters: on ( bool
) –
-
:
getSyncToVBlank
()¶ -
Return type: bool
-
:
setSwapGroup
(bool on, GLenum.Value group, GLenum.Value barrier)¶ Set swap group.
Parameters: - on (
bool
) – - group (
GLenum.Value
) – - barrier (
GLenum.Value
) –
- on (
-
:
getSwapGroup
()¶
-
:
valid
()¶ Return whether a valid and usable
osg.GraphicsContext
has been created.Return type: bool
-
: