Sign in to follow this  

Moving out of the command line with C++

This topic is 2843 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

Hello there, I attend Cal State Fullerton and am towards the end of my opening programming classes but on my own time I'm always trying to move ahead and learn the next thing up on my own time. However, I'm wondering how to break out of simple command line programs and use the windows interface instead. I know I have to learn the windows API but I guess I am unclear as to what connection that has to my current language (C++) or if it's completely different, or if it can be programmed in different languages. I've found simple tutorials on how to get started with windows API to make simple boxes but that really doesn't help me if I don't know how to actually program in that way. I guess what I am asking is what is the connection or jump I should make with knowing a fair amount of C++ (pretty solid concept of OOP, classes, pointers, arrays, ect.) and getting out of the simple command line programs I've been making for 3+ semesters. I've already made a little text-based RPG because text was the only tool I had at the time and I'm eager to push on with something more substantial, in fact the suggestion of a Tetris clone from this site seems like a perfect challenge for me at the moment. Thank you for your help!

Share this post


Link to post
Share on other sites
Hi!

It's my personal opinion that programming win32 GUI applications in C++ is a PITA. If you want to stick with C++ and make games, why not look at something like SDL? Easier to get started with and probably faster.

Another option is to try another language. C# has a similar syntax and is alot easier to use for graphical user interfaces in my opinion.

Although, reading your post again, perhaps you are asking something else completely..?

If you are asking whether or not C++ is any different when working with win32 then the answer is no, just #include <windows.h> and you get access to all functions and structs you need.

If you are asking whether or not win32 api is locked to C/C++, then the answer is also no, but it's meant for C/C++. For many languages and technologies there are wrappers, but you might as well use abstraction layers/libraries to simplify development.

Win32 API was made in a very powerful and flexible way, but it's not very simple to use when compared to many alternatives.

Share this post


Link to post
Share on other sites
Yes, definitely look into using a nice wrapper API like SDL. It will make everything so much nicer to use. That's a nice way to 2D graphics and you'll definitely still learn a great deal. After that, it's not a large leap to get OpenGL running with SDL so you can start getting in to 3D.

Tetris using SDL is a great next step

- me

Share this post


Link to post
Share on other sites
Thank you for the information, that is useful. I guess I'm a bit more ignorant towards higher programming than I thought hehe. I'm guess I'm more confused about what Win32 API "is," in a sense. Multiple languages can program with it?

If it is indeed a pain to program with it in C++ that's ok I'm not beyond putting the work into it to learn.

Perhaps my question is just how I can get started using C++ to create programs beyond the basic command line, and with a modern, as we see it today, windows setting. I think my own ignorance of windows API caused the confusion, sorry.:)

Any books or sites related to this, or links I should read to further understand what it is would be appreciated, thank you again!

Share this post


Link to post
Share on other sites
Quote:
I'm guess I'm more confused about what Win32 API "is," in a sense
It's an API. Microsoft has provided a way for you to work with their operating system through code. Thus, the term API (application programming interface). This interface is exposed in the C language. That means C and C++ can use the API.

Quote:
Multiple languages can program with it?
I think the previous posts were a bit misleading. The Win32 API is a C API, so only C and C++ use it directly. What people have been able to do is wrap a part of this API and provide a new API in other languages. Or sometimes, there are other ways to make use of this API. I wouldn't worry about the topic of using one language API from another until you have more experience.

Quote:
Perhaps my question is just how I can get started using C++ to create programs beyond the basic command line, and with a modern, as we see it today, windows setting.
You need to acquire a widget or GUI toolkit available in your chosen language (C++ in this case). The Win32 API provides such functionality. So do other toolkits. Qt, WxWidgets, GTK+, FLTK, etc.

You're thinking making a window is something special. It's not. It's just using an API.

Share this post


Link to post
Share on other sites
oler1s thank you that sheds a bit more light on it. I was confused on the connection of the two things (c++ language and windows API) and now I understand a bit better. I've been out looking for information on how to get started and I have some blank windows going now at least.:) I think I was thinking backwards, that the Win32 API was a much greater thing than a toolkit and you had to use a language, like C++ to alter it. Now I understand it's just more tools, but in this case they enable you interact with the windows interface with your own C++ code.

Again any links to books, resources, or good tutorials is appreciated. Thank you for the information everyone!

Share this post


Link to post
Share on other sites

This topic is 2843 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this