Beispiel #1
0
        /// <summary>
        /// Initializes the control.
        /// </summary>
        protected override void OnCreateControl()
        {
            // Don't initialize the graphics device if we are running in the designer.
            if (!DesignMode)
            {
                mGraphicsDeviceService = new GraphicsDeviceService(Handle,
                                                                   ClientSize.Width,
                                                                   ClientSize.Height);
                // Give derived classes a chance to initialize themselves.
                Initialize();

                ContentServiceProvider provider = new ContentServiceProvider();
                provider.SetService(mGraphicsDeviceService);
                mContentManager = new ContentManager(provider, "./Content");
            }

            base.OnCreateControl();
        }
Beispiel #2
0
 public void SetService(GraphicsDeviceService s)
 {
     mGraphicsDeviceService = s;
 }