|
org.eclipse.swt.opengl
Class GLCanvas
java.lang.Object
org.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
org.eclipse.swt.widgets.Canvas
org.eclipse.swt.opengl.GLCanvas
-
All Implemented Interfaces:
-
Drawable
-
public class GLCanvas
- extends
Canvas
GLCanvas is a widget capable of displaying OpenGL content.
-
Since:
- 3.2
-
See Also:
-
GLData ,
OpenGL snippets,
Sample code and further information
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.
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.
Control
|
addControlListener,
addDragDetectListener,
addFocusListener,
addHelpListener,
addKeyListener,
addMenuDetectListener,
addMouseListener,
addMouseMoveListener,
addMouseTrackListener,
addMouseWheelListener,
addPaintListener,
addTraverseListener,
computeSize,
dragDetect,
dragDetect,
forceFocus,
getAccessible,
getBackground,
getBackgroundImage,
getBorderWidth,
getBounds,
getCursor,
getDragDetect,
getEnabled,
getFont,
getForeground,
getLayoutData,
getLocation,
getMenu,
getMonitor,
getParent,
getRegion,
getShell,
getSize,
getToolTipText,
getVisible,
internal_dispose_GC,
internal_new_GC,
isEnabled,
isFocusControl,
isReparentable,
isVisible,
moveAbove,
moveBelow,
pack,
pack,
print,
redraw,
redraw,
removeControlListener,
removeDragDetectListener,
removeFocusListener,
removeHelpListener,
removeKeyListener,
removeMenuDetectListener,
removeMouseListener,
removeMouseMoveListener,
removeMouseTrackListener,
removeMouseWheelListener,
removePaintListener,
removeTraverseListener,
setBackground,
setBackgroundImage,
setBounds,
setBounds,
setCapture,
setCursor,
setDragDetect,
setEnabled,
setForeground,
setLayoutData,
setLocation,
setLocation,
setMenu,
setParent,
setRedraw,
setRegion,
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,
getListeners,
getStyle,
isDisposed,
isListening,
notifyListeners,
removeDisposeListener,
removeListener,
removeListener,
setData,
setData,
toString
|
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
-
- ERROR_NULL_ARGUMENT when the data is null
- ERROR_UNSUPPORTED_DEPTH when the requested attributes cannot be provided
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
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
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
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
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.
|
|