mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-03 06:31:02 +00:00
Automatic OpenGL error checking now throws an OpenGLErrorException. This is internal, as it should not be caught by the user.
Added Color4 overload to GL.Uniform4.
This commit is contained in:
parent
03f9857bd2
commit
3c9ccedc9d
|
@ -913,6 +913,11 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void Uniform4(int location, Color4 color)
|
||||||
|
{
|
||||||
|
unsafe { GL.Uniform4(location, 4, &color.R); }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -281,10 +281,7 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
sb.Remove(sb.Length - 2, 2); // Remove the last comma
|
||||||
|
|
||||||
Debug.Print(String.Format("OpenGL error(s) detected: {0}", sb.ToString()));
|
throw new OpenGLErrorException(sb.ToString());
|
||||||
Debug.Indent();
|
|
||||||
Debug.WriteLine(new StackTrace(true).ToString());
|
|
||||||
Debug.Unindent();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -533,4 +530,18 @@ namespace OpenTK.Graphics
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region class GraphicsErrorException : GraphicsException
|
||||||
|
|
||||||
|
// This is private by design. These exceptions are only thrown in debug builds of
|
||||||
|
// OpenTK and the user should *not* handle them.
|
||||||
|
// If some specific OpenGL error is generated by design, the user should
|
||||||
|
// turn off automatic error checking for that portion of the code, using
|
||||||
|
// 'GraphicsContext.ErrorChecking = false'.
|
||||||
|
class OpenGLErrorException : GraphicsException
|
||||||
|
{
|
||||||
|
public OpenGLErrorException(string message) : base(message) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue