android.opengl
Class GLSurfaceView

java.lang.Object
  extended by android.view.View
      extended by android.view.SurfaceView
          extended by android.opengl.GLSurfaceView
All Implemented Interfaces:
Drawable.Callback, AccessibilityEventSource, KeyEvent.Callback, SurfaceHolder.Callback

public class GLSurfaceView
extends SurfaceView
implements SurfaceHolder.Callback


Nested Class Summary
static interface GLSurfaceView.EGLConfigChooser
           
static interface GLSurfaceView.EGLContextFactory
           
static interface GLSurfaceView.EGLWindowSurfaceFactory
           
static interface GLSurfaceView.GLWrapper
           
static interface GLSurfaceView.Renderer
           
 
Nested classes/interfaces inherited from class android.view.View
View.AccessibilityDelegate, View.BaseSavedState, View.DragShadowBuilder, View.MeasureSpec, View.OnAttachStateChangeListener, View.OnClickListener, View.OnCreateContextMenuListener, View.OnDragListener, View.OnFocusChangeListener, View.OnGenericMotionListener, View.OnHoverListener, View.OnKeyListener, View.OnLayoutChangeListener, View.OnLongClickListener, View.OnSystemUiVisibilityChangeListener, View.OnTouchListener
 
Field Summary
static int DEBUG_CHECK_GL_ERROR
           
static int DEBUG_LOG_GL_CALLS
           
static int RENDERMODE_CONTINUOUSLY
           
static int RENDERMODE_WHEN_DIRTY
           
 
Fields inherited from class android.view.View
ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
 
Constructor Summary
GLSurfaceView(Context context)
           
GLSurfaceView(Context context, AttributeSet attrs)
           
 
Method Summary
 int getDebugFlags()
           
 boolean getPreserveEGLContextOnPause()
           
 int getRenderMode()
           
protected  void onAttachedToWindow()
           
protected  void onDetachedFromWindow()
           
 void onPause()
           
 void onResume()
           
 void queueEvent(Runnable r)
           
 void requestRender()
           
 void setDebugFlags(int debugFlags)
           
 void setEGLConfigChooser(boolean needDepth)
           
 void setEGLConfigChooser(GLSurfaceView.EGLConfigChooser configChooser)
           
 void setEGLConfigChooser(int redSize, int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize)
           
 void setEGLContextClientVersion(int version)
           
 void setEGLContextFactory(GLSurfaceView.EGLContextFactory factory)
           
 void setEGLWindowSurfaceFactory(GLSurfaceView.EGLWindowSurfaceFactory factory)
           
 void setGLWrapper(GLSurfaceView.GLWrapper glWrapper)
           
 void setPreserveEGLContextOnPause(boolean preserveOnPause)
           
 void setRenderer(GLSurfaceView.Renderer renderer)
           
 void setRenderMode(int renderMode)
           
 void surfaceChanged(SurfaceHolder holder, int format, int w, int h)
           
 void surfaceCreated(SurfaceHolder holder)
           
 void surfaceDestroyed(SurfaceHolder holder)
           
 
Methods inherited from class android.view.SurfaceView
dispatchDraw, draw, gatherTransparentRegion, getHolder, onMeasure, onWindowVisibilityChanged, setVisibility, setZOrderMediaOverlay, setZOrderOnTop
 
Methods inherited from class android.view.View
addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, cancelLongPress, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowVisibilityChanged, drawableStateChanged, findFocus, findViewById, findViewsWithText, findViewWithTag, fitsSystemWindows, fitSystemWindows, focusSearch, forceLayout, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getKeepScreenOn, getKeyDispatcherState, getLayerType, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getParent, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasFocus, hasFocusable, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInTouchMode, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isSelected, isShown, isSoundEffectsEnabled, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, jumpDrawablesToCurrentState, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateDrawableState, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onSaveInstanceState, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, overScrollBy, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setActivated, setAlpha, setAnimation, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setKeepScreenOn, setLayerType, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollbarFadingEnabled, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, unscheduleDrawable, unscheduleDrawable, verifyDrawable, willNotCacheDrawing, willNotDraw
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RENDERMODE_WHEN_DIRTY

public static final int RENDERMODE_WHEN_DIRTY
See Also:
Constant Field Values

RENDERMODE_CONTINUOUSLY

public static final int RENDERMODE_CONTINUOUSLY
See Also:
Constant Field Values

DEBUG_CHECK_GL_ERROR

public static final int DEBUG_CHECK_GL_ERROR
See Also:
Constant Field Values

DEBUG_LOG_GL_CALLS

public static final int DEBUG_LOG_GL_CALLS
See Also:
Constant Field Values
Constructor Detail

GLSurfaceView

public GLSurfaceView(Context context)

GLSurfaceView

public GLSurfaceView(Context context,
                     AttributeSet attrs)
Method Detail

setGLWrapper

public void setGLWrapper(GLSurfaceView.GLWrapper glWrapper)

setDebugFlags

public void setDebugFlags(int debugFlags)

getDebugFlags

public int getDebugFlags()

setPreserveEGLContextOnPause

public void setPreserveEGLContextOnPause(boolean preserveOnPause)

getPreserveEGLContextOnPause

public boolean getPreserveEGLContextOnPause()

setRenderer

public void setRenderer(GLSurfaceView.Renderer renderer)

setEGLContextFactory

public void setEGLContextFactory(GLSurfaceView.EGLContextFactory factory)

setEGLWindowSurfaceFactory

public void setEGLWindowSurfaceFactory(GLSurfaceView.EGLWindowSurfaceFactory factory)

setEGLConfigChooser

public void setEGLConfigChooser(GLSurfaceView.EGLConfigChooser configChooser)

setEGLConfigChooser

public void setEGLConfigChooser(boolean needDepth)

setEGLConfigChooser

public void setEGLConfigChooser(int redSize,
                                int greenSize,
                                int blueSize,
                                int alphaSize,
                                int depthSize,
                                int stencilSize)

setEGLContextClientVersion

public void setEGLContextClientVersion(int version)

setRenderMode

public void setRenderMode(int renderMode)

getRenderMode

public int getRenderMode()

requestRender

public void requestRender()

surfaceCreated

public void surfaceCreated(SurfaceHolder holder)
Specified by:
surfaceCreated in interface SurfaceHolder.Callback

surfaceDestroyed

public void surfaceDestroyed(SurfaceHolder holder)
Specified by:
surfaceDestroyed in interface SurfaceHolder.Callback

surfaceChanged

public void surfaceChanged(SurfaceHolder holder,
                           int format,
                           int w,
                           int h)
Specified by:
surfaceChanged in interface SurfaceHolder.Callback

onPause

public void onPause()

onResume

public void onResume()

queueEvent

public void queueEvent(Runnable r)

onAttachedToWindow

protected void onAttachedToWindow()
Overrides:
onAttachedToWindow in class SurfaceView

onDetachedFromWindow

protected void onDetachedFromWindow()
Overrides:
onDetachedFromWindow in class SurfaceView


Copyright © 2008-2012. All Rights Reserved.