Eclipse Platform
Release 3.2

org.eclipse.swt.opengl
Class GLCanvas

java.lang.Object
  extended byorg.eclipse.swt.widgets.Widget
      extended byorg.eclipse.swt.widgets.Control
          extended byorg.eclipse.swt.widgets.Scrollable
              extended byorg.eclipse.swt.widgets.Composite
                  extended byorg.eclipse.swt.widgets.Canvas
                      extended byorg.eclipse.swt.opengl.GLCanvas
All Implemented Interfaces:
Drawable

public class GLCanvas
extends Canvas

GLCanvas is a widget capable of displaying OpenGL content. WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE

Since:
3.2

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
GLCanvas(Composite parent, int style, GLData data)
          Create a GLCanvas widget using the attributes described in the GLData object provided.
 
Method Summary
 GLData getGLData()
          Returns a GLData object describing the created context.
 boolean isCurrent()
          Returns a boolean indicating whether the receiver's OpenGL context is the current context.
 void setCurrent()
          Sets the OpenGL context associated with this GLCanvas to be the current GL context.
 void swapBuffers()
          Swaps the front and back color buffers.
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GLCanvas

public GLCanvas(Composite parent,
                int style,
                GLData data)
Create a GLCanvas widget using the attributes described in the GLData object provided.

Parameters:
parent - a composite widget
style - the bitwise OR'ing of widget styles
data - the requested attributes of the GLCanvas
Throws:
IllegalArgumentException - WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
Since:
3.2
Method Detail

getGLData

public GLData getGLData()
Returns a GLData object describing the created context.

Returns:
GLData description of the OpenGL context attributes
Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
Since:
3.2

isCurrent

public boolean isCurrent()
Returns a boolean indicating whether the receiver's OpenGL context is the current context.

Returns:
true if the receiver holds the current OpenGL context, false otherwise
Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
Since:
3.2

setCurrent

public void setCurrent()
Sets the OpenGL context associated with this GLCanvas to be the current GL context.

Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
Since:
3.2

swapBuffers

public void swapBuffers()
Swaps the front and back color buffers.

Throws:
SWTException -
  • ERROR_WIDGET_DISPOSED - if the receiver has been disposed
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
WARNING API STILL UNDER CONSTRUCTION AND SUBJECT TO CHANGE
Since:
3.2

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.