Bruce_Baker's picture

newbie help with attribute in example tutorial

Hi, I am a newbie wanting to write OpenGL using F#. but first I must understand the C# examples in the tutorial. Specifically how the Example attribute is being used? I am using VS Express 2012. When I paste the example "OpenGL 3.0" into the IDE and add references to match the using statements , I get 2 errors saying:
"Error 2 The type or namespace name 'ExampleAttribute' could not be found (are you missing a using directive or an assembly reference?) c:\users\morrisfamily\documents\visual studio 2012\Projects\OpenTK3\OpenTK3\Class1.cs 16 6 OpenTK3"
the relavent code is:

using System;
using System.Drawing;
using System.Diagnostics;
using System.IO;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
namespace Examples.Tutorial
    [Example("OpenGL 3.0", ExampleCategory.OpenGL, "3.x", Documentation = "HelloGL3")]
    public class HelloGL3 : GameWindow

My Question is: Am I really missing a reference to an assembly or DLL?
Or am I not understanding how this attribute is being used? (i.e. I don't understand C# well)
Thanks in advance for any help or insight, Bruce Baker


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

The ExampleAttribute is defined in the OpenTK.Examples project and holds metadata for the example browser. The example browser uses this information to place examples into relevant categories (e.g. OpenAL, OpenGL, OpenTK etc.)

You do not need ExampleAttribute in your own code. Feel free to delete it.