protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.SetContentView(Resource.Layout.hand_activity_main); mTextView = (TextView)FindViewById(Resource.Id.handTextView); mSurfaceView = (GLSurfaceView)FindViewById(Resource.Id.handSurfaceview); mDisplayRotationManager = new DisplayRotationManager(this); // Keep the OpenGL ES running context. mSurfaceView.PreserveEGLContextOnPause = true; // Set the OpenGLES version. mSurfaceView.SetEGLContextClientVersion(2); // Set the EGL configuration chooser, including for the // number of bits of the color buffer and the number of depth bits. mSurfaceView.SetEGLConfigChooser(8, 8, 8, 8, 16, 0); mHandRenderManager = new HandRenderManager(this); mHandRenderManager.SetDisplayRotationManager(mDisplayRotationManager); mHandRenderManager.SetTextView(mTextView); mSurfaceView.SetRenderer(mHandRenderManager); mSurfaceView.RenderMode = Android.Opengl.Rendermode.Continuously; }
/// <summary> /// Set the displayRotationManage object, which will be used in OnSurfaceChanged /// and OnDrawFrame.This method is called when Activity's OnResume. /// </summary> /// <param name="displayRotationManager">DisplayRotationManager.</param> public void SetDisplayRotationManager(DisplayRotationManager displayRotationManager) { if (displayRotationManager == null) { Log.Debug(TAG, "Set display rotation manage error, displayRotationManage is null!"); return; } mDisplayRotationManager = displayRotationManager; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.SetContentView(Resource.Layout.world_activity_main); this.mSurfaceView = (GLSurfaceView)FindViewById(Resource.Id.surfaceview); mDisplayRotationManager = new DisplayRotationManager(this); InitGestureDetector(); mSurfaceView.PreserveEGLContextOnPause = true; mSurfaceView.SetEGLContextClientVersion(OPENGLES_VERSION); // Set the EGL configuration chooser, including for the number of // bits of the color buffer and the number of depth bits. mSurfaceView.SetEGLConfigChooser(8, 8, 8, 8, 16, 0); mWorldRenderManager = new WorldRenderManager(this, this.ApplicationContext); mWorldRenderManager.SetDisplayRotationManager(mDisplayRotationManager); mWorldRenderManager.SetQueuedSingleTaps(mQueuedSingleTaps); mSurfaceView.SetRenderer(mWorldRenderManager); mSurfaceView.RenderMode = Android.Opengl.Rendermode.Continuously; }