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 from osg.GraphicsContext, and to provide an implementation you’ll need to implement its range of pure virtual functions, you’ll find these all have naming convention methodNameImplementation(..). osgViewer.GraphicsWindow adds the event queue on top of the osg.GraphicsContext, thereby adding a mechanism for adapting Windowing events as well as basics graphics context work, you should wire up custom GraphicsWindowImplementation to push their events through into the osgGA.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) –
:setWindowRectangleImplementation(int x, int y, int width, int height)

Implementation of setWindowRectangle, should be implemented by derived classes

Parameters:
  • x (int) –
  • y (int) –
  • width (int) –
  • height (int) –
Return type:

bool

: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 classes

Parameters: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:
:getSwapGroup()

:valid()

Return whether a valid and usable osg.GraphicsContext has been created.

Return type:bool