Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How To Crank Up simple WINAPI + OpenGL app window? ^_^
How to get in WINAPI from C# ?
Posted

1 solution

Windows API is already represented in .NET FCL by the library System.Windows.Forms:
https://msdn.microsoft.com/en-us/library/system.windows.forms%28v=vs.110%29.aspx[^].

If something else is needed, it is done through P/Invoke:
http://en.wikipedia.org/wiki/Platform_Invocation_Services[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

Using P/Invoke for direct access to OS is best avoided, because it can greatly compromise platform compatibility. In almost all cases, all you may need from the OS API is already included in .NET FCL in the most compatible way. See also: http://en.wikipedia.org/wiki/Framework_Class_Library[^].

OpenGL is wrapped, in particular, in 3rd-party open-source products OpenTK and SharpGL:
http://www.opentk.com[^],
http://sourceforge.net/projects/opentk[^],
http://sharpgl.codeplex.com[^].

See also these CodeProject articles:
OpenGL in .NET - Getting Started[^],
SharpGL: A C# OpenGL Class Library[^].

—SA
 
Share this answer
 
v4
Comments
Daria_Lazur 30-Jan-15 5:00am    
SharpGL fits quite well, thanx!

But I was initially intended to use P/Invoke exactly. ^_^ Bad idea, I know.
Sergey Alexandrovich Kryukov 30-Jan-15 11:48am    
Very good, you are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900