osgViewer.GraphicsWindow¶
- class osgViewer.GraphicsWindow¶
- Represents
c++ class
- Wraps
osgViewer::GraphicsWindow
- Bases
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)¶
-
- Параметры
queue (
osgGA.EventQueue
) –
- :getEventQueue()¶
-
- Тип результата
- :checkEvents()¶
Check events, return
true
if events have been received.- Тип результата
bool
- :setWindowRectangle(int x, int y, int width, int height)¶
Set the window’s position and size.
- Параметры
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- Параметры
x (
int
) –y (
int
) –width (
int
) –height (
int
) –
- Тип результата
bool
- :getWindowRectangle()¶
Get the window’s position and size.
- :setWindowDecoration(bool wd)¶
Set Window decoration.
- Параметры
wd (
bool
) –
- :setWindowDecorationImplementation(bool wd)¶
Implementation of
setWindowDecoration
, should be implemented by derived classes- Параметры
wd (
bool
) –- Тип результата
bool
- :getWindowDecoration()¶
Set Window decoration.
- Тип результата
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
- Параметры
name (
std.string
) –
- :getWindowName()¶
Return the name of the window
- Тип результата
- :useCursor(bool cursorOn)¶
Switch on/off the cursor.
- Параметры
cursorOn (
bool
) –
- :setCursor(osgViewer.GraphicsWindow.MouseCursor cursor)¶
Set mouse cursor to a specific shape.
- Параметры
cursor (
osgViewer.GraphicsWindow.MouseCursor
) –
- :setSyncToVBlank(bool on)¶
Set sync-to-vblank.
- Параметры
on (
bool
) –
- :getSyncToVBlank()¶
-
- Тип результата
bool
- :setSwapGroup(bool on, GLenum.Value group, GLenum.Value barrier)¶
Set swap group.
- Параметры
on (
bool
) –group (
GLenum.Value
) –barrier (
GLenum.Value
) –
- :getSwapGroup()¶
- :valid()¶
Return whether a valid and usable
osg.GraphicsContext
has been created.- Тип результата
bool