Hi everyone,
I’m editing my game’s code on a different computer and I’m trying to compile Monogame from Source so that both machines have the same version.
I followed all the steps on monogame.net/documentation/?page=Setting_Up_MonoGame_Source, and replaced the reference to the Monogame framework with the reference to the newly built Monogame.Framework.WindowsGL project.
After replacing the reference, my game throws this error when Spritebatch.End() is called in the main draw function:
“Error was made in Game.vshost.exe”
“A callback was made on a garbage collected delegate”
The error is brought up in Shader.OpenGL.cs at line 56:
GL.CompileShader(_shaderHandle);
Spritebatch.End is called a few times before this specific call that produces the error, my code looks roughly like this:
…
Set render target to renderTextureA
Draw game stuff in a few different spritebatches
Set render target to null
Set render target to renderTetxureB
Spritebatch.begin(BackToFront, AlphaBlend, PointClamp, Default, null, null, CreateScale(1f));
Draw renderTextureA
Spritebatch.end() <-- error here
Set render target to null
…
I’m working on a Windows 10 laptop, the game runs fine if it references the stable, released Monogame 3.6 framework, it only throws this error when it references the source.
It also runs fine from source on my Windows 7 Desktop, just not my laptop.
I’d really appreciate any help, it would be great to know why this is happening with the source version.
Thanks very much!