Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# SpriteBatch.End()抛出OpenTK.Graphics.GraphicsErrorException:InvalidEnum_C#_Linux_Opentk_Monogame - Fatal编程技术网

C# SpriteBatch.End()抛出OpenTK.Graphics.GraphicsErrorException:InvalidEnum

C# SpriteBatch.End()抛出OpenTK.Graphics.GraphicsErrorException:InvalidEnum,c#,linux,opentk,monogame,C#,Linux,Opentk,Monogame,我决定从MonoGame开始游戏开发,但我面临一个问题 当我尝试使用SpriteBatch对象将精灵添加到屏幕时,就像我在许多XNA教程中看到的那样,我得到了一个OpenTK.Graphics.GraphicsErrorException protected override void Draw (GameTime gameTime) { graphics.GraphicsDevice.Clear (Color.CornflowerBlue);

我决定从MonoGame开始游戏开发,但我面临一个问题

当我尝试使用SpriteBatch对象将精灵添加到屏幕时,就像我在许多XNA教程中看到的那样,我得到了一个OpenTK.Graphics.GraphicsErrorException

    protected override void Draw (GameTime gameTime)
    {
        graphics.GraphicsDevice.Clear (Color.CornflowerBlue);

        spriteBatch.Begin();
        spriteBatch.Draw(spriteTexture, position, Color.White);
        spriteBatch.End(); // <—— Exception here

        base.Draw (gameTime);
    }
protected override void Draw(游戏时间游戏时间)
{
graphics.GraphicsDevice.Clear(颜色:矢车菊蓝);
spriteBatch.Begin();
spriteBatch.Draw(spriteTexture、位置、颜色、白色);

spriteBatch.End();//您是否尝试过在MonoGame论坛上发布您的问题。我相信,MonoGame开发人员会定期回答这些类型的问题。我尝试过在Windows 7下使用相同的环境(相同版本的MonoDevelop、MonoGame和OpenTK)我在github项目上提出了一个问题:正确使用Monogame3.0(稳定版):)
OpenTK.Graphics.GraphicsErrorException: InvalidEnum
  at OpenTK.Graphics.OpenGL.ErrorHelper.CheckErrors () [0x000c0] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/Graphics/OpenGL/ErrorHelper.cs:118
  at OpenTK.Graphics.OpenGL.ErrorHelper.Dispose () [0x00000] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/Graphics/OpenGL/ErrorHelper.cs:129
  at OpenTK.Graphics.OpenGL.GL.TexEnv (TextureEnvTarget target, TextureEnvParameter pname, Int32 param) [0x0001e] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/Graphics/OpenGL/GL.cs:69308
  at Microsoft.Xna.Framework.Graphics.SpriteBatch.End () [0x00000] in <filename unknown>:0
  at FirstGame.Game1.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x0003c] in /home/sam/Developpement/C#/Test/FirstGame/Game1.cs:82
  at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0
  at Microsoft.Xna.Framework.GameWindow.OnRenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00000] in <filename unknown>:0
  at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x0000b] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:976
  at OpenTK.GameWindow.OnRenderFrameInternal (OpenTK.FrameEventArgs e) [0x00016] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:1032
  at OpenTK.GameWindow.RaiseRenderFrame (System.Diagnostics.Stopwatch render_watch, System.Double& next_render, OpenTK.FrameEventArgs render_args) [0x00104] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:527
  at OpenTK.GameWindow.DispatchUpdateAndRenderFrame (System.Object sender, System.EventArgs e) [0x00018] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:433
  at OpenTK.GameWindow.Run (Double updates_per_second, Double frames_per_second) [0x000d5] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:411
  at OpenTK.GameWindow.Run (Double updateRate) [0x00000] in /home/sam/Téléchargements/opentk/src/opentk/Source/OpenTK/GameWindow.cs:358
  at Microsoft.Xna.Framework.GameWindow.Run (Double updateRate) [0x00000] in <filename unknown>:0
  at Microsoft.Xna.Framework.LinuxGamePlatform.RunLoop () [0x00000] in <filename unknown>:0
  at Microsoft.Xna.Framework.Game.Run (GameRunBehavior runBehavior) [0x00000] in <filename unknown>:0
  at Microsoft.Xna.Framework.Game.Run () [0x00000] in <filename unknown>:0
  at FirstGame.Program.Main () [0x0000a] in /home/sam/Developpement/C#/Test/FirstGame/Program.cs:21