コード例 #1
0
ファイル: SceneView.xaml.cs プロジェクト: danjmackay/gemini
        /// <summary>
        /// Invoked after either control has created its graphics device.
        /// </summary>
        private void OnGraphicsControlLoadContent(object sender, GraphicsDeviceEventArgs e)
        {
            _basicEffect = new BasicEffect(e.GraphicsDevice)
            {
                View = Matrix.LookAtRH(new Vector3(0, 0, 3), new Vector3(0, 0, 0), Vector3.UnitY),
                World = Matrix.Identity,
                PreferPerPixelLighting = true
            };
            _basicEffect.EnableDefaultLighting();

            _geometricPrimitives = new[]
            {
                GeometricPrimitive.Cube.New(e.GraphicsDevice),
                GeometricPrimitive.Cylinder.New(e.GraphicsDevice),
                GeometricPrimitive.GeoSphere.New(e.GraphicsDevice),
                GeometricPrimitive.Teapot.New(e.GraphicsDevice),
                GeometricPrimitive.Torus.New(e.GraphicsDevice)
            };
            _primitiveIndex = 0;

            _texture = Texture2D.Load(e.GraphicsDevice, "Modules/SharpDXSceneViewer/Resources/tile_aqua.png");
            _basicEffect.Texture = _texture;
            _basicEffect.TextureEnabled = true;

            _yaw = 0.5f;
            _pitch = 0.3f;
        }
コード例 #2
0
ファイル: SceneView.xaml.cs プロジェクト: DraTeots/gemini
	    private void OnGraphicsControlUnloadContent(object sender, GraphicsDeviceEventArgs e)
	    {
			_texture.Dispose();
            foreach (var primitive in _geometricPrimitives)
		        primitive.Dispose();
		    _basicEffect.Dispose();
	    }
コード例 #3
0
        protected virtual void RaiseUnloadContent(GraphicsDeviceEventArgs args)
        {
            var handler = UnloadContent;

            if (handler != null)
            {
                handler(this, args);
            }
        }
コード例 #4
0
ファイル: DrawingSurface.cs プロジェクト: 4ux-nbIx/gemini
		protected virtual void RaiseUnloadContent(GraphicsDeviceEventArgs args)
		{
			var handler = UnloadContent;
			if (handler != null)
				handler(this, args);
		}