Check whether EXT_framebuffer_object is supported and abort if it is not.

This commit is contained in:
the_fiddler 2009-02-22 15:50:08 +00:00
parent 871a76b46b
commit 55c34f8a48

View file

@ -18,7 +18,7 @@ using OpenTK.Graphics.OpenGL;
namespace Examples.Tutorial
{
[Example("Simple FrameBuffer Object.", ExampleCategory.OpenGL)]
[Example("Framebuffer Objects.", ExampleCategory.OpenGL)]
public class SimpleFBO : GameWindow
{
public SimpleFBO()
@ -56,6 +56,15 @@ namespace Examples.Tutorial
public override void OnLoad(EventArgs e)
{
if (!GL.SupportsExtension("EXT_framebuffer_object"))
{
System.Windows.Forms.MessageBox.Show(
"Your video card does not support Framebuffer Objects. Please update your drivers.",
"FBOs not supported",
System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
Exit();
}
GL.Enable(EnableCap.DepthTest);
GL.ClearDepth(1.0f);
GL.DepthFunc(DepthFunction.Lequal);