From 5dfa3e4de2688fc61ad08bd4dfe67c96b2cca3e9 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 22 Feb 2009 15:50:08 +0000 Subject: [PATCH] Check whether EXT_framebuffer_object is supported and abort if it is not. --- Source/Examples/OpenGL/FrameBufferObject.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Examples/OpenGL/FrameBufferObject.cs b/Source/Examples/OpenGL/FrameBufferObject.cs index 19ddefbc..b2e1751d 100644 --- a/Source/Examples/OpenGL/FrameBufferObject.cs +++ b/Source/Examples/OpenGL/FrameBufferObject.cs @@ -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);