I am a new user of OpenTK. Is there some example code of using C++ with OpenTK?
OpenTK is a C# wrapper around OpenGL and OpenAL and would not be good to use from C++.
If you want to use C++ with OpenGL or OpenAL there are plenty of tutorials on the net.
@Zhaoguang - try with the Simple Directmedia Library for c++ and OpenGL. For OpenAL, I don't know.
To use OpenTK from C++ you'll have to use the C++/CLI dialect. Unfortunately, only Microsoft provides a C++/CLI compiler and the resulting code will only run on Windows (which negates one of the main benefits of OpenTK).
Here is a rough outline of a simple OpenTK program:
I wish I could help you with actual code, but I have never used C++/CLI. If you are familiar with the dialect it should be relatively easy to translate that into code. Don't hesitate to ask if you need more details.
Site design by Stefanos A. Icons courtesy of gnome-colors.