I discovered OpenGL which is a platform independent software interface for advanced computer graphics. So I bought a book about it. Its title is: "Beginning OpenGL Game Programming", written by: Dave Astle and Kevin Hawkins. This is a nice book it even has a CDROM with the sources of the book. I wanted a book about OpenGL and C# but that OpenGL was originally intended to be used with C++ so code sources are in C++ in most publications.

I discovered that to use C# and OpenGL together you need:
1) The Tao Framework
2) freeglut.dll

Project 1 - Teapot
project 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;
using Tao.Sdl;

/// Working!!!
/// First try 08/07/02
/// 

namespace ConsoleApplication1
{
	class Program
    {
        private static void Init()
        {
            Gl.glClearColor(1.0f,1.0f, 1.0f, 1.0f);
            Gl.glShadeModel(Gl.GL_SMOOTH);
        }

        private static void Reshape(int w, int h)
        {
            if (h == 0) h = 1;
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluPerspective(45.0, (double)w / (double)h, 0.1, 100.0);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
        }

        private static void Display()
        {
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glLoadIdentity();
            Glu.gluLookAt(0, 1.0, 5.0, 0, 0, 0, 0, 1.0, 0);
            Gl.glColor3f(0.5f, 0.25f, 0.3f);
      //      Glut.glutSolidTeapot(1.0);
            Glut.glutWireTeapot(1.0);
            Glut.glutSwapBuffers();
        }

        static void Main(string[] args)
        {
            Glut.glutInit();

            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(600, 600);
            Glut.glutCreateWindow("Aljo OpenGL");

            Init();

            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            Glut.glutMainLoop();
        }
    }
}
Project 2 - Sphere
sphere
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// werkend na 1 poging
// 08/07/2008 - 19:38

namespace ConsoleApplication3
{
    class CGfxOpenGL
    {
        public static void Init()
        {
            Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
            Gl.glEnable(Gl.GL_LIGHTING);

        }

        public static bool Shutdown()
        {
            return true;
        }

        public static void Reshape(int width, int height)
        {
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();

            Glu.gluPerspective(52.0f, (float)width/(float)height, 1.0f, 1000.0f);

            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();
        }

        public static void Display()
        { 
            float[] lightPos = { 2.0f, 4.0f, -3.0f, 1.0f };
            float[] white = { 0.0f, 0.0f, 0.0f, 0.0f };
            float[] red = { 1.0f, 0.0f, 0.0f, 1.0f };

            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glLoadIdentity();

            Glu.gluLookAt(0.0f, 0.25f, 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);

            Gl.glColor3f(1.0f, 1.0f, 0.0f);
            Gl.glShadeModel(Gl.GL_SMOOTH);

            Gl.glEnable(Gl.GL_LIGHT0);
            Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, lightPos);
            Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_SPECULAR, white);

            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT, red);
            Gl.glMaterialf(Gl.GL_FRONT_AND_BACK, Gl.GL_SHININESS, 128);

            Glut.glutSolidSphere(1.0, 50, 50);

            Glut.glutSwapBuffers();
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Glut.glutInit();

            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(300, 300);
            Glut.glutCreateWindow("Aljo OpenGL #3");

            CGfxOpenGL.Init();

            Glut.glutReshapeFunc(new Glut.ReshapeCallback(CGfxOpenGL.Reshape));
            Glut.glutDisplayFunc(new Glut.DisplayCallback(CGfxOpenGL.Display));

            Glut.glutMainLoop();
        }
    }
}
Project 3 - Chess Board
project 3
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// WERKEND een zwartwit schaakbord en een roodzwart schaakbord
// Eerste poging 080722

namespace ConsoleApplication5
{
    class Program
    {
        const int checkImageHeight = 64;
        const int checkImageWidth = 64;
        static Byte[,,] checkImage =  new Byte[checkImageHeight,checkImageWidth,4];
        static Byte[,,] otherImage = new Byte[checkImageHeight,checkImageWidth,4];

        static int[] texName = new int[2];

        public static void makeCheckImages()
        {
            int i, j, c;
    
            for (i = 0; i < checkImageHeight; i++) {
                for (j = 0; j < checkImageWidth; j++) {
                    if ((((i & 0x8) == 0) ^ ((j & 0x8)) == 0)) c = 255; else c = 0;
                    checkImage[i,j,0] = (Byte) c;
                    checkImage[i,j,1] = (Byte) c;
                    checkImage[i,j,2] = (Byte) c;
                    checkImage[i,j,3] = (Byte) 255;
                    if (((((i & 0x10) == 0) ^ ((j & 0x10)) == 0))) c = 255; else c = 0;
                    otherImage[i,j,0] = (Byte) c;
                    otherImage[i,j,1] = (Byte) 0;
                    otherImage[i,j,2] = (Byte) 0;
                    otherImage[i,j,3] = (Byte) 255;
                }
            }
        }

        public static void init()
        {    
            Gl.glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            Gl.glShadeModel(Gl.GL_FLAT);
            Gl.glEnable(Gl.GL_DEPTH_TEST);

            makeCheckImages();
            Gl.glPixelStorei(Gl.GL_UNPACK_ALIGNMENT, 1);

            Gl.glGenTextures(2, texName);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texName[0]);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_S, Gl.GL_CLAMP);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_T, Gl.GL_CLAMP);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_NEAREST);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_NEAREST);
            Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGBA, checkImageWidth, 
                            checkImageHeight, 0, Gl.GL_RGBA, Gl.GL_UNSIGNED_BYTE, checkImage);

            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texName[1]);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_S, Gl.GL_CLAMP);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_WRAP_T, Gl.GL_CLAMP);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER, Gl.GL_NEAREST);
            Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, Gl.GL_NEAREST);
            Gl.glTexEnvf(Gl.GL_TEXTURE_ENV, Gl.GL_TEXTURE_ENV_MODE, Gl.GL_DECAL);
            Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGBA, checkImageWidth, 
                            checkImageHeight, 0, Gl.GL_RGBA, Gl.GL_UNSIGNED_BYTE, otherImage);
            Gl.glEnable(Gl.GL_TEXTURE_2D);
        }

        public static void display()
        {
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texName[0]);
            Gl.glBegin(Gl.GL_QUADS);
            Gl.glTexCoord2f(0.0f, 0.0f); Gl.glVertex3f(-2.0f, -1.0f, 0.0f);
            Gl.glTexCoord2f(0.0f, 1.0f); Gl.glVertex3f(-2.0f, 1.0f, 0.0f);
            Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex3f(0.0f, 1.0f, 0.0f);
            Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex3f(0.0f, -1.0f, 0.0f);
            Gl.glEnd();
            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texName[1]);
            Gl.glBegin(Gl.GL_QUADS);
            Gl.glTexCoord2f(0.0f, 0.0f); Gl.glVertex3f(1.0f, -1.0f, 0.0f);
            Gl.glTexCoord2f(0.0f, 1.0f); Gl.glVertex3f(1.0f, 1.0f, 0.0f);
            Gl.glTexCoord2f(1.0f, 1.0f); Gl.glVertex3f(2.41421f, 1.0f, -1.41421f);
            Gl.glTexCoord2f(1.0f, 0.0f); Gl.glVertex3f(2.41421f, -1.0f, -1.41421f);
            Gl.glEnd();
            Gl.glFlush();
        }

        public static void reshape(int w, int h)
        {
            Gl.glViewport(0, 0, w, h);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluPerspective(60.0f, (float)w / (float)h, 1.0f, 30.0f);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();
            Gl.glTranslatef(0.0f, 0.0f, -3.6f);
        }

        static int Main(string[] args)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(250, 250);
            Glut.glutInitWindowPosition(100, 100);
            Glut.glutCreateWindow("Aljo OpenGL #5");
            init();
            Glut.glutReshapeFunc(reshape);
            Glut.glutDisplayFunc(display);
            Glut.glutMainLoop();
            return 0; 
        }
    }
}
Project 4 - Bezier Curve
project 4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// WERKEND 2008-07-24 17.43
// Bezier curve

namespace ConsoleApplication6
{
    class Program
    {
        static float[,,] ctrlpoints = {
            {{-1.5f, -1.5f, 4.0f}, {-0.5f, -1.5f, 2.0f}, 
            {0.5f, -1.5f, -1.0f}, {1.5f, -1.5f, 2.0f}}, 
            {{-1.5f, -0.5f, 1.0f}, {-0.5f, -0.5f, 3.0f}, 
            {0.5f, -0.5f, 0.0f}, {1.5f, -0.5f, -1.0f}}, 
            {{-1.5f, 0.5f, 4.0f}, {-0.5f, 0.5f, 0.0f}, 
            {0.5f, 0.5f, 3.0f}, {1.5f, 0.5f, 4.0f}}, 
            {{-1.5f, 1.5f, -2.0f}, {-0.5f, 1.5f, -2.0f}, 
            {0.5f, 1.5f, 0.0f}, {1.5f, 1.5f, -1.0f}}
        };

        public static void display()
        {
            int i, j;

            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glColor3f(1.0f, 1.0f, 1.0f);
            Gl.glPushMatrix ();
            Gl.glRotatef(85.0f, 1.0f, 1.0f, 1.0f);
            for (j = 0; j <= 8; j++) {
                Gl.glBegin(Gl.GL_LINE_STRIP);
                for (i = 0; i <= 30; i++)
                    Gl.glEvalCoord2f((float)i/30.0f, (float)j/8.0f);
                Gl.glEnd();
                Gl.glBegin(Gl.GL_LINE_STRIP);
                for (i = 0; i <= 30; i++)
                    Gl.glEvalCoord2f((float)j/8.0f, (float)i/30.0f);
                Gl.glEnd();
            }
            Gl.glPopMatrix ();
            Gl.glFlush();
        }

        public static void init()
        {
            Gl.glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            Gl.glMap2f(Gl.GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, ref ctrlpoints[0,0,0]);
            Gl.glEnable(Gl.GL_MAP2_VERTEX_3);
            Gl.glMapGrid2f(20, 0.0f, 1.0f, 20, 0.0f, 1.0f);
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Gl.glShadeModel(Gl.GL_FLAT);
        }

        public static void reshape(int w, int h)
        {
            Gl.glViewport(0, 0, w, h);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            if (w <= h)
                Gl.glOrtho(-4.0f, 4.0f, -4.0f * (float)h / (float)w,
                        4.0f * (float)h / (float)w, -4.0f, 4.0f);
            else
                Gl.glOrtho(-4.0f * (float)w / (float)h,
                        4.0f * (float)w / (float)h, -4.0f, 4.0f, -4.0f, 4.0f);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();
        }


        static void Main(string[] args)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(500, 500);
            Glut.glutInitWindowPosition(100, 100);
            Glut.glutCreateWindow("Aljo OpenGL #6");
            init();
            Glut.glutDisplayFunc(display);
            Glut.glutReshapeFunc(reshape);
            Glut.glutMainLoop();
        }
    }
}
Project 5 - Cube and More
project 5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// WERKEND 2008-07-25 12.28
// plaatje met bol en cubus

namespace ConsoleApplication7
{
    class Program
    {
        public static void init()
        {
            float[] mat_ambient = { 1.0f, 1.0f, 1.0f, 1.0f };
            float[] mat_specular = { 1.0f, 1.0f, 1.0f, 1.0f };
            float[] light_position = { 0.0f, 0.0f, 10.0f, 1.0f };
            float[] lm_ambient = { 0.2f, 0.2f, 0.2f, 1.0f };

            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT, mat_ambient);
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_SPECULAR, mat_specular);
            Gl.glMaterialf(Gl.GL_FRONT, Gl.GL_SHININESS, 50.0f);
            Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, light_position);
            Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, lm_ambient);
    
            Gl.glEnable(Gl.GL_LIGHTING);
            Gl.glEnable(Gl.GL_LIGHT0);
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Gl.glShadeModel (Gl.GL_FLAT);

            Gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
            Gl.glClearAccum(0.0f, 0.0f, 0.0f, 0.0f);
        }

        public static void displayObjects() 
        {
            float[] torus_diffuse = { 0.7f, 0.7f, 0.0f, 1.0f };
            float[] cube_diffuse = { 0.0f, 0.7f, 0.7f, 1.0f };
            float[] sphere_diffuse = { 0.7f, 0.0f, 0.7f, 1.0f };
            float[] octa_diffuse = { 0.7f, 0.4f, 0.4f, 1.0f };
    
            Gl.glPushMatrix();
            Gl.glRotatef(30.0f, 1.0f, 0.0f, 0.0f);

            Gl.glPushMatrix();
            Gl.glTranslatef(-0.80f, 0.35f, 0.0f); 
            Gl.glRotatef(100.0f, 1.0f, 0.0f, 0.0f);
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_DIFFUSE, torus_diffuse);
            Glut.glutSolidTorus(0.275f, 0.85f, 16, 16);
            Gl.glPopMatrix();

            Gl.glPushMatrix();
            Gl.glTranslatef(-0.75f, -0.50f, 0.0f); 
            Gl.glRotatef(45.0f, 0.0f, 0.0f, 1.0f);
            Gl.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_DIFFUSE, cube_diffuse);
            Glut.glutSolidCube(1.5f);
            Gl.glPopMatrix();

            Gl.glPushMatrix();
            Gl.glTranslatef(0.75f, 0.60f, 0.0f); 
            Gl.glRotatef(30.0f, 1.0f, 0.0f, 0.0f);
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_DIFFUSE, sphere_diffuse);
            Glut.glutSolidSphere(1.0f, 16, 16);
            Gl.glPopMatrix();

            Gl.glPushMatrix();
            Gl.glTranslatef(0.70f, -0.90f, 0.25f); 
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_DIFFUSE, octa_diffuse);
            Glut.glutSolidOctahedron();
            Gl.glPopMatrix();

            Gl.glPopMatrix();
        }
        
        const int ACSIZE = 8;

        public static void display()
        {
            int[] viewport = new int[4];
            int jitter;

            Gl.glGetIntegerv (Gl.GL_VIEWPORT, viewport);

            Gl.glClear(Gl.GL_ACCUM_BUFFER_BIT);
            for (jitter = 0; jitter < ACSIZE; jitter++) {
                Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
                Gl.glPushMatrix ();
                /*	Note that 4.5 is the distance in world space between
                *	left and right and bottom and top.
                *	This formula converts fractional pixel movement to 
                *	world coordinates.
                */
                Gl.glTranslatef(Jitter.j8[jitter].x*4.5f/viewport[2], 
                				Jitter.j8[jitter].y*4.5f/viewport[3], 0.0f);
                displayObjects ();
                Gl.glPopMatrix ();
                Gl.glAccum(Gl.GL_ACCUM, 1.0f/ACSIZE);
            }
            Gl.glAccum (Gl.GL_RETURN, 1.0f);
            Gl.glFlush();
        }

        public static void reshape(int w, int h)
        {
            Gl.glViewport(0, 0, w, h);
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            if (w <= h)
                Gl.glOrtho(-2.25f, 2.25f, -2.25f * h / w, 2.25f * h / w, -10.0f, 10.0f);
            else
                Gl.glOrtho(-2.25f * w / h, 2.25f * w / h, -2.25f, 2.25f, -10.0f, 10.0f);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
            Gl.glLoadIdentity();
        }


        static void Main()
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB | Glut.GLUT_ACCUM 
            						| Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(250, 250);
            Glut.glutInitWindowPosition(100, 100);
            Glut.glutCreateWindow("Aljo OpenGL#7");
            init();
            Glut.glutReshapeFunc(reshape);
            Glut.glutDisplayFunc(display);
            Glut.glutMainLoop();
        }
    }
}
Project 6 - Culling
project 6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// Werkend: 06/09/2008 20:01
// Aljo_

namespace ConsoleApplication10
{
    class Program
    {
        // Triangle.cpp
        // OpenGL SuperBible
        // Demonstrates OpenGL Triangle Fans, backface culling, and depth testing
        // Program by Richard S. Wright Jr.
        // Chapter 03


        // Define a constant for the value of PI
        static float GL_PI = 3.1415f;

        // Rotation amounts
        static float xRot = 0.0f;
        static float yRot = 0.0f;

        // Flags for effects
        static bool iCull = false;
        static bool iOutline = false;
        static bool iDepth = false;

        ///////////////////////////////////////////////////////////////////////////////
        // Reset flags as appropriate in response to menu selections
        public static void ProcessMenu(int value)
	    {
	        switch(value)
		    {
		    case 1:
			    iDepth = !iDepth;
			    break;

		    case 2:
			    iCull = !iCull;
			    break;

		    case 3:
			    iOutline = !iOutline;
                break;
		    default:
			    break;
		    }

	        Glut.glutPostRedisplay();
	    }


        // Called to draw scene
        public static void RenderScene()
	    {
	        float x,y,angle;  // Storage for coordinates and anGl.gles
	        int iPivot = 1;		// Used to flag alternating colors

	        // Clear the window and the depth buffer
	        Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);

	        // Turn culling on if flag is set
	        if(iCull)
		        Gl.glEnable(Gl.GL_CULL_FACE);
	        else
		        Gl.glDisable(Gl.GL_CULL_FACE);

	        // Enable depth testing if flag is set
	        if(iDepth)
		        Gl.glEnable(Gl.GL_DEPTH_TEST);
	        else
		        Gl.glDisable(Gl.GL_DEPTH_TEST);

	        // Draw back side as a polygon only, if flag is set
	        if(iOutline)
		        Gl.glPolygonMode(Gl.GL_BACK,Gl.GL_LINE);
	        else
		        Gl.glPolygonMode(Gl.GL_BACK,Gl.GL_FILL);
		

	        // Save matrix state and do the rotation
	        Gl.glPushMatrix();
	        Gl.glRotatef(xRot, 1.0f, 0.0f, 0.0f);
	        Gl.glRotatef(yRot, 0.0f, 1.0f, 0.0f);


	        // Begin a trianGl.gle fan
	        Gl.glBegin(Gl.GL_TRIANGLE_FAN);

	        // Pinnacle of cone is shared vertex for fan, moved up Z axis
	        // to produce a cone instead of a circle
	        Gl.glVertex3f(0.0f, 0.0f, 75.0f);
	
	        // Loop around in a circle and specify even points along the circle
	        // as the vertices of the trianGl.gle fan
	        for(angle = 0.0f; angle < (2.0f*GL_PI); angle += (GL_PI/8.0f))
		    {
		        // Calculate x and y position of the next vertex
		        x = 50.0f*(float)Math.Sin(angle);
		        y = 50.0f*(float)Math.Cos(angle);
	
		        // Alternate color between red and green
		        if((iPivot %2) == 0)
		   	     Gl.glColor3f(0.0f, 1.0f, 0.0f);
		        else
			        Gl.glColor3f(1.0f, 0.0f, 0.0f);
			
		        // Increment pivot to change color next time
		        iPivot++;

		        // Specify the next vertex for the trianGl.gle fan
		        Gl.glVertex2f(x, y);
		    }

	        // Done drawing fan for cone
	        Gl.glEnd();


	        // Begin a new triangle fan to cover the bottom
	        Gl.glBegin(Gl.GL_TRIANGLE_FAN);

	        // Center of fan is at the origin
	        Gl.glVertex2f(0.0f, 0.0f);
	        for(angle = 0.0f; angle < (2.0f*GL_PI); angle += (GL_PI/8.0f))
		    {
		        // Calculate x and y position of the next vertex
		        x = 50.0f*(float)Math.Sin(angle);
		        y = 50.0f*(float)Math.Cos(angle);
	
		        // Alternate color between red and green
		        if((iPivot %2) == 0)
			    Gl.glColor3f(0.0f, 1.0f, 0.0f);
		    else
			    Gl.glColor3f(1.0f, 0.0f, 0.0f);
			
		    // Increment pivot to change color next time
		    iPivot++;

		    // Specify the next vertex for the trianGl.gle fan
		    Gl.glVertex2f(x, y);
		}

	    // Done drawing the fan that covers the bottom
	    Gl.glEnd();

	    // Restore transformations
	    Gl.glPopMatrix();


        Glut.glutSwapBuffers();
	}

    // This function does any needed initialization on the rendering
    // context. 
    public static void SetupRC()
	{
	    // Black background
	    Gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f );

	    // Set drawing color to green
	    Gl.glColor3f(0.0f, 1.0f, 0.0f);

	    // Set color shading model to flat
	    Gl.glShadeModel(Gl.GL_FLAT);

	    // Clock wise wound polygons are front facing, this is reversed
	    // because we are using trianGl.gle fans
	    Gl.glFrontFace(Gl.GL_CW);
	}

    public static void SpecialKeys(int key, int x, int y)
	{
	    if(key == Glut.GLUT_KEY_UP)
		    xRot-= 5.0f;

	    if(key == Glut.GLUT_KEY_DOWN)
		    xRot += 5.0f;

	    if(key == Glut.GLUT_KEY_LEFT)
		    yRot -= 5.0f;

	    if(key == Glut.GLUT_KEY_RIGHT)
		    yRot += 5.0f;

	    if(key > 356.0f)
		    xRot = 0.0f;

	    if(key < -1.0f)
		    xRot = 355.0f;

	    if(key > 356.0f)
		    yRot = 0.0f;

	    if(key < -1.0f)
		    yRot = 355.0f;

	    // Refresh the Window
	    Glut.glutPostRedisplay();
	}


    public static void ChangeSize(int w, int h)
	{
	    float nRange = 100.0f;

	    // Prevent a divide by zero
	    if(h == 0)
		    h = 1;

	    // Set Viewport to window dimensions
        Gl.glViewport(0, 0, w, h);

	    // Reset projection matrix stack
	    Gl.glMatrixMode(Gl.GL_PROJECTION);
	    Gl.glLoadIdentity();

	    // Establish clipping volume (left, right, bottom, top, near, far)
        if (w <= h) 
		    Gl.glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
        else 
		    Gl.glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);

	    // Reset Model view matrix stack
	    Gl.glMatrixMode(Gl.GL_MODELVIEW);
	    Gl.glLoadIdentity();
	}

    static void Main()
	{
	    Glut.glutInit();
	    Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
	    Glut.glutCreateWindow("Triangle Culling Example");
	
	    // Create the Menu
	    Glut.glutCreateMenu(ProcessMenu);
	    Glut.glutAddMenuEntry("Toggle depth test",1);
	    Glut.glutAddMenuEntry("Toggle cull backface",2);
	    Glut.glutAddMenuEntry("Toggle outline back",3);
	    Glut.glutAttachMenu(Glut.GLUT_RIGHT_BUTTON);
	
	    Glut.glutReshapeFunc(ChangeSize);
	    Glut.glutSpecialFunc(SpecialKeys);
	    Glut.glutDisplayFunc(RenderScene);
	    SetupRC();
	    Glut.glutMainLoop();
    }
  }
}
Project 7 - Jet
project 7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tao.FreeGlut;
using Tao.OpenGl;

// draws jet
// working 2008/10/6 18:36

namespace AljoTestOpenGL1
{
    class Program
    {
        private static void Init()
        {
            // pagina 196
            float[] ambientlight = { 1.0f, 1.0f, 1.0f, 1.0f };
            Gl.glEnable(Gl.GL_DEPTH_TEST);
            Gl.glEnable(Gl.GL_CULL_FACE);
            Gl.glFrontFace(Gl.GL_CCW);
            Gl.glEnable(Gl.GL_LIGHTING);
            Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, ambientlight);
            Gl.glEnable(Gl.GL_COLOR_MATERIAL);
            Gl.glColorMaterial(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE);
            Gl.glClearColor(0.5f, 0.5f, 1.0f, 1.0f);
        }

        private static void Reshape(int w, int h)
        {
            if (h == 0) h = 1;
            Gl.glMatrixMode(Gl.GL_PROJECTION);
            Gl.glLoadIdentity();
            Glu.gluPerspective(45.0, (double)w / (double)h, 0.1, 500.0);
            Gl.glMatrixMode(Gl.GL_MODELVIEW);
        }

        private static void Display()
        {
            float[] ambientlight = { 0.75f, 0.75f, 0.75f, 1.0f };
            float[] gray = { 0.75f, 0.75f, 0.75f, 1.0f };
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
            Gl.glLoadIdentity();
            Glu.gluLookAt(0.0, 150.0, 100.0, 0, 0, 0, 0, 1.0, 0);
            // pagina 194
            Gl.glShadeModel(Gl.GL_SMOOTH);
            Gl.glEnable(Gl.GL_LIGHTING);
            Gl.glEnable(Gl.GL_COLOR_MATERIAL);
            Gl.glColorMaterial(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE);
            Gl.glColor3f(0.75f, 0.75f, 0.75f);
            Gl.glLightModelfv(Gl.GL_LIGHT_MODEL_AMBIENT, ambientlight);
            Gl.glMaterialfv(Gl.GL_FRONT, Gl.GL_AMBIENT_AND_DIFFUSE, gray);

            Gl.glRotatef(-45.0f, 1.0f, 0.0f, 0.0f);
            Gl.glRotatef(20.0f, 0.0f, 1.0f, 0.0f);
            Gl.glRotatef(30.0f, 0.0f, 0.0f, 1.0f);
            Gl.glBegin(Gl.GL_TRIANGLES);
            Gl.glVertex3f(0.0f, 0.0f, 60.0f);
            Gl.glVertex3f(-15.0f, 0.0f, 30.0f);
            Gl.glVertex3f(15.0f, 0.0f, 30.0f);

            // Black
            Gl.glColor3ub(0, 0, 0);
            Gl.glVertex3f(15.0f, 0.0f, 30.0f);
            Gl.glVertex3f(0.0f, 15.0f, 30.0f);
            Gl.glVertex3f(0.0f, 0.0f, 60.0f);

            // Red
            Gl.glColor3ub(255, 0, 0);
            Gl.glVertex3f(0.0f, 0.0f, 60.0f);
            Gl.glVertex3f(0.0f, 15.0f, 30.0f);
            Gl.glVertex3f(-15.0f, 0.0f, 30.0f);


            // Body of the Plane ////////////////////////
            // Green
            Gl.glColor3ub(0, 255, 0);
            Gl.glVertex3f(-15.0f, 0.0f, 30.0f);
            Gl.glVertex3f(0.0f, 15.0f, 30.0f);
            Gl.glVertex3f(0.0f, 0.0f, -56.0f);

            Gl.glColor3ub(255, 255, 0);
            Gl.glVertex3f(0.0f, 0.0f, -56.0f);
            Gl.glVertex3f(0.0f, 15.0f, 30.0f);
            Gl.glVertex3f(15.0f, 0.0f, 30.0f);

            Gl.glColor3ub(0, 255, 255);
            Gl.glVertex3f(15.0f, 0.0f, 30.0f);
            Gl.glVertex3f(-15.0f, 0.0f, 30.0f);
            Gl.glVertex3f(0.0f, 0.0f, -56.0f);

            ///////////////////////////////////////////////
            // Left wing
            // Large triangle for bottom of wing
            Gl.glColor3ub(128, 128, 128);
            Gl.glVertex3f(0.0f, 2.0f, 27.0f);
            Gl.glVertex3f(-60.0f, 2.0f, -8.0f);
            Gl.glVertex3f(60.0f, 2.0f, -8.0f);

            Gl.glColor3ub(64, 64, 64);
            Gl.glVertex3f(60.0f, 2.0f, -8.0f);
            Gl.glVertex3f(0.0f, 7.0f, -8.0f);
            Gl.glVertex3f(0.0f, 2.0f, 27.0f);

            Gl.glColor3ub(192, 192, 192);
            Gl.glVertex3f(60.0f, 2.0f, -8.0f);
            Gl.glVertex3f(-60.0f, 2.0f, -8.0f);
            Gl.glVertex3f(0.0f, 7.0f, -8.0f);

            // Other wing top section
            Gl.glColor3ub(64, 64, 64);
            Gl.glVertex3f(0.0f, 2.0f, 27.0f);
            Gl.glVertex3f(0.0f, 7.0f, -8.0f);
            Gl.glVertex3f(-60.0f, 2.0f, -8.0f);

            // Tail section///////////////////////////////
            // Bottom of back fin
            Gl.glColor3ub(255, 128, 255);
            Gl.glVertex3f(-30.0f, -0.50f, -57.0f);
            Gl.glVertex3f(30.0f, -0.50f, -57.0f);
            Gl.glVertex3f(0.0f, -0.50f, -40.0f);

            // top of left side
            Gl.glColor3ub(255, 128, 0);
            Gl.glVertex3f(0.0f, -0.5f, -40.0f);
            Gl.glVertex3f(30.0f, -0.5f, -57.0f);
            Gl.glVertex3f(0.0f, 4.0f, -57.0f);

            // top of right side
            Gl.glColor3ub(255, 128, 0);
            Gl.glVertex3f(0.0f, 4.0f, -57.0f);
            Gl.glVertex3f(-30.0f, -0.5f, -57.0f);
            Gl.glVertex3f(0.0f, -0.5f, -40.0f);

            // back of bottom of tail
            Gl.glColor3ub(255, 255, 255);
            Gl.glVertex3f(30.0f, -0.5f, -57.0f);
            Gl.glVertex3f(-30.0f, -0.5f, -57.0f);
            Gl.glVertex3f(0.0f, 4.0f, -57.0f);

            // Top of Tail section left
            Gl.glColor3ub(255, 0, 0);
            Gl.glVertex3f(0.0f, 0.5f, -40.0f);
            Gl.glVertex3f(3.0f, 0.5f, -57.0f);
            Gl.glVertex3f(0.0f, 25.0f, -65.0f);

            Gl.glColor3ub(255, 0, 0);
            Gl.glVertex3f(0.0f, 25.0f, -65.0f);
            Gl.glVertex3f(-3.0f, 0.5f, -57.0f);
            Gl.glVertex3f(0.0f, 0.5f, -40.0f);

            // Back of horizontal section
            Gl.glColor3ub(128, 128, 128);
            Gl.glVertex3f(3.0f, 0.5f, -57.0f);
            Gl.glVertex3f(-3.0f, 0.5f, -57.0f);
            Gl.glVertex3f(0.0f, 25.0f, -65.0f);

            Gl.glEnd(); // Of Jet

            Glut.glutSwapBuffers();
        }

        static void Main(string[] args)
        {
            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(600, 600);
            Glut.glutCreateWindow("Aljo  OpenGL Test 1");

            Init();

            Glut.glutDisplayFunc(new Glut.DisplayCallback(Display));
            Glut.glutReshapeFunc(new Glut.ReshapeCallback(Reshape));

            Glut.glutMainLoop();
        }
    }
}
Project 8 - Texture
project 8
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Tao.OpenGl;
using Tao.Platform.Windows;
using Tao.FreeGlut;

// werkend
// 6/6/2009 - 18:32
// Aljo_

namespace NeHe {

    public class Lesson06 {

        // --- Entry Point ---
        [STAThread]
        public static void Main() {

            Glut.glutInit();
            Glut.glutInitDisplayMode(Glut.GLUT_SINGLE | Glut.GLUT_RGB 
                                   | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(640, 480);
            Glut.glutInitWindowPosition(100, 100);
            Glut.glutCreateWindow("NeHe lesson 6");
            InitGL();
            Glut.glutReshapeFunc(ReSizeGLScene);
            Glut.glutDisplayFunc(DrawGLScene);
            Glut.glutMainLoop();         
        }

        static float xrot = 45.0f, yrot = 0.0f, zrot = 30.0f;
        static int[] texture = new int[1];

        public static void DrawGLScene() {
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);        
            // Clear The Screen And The Depth Buffer
            Gl.glLoadIdentity();                                                
            // Reset The View
            Gl.glTranslatef(0, 0, -5);

            Gl.glRotatef(xrot, 1, 0, 0);
            Gl.glRotatef(yrot, 0, 1, 0);
            Gl.glRotatef(zrot, 0, 0, 1);

            Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture[0]);

            Gl.glBegin(Gl.GL_QUADS);
                // Front Face
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(-1, -1, 1);
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(1, -1, 1);
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(1, 1, 1);
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(-1, 1, 1);
                // Back Face
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(-1, -1, -1);
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(-1, 1, -1);
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(1, 1, -1);
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(1, -1, -1);
                // Top Face
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(-1, 1, -1);
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(-1, 1, 1);
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(1, 1, 1);
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(1, 1, -1);
                // Bottom Face
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(-1, -1, -1);
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(1, -1, -1);
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(1, -1, 1);
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(-1, -1, 1);
                // Right face
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(1, -1, -1);
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(1, 1, -1);
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(1, 1, 1);
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(1, -1, 1);
                // Left Face
                Gl.glTexCoord2f(0, 0); Gl.glVertex3f(-1, -1, -1);
                Gl.glTexCoord2f(1, 0); Gl.glVertex3f(-1, -1, 1);
                Gl.glTexCoord2f(1, 1); Gl.glVertex3f(-1, 1, 1);
                Gl.glTexCoord2f(0, 1); Gl.glVertex3f(-1, 1, -1);
            Gl.glEnd();

            //xrot += 0.3f;
            //yrot += 0.2f;
            //zrot += 0.4f;
        }

        private static void InitGL() {
            if(!LoadGLTextures()) {                                             
            // Jump To Texture Loading Routine ( NEW )
            }

            Gl.glEnable(Gl.GL_TEXTURE_2D);                                      
            // Enable Texture Mapping ( NEW )
            Gl.glShadeModel(Gl.GL_SMOOTH);                                      
            // Enable Smooth Shading
            Gl.glClearColor(0, 0, 0, 0.5f);                                     
            // Black Background
            Gl.glClearDepth(1);                                                 
            // Depth Buffer Setup
            Gl.glEnable(Gl.GL_DEPTH_TEST);                                      
            // Enables Depth Testing
            Gl.glDepthFunc(Gl.GL_LEQUAL);                                       
            // The Type Of Depth Testing To Do
            Gl.glHint(Gl.GL_PERSPECTIVE_CORRECTION_HINT, Gl.GL_NICEST);         
            // Really Nice Perspective Calculations
        }

        private static Bitmap LoadBMP(string fileName) {
            if(fileName == null || fileName == string.Empty) {                  
            // Make Sure A Filename Was Given
                return null;                                                    
                // If Not Return Null
            }

            string fileName1 = string.Format("Data{0}{1}",                      
            // Look For Data\Filename
                Path.DirectorySeparatorChar, fileName);
            string fileName2 = string.Format("{0}{1}{0}{1}Data{1}{2}",          
            // Look For ..\..\Data\Filename
                "..", Path.DirectorySeparatorChar, fileName);

            // Make Sure The File Exists In One Of The Usual Directories
            if(!File.Exists(fileName) && !File.Exists(fileName1) 
                && !File.Exists(fileName2)) {
                return null;                                                    
                // If Not Return Null
            }

            if(File.Exists(fileName)) {                                         
            // Does The File Exist Here?
                return new Bitmap(fileName);                                    
                // Load The Bitmap
            }
            else if(File.Exists(fileName1)) {                                   
            // Does The File Exist Here?
                return new Bitmap(fileName1);                                   
                // Load The Bitmap
            }
            else if(File.Exists(fileName2)) {                                   
            // Does The File Exist Here?
                return new Bitmap(fileName2);                                   
                // Load The Bitmap
            }

            return null;                                                        
            // If Load Failed Return Null
        }

        private static bool LoadGLTextures() {
            bool status = false;                                                
            // Status Indicator
            Bitmap[] textureImage = new Bitmap[1];                              
            // Create Storage Space For The Texture

            textureImage[0] = LoadBMP("NeHe.Lesson06.NeHe.bmp");                
            // Load The Bitmap
            // Check For Errors, If Bitmap's Not Found, Quit
            if(textureImage[0] != null) {
                status = true;                                                  
                // Set The Status To True

                Gl.glGenTextures(1, out texture[0]);                            
                // Create The Texture

                textureImage[0].RotateFlip(RotateFlipType.RotateNoneFlipY);     
                // Flip The Bitmap Along The Y-Axis
                // Rectangle For Locking The Bitmap In Memory
                Rectangle rectangle = new Rectangle(0, 0, 
                          textureImage[0].Width, textureImage[0].Height);
                // Get The Bitmap's Pixel Data From The Locked Bitmap
                BitmapData bitmapData = textureImage[0].LockBits(rectangle, 
                          ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);

                // Typical Texture Generation Using Data From The Bitmap
                Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture[0]);
                Gl.glTexImage2D(Gl.GL_TEXTURE_2D, 0, Gl.GL_RGB8, 
                   textureImage[0].Width, textureImage[0].Height, 0, Gl.GL_BGR, 
                   Gl.GL_UNSIGNED_BYTE, bitmapData.Scan0);
                Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MIN_FILTER, 
                                   Gl.GL_LINEAR);
                Gl.glTexParameteri(Gl.GL_TEXTURE_2D, Gl.GL_TEXTURE_MAG_FILTER,
                                   Gl.GL_LINEAR);

                if(textureImage[0] != null) {                                   
                // If Texture Exists
                    textureImage[0].UnlockBits(bitmapData);                     
                    // Unlock The Pixel Data From Memory
                    textureImage[0].Dispose();                                  
                    // Dispose The Bitmap
                }
            }

            return status;                                                      
            // Return The Status
        }

        private static void ReSizeGLScene(int width, int height) {
             if(height == 0) {                                                   
             // Prevent A Divide By Zero...
                height = 1;                                                     
                // By Making Height Equal To One
            }

            Gl.glViewport(0, 0, width, height);                                 
            // Reset The Current Viewport
            Gl.glMatrixMode(Gl.GL_PROJECTION);                                  
            // Select The Projection Matrix
            Gl.glLoadIdentity();                                                
            // Reset The Projection Matrix
            Glu.gluPerspective(45, width / (double) height, 0.1, 100);          
            // Calculate The Aspect Ratio Of The Window
            Gl.glMatrixMode(Gl.GL_MODELVIEW);                                   
            // Select The Modelview Matrix
            Gl.glLoadIdentity();                                                
            // Reset The Modelview Matrix
        }
    }
}
texture image, click on this link to download it.