GIR Windows {gir}R Documentation

GIR Window Management

Description

These functions create, destroy, return information about, and otherwise manage GIR windows.

Usage

        girCreateWindow(width = 320, height = 240, caption = "GIR Window",
                        sizeable = TRUE, doevents = FALSE)
        girDestroyWindow(ind = 0)
        girGetCurrentWindow()
        girSetCurrentWindow(ind = 0)
        girSwapBuffers(ind = 0)
        girListWindows()
        girFocusWindow(ind = 0)
        girSetDoEvents(doevents, ind = 0)
        girWindowInfo(ind)

Arguments

ind vector of integers; containing the indices of windows on which to operate. An ind of 0 specifies the current window. (note: girSetCurrentWindow requires ind to be of length 1. All others may be called with vectors of any length.)
width,height initial size of the window.
caption caption to be displayed by the windowing system.
sizeable logical; if 'TRUE', the user will be able to resize the window from its initial dimensions. This may not be honoured by the windowing system.
doevents logical; if 'TRUE', event processing for the window will be enabled (see girProcessEvents).

Details

girCreateWindow creates a window with the specified size and caption, an RGB depth of 8 bits per channel, a Z depth of 16, and a back buffer; then optionally enables events, gives the newly created window focus, and sets it as current.

girGetCurrentWindow and girSetCurrentWindow retrieve and specify the index of the 'current window'. Only one window may be 'current' at a time. All OpenGL function calls affect the current window only. Windows do not currently share display lists or other definitions (like textures).

girDestroyWindow destroys the specified window(s). If one is current, the previous existing window is made current.

girSwapBuffers swaps the front and back buffers of the specified window(s), which do not have to be current.

girFocusWindow asks the windowing system to focus and/or raise the specified window(s), which do not have to be current.

girListWindows and girWindowInfo return information about currently open windows.

girSetDoEvents enables or disables event processing for the specified window(s). See girProcessEvents for details of event processing.

Value

girCreateWindow returns an integer index, identifying the window, that may be used in subsequent calls to other window management functions.
girGetCurrentWindow returns the index of the currently active window, or 0 if no windows are open.
girListWindows returns a vector containing the indices of all extant windows.
girWindowInfo returns a list with components index, size, and caption for each specified window.
All other functions return NULL, and are invoked for their side effects.

Notes and Issues

Sometimes windows won't get appropriate window manager decorations. This is apparently a known issue with R's X11 device as well.

In X11, windows are currently only created on the default display.

Examples

## Not run: 
        # create a window
        girCreateWindow(640, 480)
        ...
        # solicit events
        girSetDoEvents(TRUE)
        ...
        while(1)
        {
                # render some stuff
                ...
                girSwapBuffers()
        }

        # destroy all windows
        girDestroyWindow(girListWindows())
## End(Not run) 

[Package gir version 0.3-2 Index]