Hello!
It’s my first day with MonoGame and I wanted to start with a background video running in my Fullscreen window.
What I did: I followed this Tutorial https://msdn.microsoft.com/en-us/library/dd904199.aspx
But the thing is, that the video is not full-screen with that. Not sure how to do that, so I changed the Draw Function from
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
if (player.State == MediaState.Playing)
basicEffect.Texture = player.GetTexture();
// Draw the quad
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
GraphicsDevice.DrawUserIndexedPrimitives
<VertexPositionNormalTexture>(
PrimitiveType.TriangleList,
quad.Vertices, 0, 4,
quad.Indexes, 0, 2);
}
base.Draw(gameTime);
}
to
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
Rectangle screen = new Rectangle(GraphicsDevice.Viewport.X,
GraphicsDevice.Viewport.Y,
GraphicsDevice.Viewport.Width,
GraphicsDevice.Viewport.Height);
// If the video is playing, get the current frame
// as a texture. (Calling GetTexture on a stopped
// player results in an exception)
if (player.State == MediaState.Playing)
basicEffect.Texture = player.GetTexture();
// Draw the quad
foreach (EffectPass pass in basicEffect.CurrentTechnique.Passes)
{
pass.Apply();
if (basicEffect.Texture != null)
{
spriteBatch.Begin();
spriteBatch.Draw(basicEffect.Texture, screen, Color.White);
spriteBatch.End();
}
}
base.Draw(gameTime);
}
So it is fullscreen now, but after ~1 Minute my Disk usage raises to 100% and I can’t use my computer and have to restart. The disk is a Samsung Evo SSD so that shouldn’t be a problem. Not sure how to fix this. I just want a background video