GLCanvas

GLCanvas is a widget capable of displaying OpenGL content.

@see GLData @see <a href="http://www.eclipse.org/swt/snippets/#opengl">OpenGL snippets</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

@since 3.2

class GLCanvas : Canvas {
void* context;
size_t xWindow;
GdkDrawable* glWindow;
XVisualInfo vinfo;
int MAX_ATTRIBUTES;
}

Constructors

this
this(Composite parent, int style, GLData data)

Create a GLCanvas widget using the attributes described in the GLData object provided.

Members

Functions

getGLData
GLData getGLData()

Returns a GLData object describing the created context.

isCurrent
bool isCurrent()

Returns a bool indicating whether the receiver's OpenGL context is the current context.

setCurrent
void setCurrent()

Sets the OpenGL context associated with this GLCanvas to be the current GL context.

swapBuffers
void swapBuffers()

Swaps the front and back color buffers.

Inherited Members

From Canvas

drawBackground
void drawBackground(GC gc, int x, int y, int width, int height)

Fills the interior of the rectangle specified by the arguments, with the receiver's background.

getCaret
Caret getCaret()

Returns the caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p>

getIME
IME getIME()

Returns the IME.

scroll
void scroll(int destX, int destY, int x, int y, int width, int height, bool all)

Scrolls a rectangular area of the receiver by first copying the source area to the destination and then causing the area of the source which is not covered by the destination to be repainted. Children that intersect the rectangle are optionally moved during the operation. In addition, outstanding paint events are flushed before the source area is copied to ensure that the contents of the canvas are drawn correctly.

setCaret
void setCaret(Caret caret)

Sets the receiver's caret. <p> The caret for the control is automatically hidden and shown when the control is painted or resized, when focus is gained or lost and when an the control is scrolled. To avoid drawing on top of the caret, the programmer must hide and show the caret when drawing in the window any other time. </p> @param caret the new caret for the receiver, may be null

setIME
void setIME(IME ime)

Sets the receiver's IME.

Meta