[.net] C# or Win32

Started by
8 comments, last by Andrew Russell 19 years, 8 months ago
Hi all, I am good @ C++ & Java and an average user with OpenGL. I am trying to emulate some OpenGL tutorials without using GLUT as I would like to gain experience in Microsoft environment. I donno Win32 or C#. Which is better to start and learn considering the future perspective of .NET? some ppl. say Win32 and some say, go for C# ~ charley
Advertisement
I suggest learning C# with Windows Forms first. Win32's usefulness will be going out the windows eventually and C# has a MUCH lower learning curve.

Keeping what I said in mind, I think you should eventually also take a practice run with raw Win32 just so you know how to work with it. Even with Longhorn coming out, and with .NET, alot of code will still use Win32.
do you recommend any tutorials or books for the same? do you think my proficiency in Java would shorten the C# learning curve.

~ charley
Yes, C# and Java are very much alike.
The main difference is in the different libraries set.
Take a peek at C# in a Nutshell. It's my most-used reference.
Win32 and C# are two completely different things. Win32 is an API, C# is a language. The Windows forms you use through C# are just a layer on top of Win32, and there is nothing preventing you from using raw Win32 in C#.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Quote:Original post by Raloth
Win32 and C# are two completely different things. Win32 is an API, C# is a language. The Windows forms you use through C# are just a layer on top of Win32, and there is nothing preventing you from using raw Win32 in C#.


True, but using C# to act as a layer over the Win32 API is a lot faster than learning it from scratch. You can learn the details of the lower-level Win32 calls when you want/need to.

I'd start with C# and then delve into the win32 API as needed.
-Ben"If you can dream it, you can do it. Always remember that this whole thing was started with a mouse." - Walt Disney
I think win32 is mostly delegated for writing gui frameworks like MFC with. I use primarily MFC because it's easier to work with than win32 but I also must use some win32 for those things not in MFC. There's just not much sense to write a C centric gui app nor to mimick MFC with win32 and OO mechanism. .Net is also something to consider using as well. For speed I would go with C++/mfc or C++/.net otherwise C#/.net combo(ie. all managed). For engines I would use win32 because of low overhead. Also, if you try to do some exotic things then win32 is very flexible much more than MFC.
Professional C# Second Edition from WROX Press

GREAT BOOK - I push it on everyone interested in .NET :-)
If you're just doing an OpenGL engine (and you want to replace GLUT), definatly use win32 and avoid the overhead of C#, .NET and Windows Forms (also applies to MFC).

Grab some early NeHe tutorials and use them - they have the bare minimum of win32 stuff to get your window up on screen (basicly what GLUT does). Also check out the (newer, better) basecode once you're comfortable with the tutorial.

I would suggest the tiny ammount of win32 you need for this is eaiser (and has less overhead) than having to learn and use Windows Forms (or MFC).


The only reason you'd want to use Windows Forms is if you're actualy going to use the controls (like buttons, text entry fields, whatever). This might apply if you're going to be making a tool for your engine (level editor, perhaps). Getting OpenGL to work in Windows Forms isn't too hard, but it's not as easy as win32.


On my own project, my engine is unmanaged C++ using win32 and OpenGL, my editor is mixed managed and unmanaged C++ using Windows Forms and OpenGL. So I've tried both, and I wouldn't dream of having my engine anything other than win32. (and I wouldn't dream of using win32 for anything more complicated than a single window).


Of course, this dosn't say you couldn't do it in C# the language using win32, but as you already know C++, then I wouldn't worry about it (not to mention, with C# you'll have the overhead of .NET still).

This topic is closed to new replies.

Advertisement