java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.marginallyclever.ro3.apps.App
com.marginallyclever.ro3.apps.viewport.Viewport
com.marginallyclever.ro3.apps.viewport.OpenGL3Panel
- All Implemented Interfaces:
com.jogamp.opengl.GLEventListener,SceneChangeListener,MouseListener,MouseMotionListener,MouseWheelListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class OpenGL3Panel
extends Viewport
implements com.jogamp.opengl.GLEventListener, SceneChangeListener
OpenGL3Panel manages a GLJPanel and an FPSAnimator running OpenGL 3.0.
It is a concrete implementation of Viewport.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior -
Field Summary
FieldsFields inherited from class com.marginallyclever.ro3.apps.viewport.Viewport
renderPassesFields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGLEventListener(com.jogamp.opengl.GLEventListener listener) voidvoidbeforeSceneChange(Node oldScene) Called before the scene changes.voiddisplay(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) voiddispose(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) intgetFPS()intvoidinit(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) booleanbooleanbooleanvoidremoveGLEventListener(com.jogamp.opengl.GLEventListener listener) voidvoidrenderViewportTools(com.jogamp.opengl.GL3 gl3) voidreshape(com.jogamp.opengl.GLAutoDrawable glAutoDrawable, int x, int y, int width, int height) voidvoidsetDoubleBuffered(boolean doubleBuffered) voidsetFsaaSamples(int fsaaSamples) voidsetHardwareAccelerated(boolean hardwareAccelerated) voidsetVerticalSync(boolean verticalSync) voidMethods inherited from class com.marginallyclever.ro3.apps.viewport.Viewport
addToolChangeListener, afterSceneChange, getActiveCamera, getActiveToolIndex, getAspectRatio, getCursorAsNormalized, getCursorAsNormalized, getCursorPosition, getNumTools, getOrbitChangeFactor, getRayThroughPoint, getRayThroughPointUntransformed, getTool, getUserMovementScale, isDebugGL, isOriginShift, isTraceGL, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, removeToolChangeListener, renderAllPasses, saveRenderPassState, setActiveCamera, setActiveToolIndex, setDebugGL, setFsaaSamples, setOrbitChangeFactor, setOriginShift, setTraceGL, setUserMovementScale, updateAllNodesMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUIMethods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.marginallyclever.ro3.SceneChangeListener
afterSceneChange
-
Field Details
-
DEFAULT_FPS
public static final int DEFAULT_FPS- See Also:
-
-
Constructor Details
-
OpenGL3Panel
public OpenGL3Panel()
-
-
Method Details
-
savePrefs
-
addNotify
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classViewport
-
addGLEventListener
public void addGLEventListener(com.jogamp.opengl.GLEventListener listener) -
removeGLEventListener
public void removeGLEventListener(com.jogamp.opengl.GLEventListener listener) -
stopAnimationSystem
public void stopAnimationSystem() -
init
public void init(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) - Specified by:
initin interfacecom.jogamp.opengl.GLEventListener
-
dispose
public void dispose(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) - Specified by:
disposein interfacecom.jogamp.opengl.GLEventListener
-
reshape
public void reshape(com.jogamp.opengl.GLAutoDrawable glAutoDrawable, int x, int y, int width, int height) - Specified by:
reshapein interfacecom.jogamp.opengl.GLEventListener
-
display
public void display(com.jogamp.opengl.GLAutoDrawable glAutoDrawable) - Specified by:
displayin interfacecom.jogamp.opengl.GLEventListener
-
renderViewportTools
public void renderViewportTools(com.jogamp.opengl.GL3 gl3) -
isHardwareAccelerated
public boolean isHardwareAccelerated()- Overrides:
isHardwareAcceleratedin classViewport
-
setHardwareAccelerated
public void setHardwareAccelerated(boolean hardwareAccelerated) - Overrides:
setHardwareAcceleratedin classViewport
-
isDoubleBuffered
public boolean isDoubleBuffered()- Overrides:
isDoubleBufferedin classJComponent
-
setDoubleBuffered
public void setDoubleBuffered(boolean doubleBuffered) - Overrides:
setDoubleBufferedin classJComponent
-
getFsaaSamples
public int getFsaaSamples()- Overrides:
getFsaaSamplesin classViewport
-
setFsaaSamples
public void setFsaaSamples(int fsaaSamples) -
isVerticalSync
public boolean isVerticalSync()- Overrides:
isVerticalSyncin classViewport
-
setVerticalSync
public void setVerticalSync(boolean verticalSync) - Overrides:
setVerticalSyncin classViewport
-
getFPS
public int getFPS() -
beforeSceneChange
Description copied from interface:SceneChangeListenerCalled before the scene changes. This is a good time to unregister listeners.- Specified by:
beforeSceneChangein interfaceSceneChangeListener- Overrides:
beforeSceneChangein classViewport- Parameters:
oldScene- the scene that is about to be replaced.
-