Note that there are some explanatory texts on larger screens.

plurals
  1. POXNA 4.0 - What happens when the window is minimized?
    text
    copied!<p>I'm learning F#, and decided to try making simple XNA games for windows using F# (pure enthusiasm) , and got a window with some images showing up.</p> <p>Here's the code:</p> <pre><code>(*Methods*) member self.DrawSprites() = _spriteBatch.Begin() for i = 0 to _list.Length-1 do let spentity = _list.List.ElementAt(i) _spriteBatch.Draw(spentity.ImageTexture,new Rectangle(100,100,(int)spentity.Width,(int)spentity.Height),Color.White) _spriteBatch.End() (*Overriding*) override self.Initialize() = ChangeGraphicsProfile() _graphicsDevice &lt;- _graphics.GraphicsDevice _list.AddSprite(0,"NagatoYuki",992.0,990.0) base.Initialize() override self.LoadContent() = _spriteBatch &lt;- new SpriteBatch(_graphicsDevice) base.LoadContent() override self.Draw(gameTime : GameTime) = base.Draw(gameTime) _graphics.GraphicsDevice.Clear(Color.CornflowerBlue) self.DrawSprites() </code></pre> <p>And the <strong>AddSprite</strong> Method:</p> <pre><code> member self.AddSprite(ID : int,imageTexture : string , width : float, height : float) = let texture = content.Load&lt;Texture2D&gt;(imageTexture) list &lt;- list @ [new SpriteEntity(ID,list.Length, texture,Vector2.Zero,width,height)] </code></pre> <p>The _list object has a <strong>ContentManager</strong>, here's the <strong>constructor</strong>:</p> <pre><code> type SpriteList(_content : ContentManager byref) = let mutable content = _content let mutable list = [] </code></pre> <p>But I can't minimize the window, since when it regains its focus, i get this error:</p> <p><strong>ObjectDisposedException</strong></p> <blockquote> <p>Cannot access a disposed object.<br> Object name: 'GraphicsDevice'.</p> </blockquote> <p>What is happening?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload