You may choose to program in Microsoft .NET development environment using either C# or C++.

8    Microsoft .NET development environment and C++

To program in .NET environment using C++ is just like using Visual C++. For example, we will use program 1.1.point.c (http://cs.gmu.edu/~jchen/graphics/book/examples/1.1.point.c) as an example and your working directory is C:\Sample.

o      Before you start using .NET environment to program

    Please make sure you’ve downloaded the latest version of GLUT GUI library (glutdll.zip) at http://www.xmission.com/~nate/glut.html.

    Copy all the .dll files to both C:\WINDOWS\system and C:\WINDOWS\system32 directories.

    Copy all the .h files to the directory where you’ve installed Visual .NET, usually at C:\Program Files\Microsoft Visual Studio .NET\Vc7\include\GL.

    Copy all the .lib files also to the directory where you’ve installed Visual .NET, usually at C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib.

o      Start up Microsoft Visual Studio .NET environment. Select “File”à “New” à “Project”. In “Project Types”, select “Visual C++ Projects”. In “Templates”, select “Managed C++ Empty Project”. In “Name”, input “points”. In “Location”, select C:\Sample. Press “OK”.

o      Press Ctrl+Alt+L to open the “Solution Explorer”. Right click on “Source Files”. Select “Add” à “Add New Item”. Select “C++ File (.cpp)”. In “Name”, input “points”. In “Location”, select “C:\Sample\points”. Press “OK”.

o      Copy and paste the content of 1.1.point.c to points.cpp and then save the file.

o      Select “Build” à “Compile”.

o      In the Solution Explorer, right click “points”. Select “Properties". Select “Linker” à “Command Line”. In “Additional Options”, input “opengl32.lib glu32.lib glaux.lib glut32.lib”. Press “OK”.

o      Select “Build” à “Build points”. After it successfully builds points, select “Build” à “Build Solution”.

o      Select “Debug” à “Start”. You should be able to see the program generate random red dots in a new window.

8    Microsoft .NET development environment and C#

C#(pronounced "C sharp") is a modern, object-oriented language that enables programmers to quickly build a wide range of applications for the new Microsoft .NET development environment, which provides tools and services that fully exploit both computing and communications. C# is generally regarded as being a successor to C++ that incorporates and improves upon the major innovations made in the Java programming language.

o      C# OpenGL Wrapper

OpenGL is a platform-independent rendering API. There is not yet a version of .NET which supports OpenGL. But you may find several C# OpenGL wrappers that are currently freely available. You may do a Google search with the key words “C# OpenGL wrapper”.

The simplest C# OpenGL wrapper will be “Colin Fahey's C# OpenGL Wrapper”. Detailed information about this wrapper may be found at http://www.colinfahey.com/opengl/csharp.htm. This web page contains a detailed explanation of how to install, run and test the wrapper.

The most popular C# OpenGL wrapper is an open source wrapper CsGL at http://csgl.sourceforge.net/. Please make sure to read the FAQ of the website, which includes the information about how to use C# with CsGL, how to install/deploy CsGL and other detailed explanation about the difference between the OpenGL APIs and csGL ones.

o      It is recommended to use Colin Fahey's C# OpenGL Wrapper cause it’s simpler and rather easier to install. But you are by no means to be restricted to it. If you will be using Microsoft .NET to do your project, please make sure to include the information about the type of wrapper you are using and the steps of running your project when submitting it.