Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Bodiger

The jump to grahical/windows programming

This topic is 5221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve just finished re-reading my c++ and c# beginner style books. I think i may finally be ready to start using one of the api ,sdk''s or something like that. I''ve looked at some of the openGL tutorials on Nehe but find all the stuff just to create the window to be a bit overwhelming. I would like to start of steady with something that is not too difficult so i can gradually work my way up from there. It''s not game programming i want to start with right away so i was leaning more towards Win32. Another question that i have regards how these API''s and SDK''s etc relate to c++ or c#. Would i write the programs in my current compiler and just include a few files or what? cheers

Share this post


Link to post
Share on other sites
Advertisement
What is your current compiler?

While windows creation code tends to look daunting, the reality is that it''s usually coookie-cutter. You cut and paste the garbage over (or get it auto-generated, depending on your compiler), then you start doing your stuff immediately. Unless, of course, you have a propensity for wheel-reinvention

-fel

Share this post


Link to post
Share on other sites
I have Dev-c++ and the csc c#.

I can get dev-c++ to create my basic window code for me. The trouble with me is that i like to know how every single little piece of code works.

I would prefer to use c# for my windows programming. I''m assuming this is possible but wold i just use it like c++? As in include windows.h and write my code?

Share this post


Link to post
Share on other sites
C# makes it a lot easier to display windows on the screen and get started. For starters, look in the examples and documentation that came with the .NET SDK for how to use Windows components from within C#. Basically, you can just create objects like Window, Button and TextBox, set their positions, and show the window. I think there are C# tutorials on NeHe; if not, you can also download the DirectX SDK, which contains "Managed DirectX", which can be used from within C# (and probably also requires less set-up code than the C++ DirectX API). No matter what you use, you'll have to somehow link the external library to your application, probably with a command-line argument for csc.

[edited by - Matei on June 6, 2004 12:25:32 PM]

Share this post


Link to post
Share on other sites
Windows in C# is MUCH easier than Windows in C++. With C++ you not only have to create a window, but a window class and a WinProc. That can take a lot of code.

To do the exact same thing in C# takes exactly one line of code inside your Main function:

Application.Run(new Form());

Managed DirectX is also a little easier to use than "normal" directx, but if you learn one, you wont''t have much trouble with the other.

Share this post


Link to post
Share on other sites
So if I put:

Application.Run(new Form());

in my code it should magically make my entire window for me with everything on it and how I want it to look? Hmmm...

Share this post


Link to post
Share on other sites
He didn''t say it would put everything onto the window, he jsut said that it would create a window. In C++ this is a lot harder to do.

Share this post


Link to post
Share on other sites
It''s not really that hard in C++, it just depends on what framework your using.
If you''re developping windows app using Borland''s C++ Builder, it is as easy as creating a new Apllication. The IDE will automaticclay generate the code to hook a new form into the application.
Adding controls to the form as well as changing its size etc. can all be done through a visual interface by drag and dropping stuff onto the form.

I''m sorry if my post deviates somewhat from the original topic, but i juse wanted to point out that it is not C# that makes it easy to create windows apps. It is the .NET framework that makes it so easy. And with a proper framework it can be just as easy in C++ to make windows apps as it is in C#.NET.

Share this post


Link to post
Share on other sites
quote:
Original post by Holy Fuzz
To do the exact same thing in C# takes exactly one line of code inside your Main function:

Application.Run(new Form());



Actually, you don''t even need that. Just start a new Windows application and you don''t have to write one line of code to display a window. It''s all done for you. Drag and drop a few controls onto the form, maybe write a couple of lines of code and you''ve got a simple app. You can write a simple Notepad app with about a half-dozen lines of code.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!