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:
the_fiddler 2009-04-28 17:38:08 +00:00
parent c83fda0419
commit 4335a458eb
2 changed files with 20 additions and 4 deletions

View file

@ -913,6 +913,11 @@ namespace OpenTK.Graphics
}
}
public static void Uniform4(int location, Color4 color)
{
unsafe { GL.Uniform4(location, 4, &color.R); }
}
#endregion
#endregion

View file

@ -281,10 +281,7 @@ namespace OpenTK.Graphics
}
sb.Remove(sb.Length - 2, 2); // Remove the last comma
Debug.Print(String.Format("OpenGL error(s) detected: {0}", sb.ToString()));
Debug.Indent();
Debug.WriteLine(new StackTrace(true).ToString());
Debug.Unindent();
throw new OpenGLErrorException(sb.ToString());
}
}
}
@ -533,4 +530,18 @@ namespace OpenTK.Graphics
}
#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
}