Jump to content

  • Log In with Google      Sign In   
  • Create Account


I'd like to make a C++ game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 King of the Boneheads   Members   -  Reputation: 115

Like
0Likes
Like

Posted 10 October 2012 - 01:49 AM

Hello people of GameDev.net (This is my first forum thread)

So I'm fairly new to C++ and I've made basic things and I'm working on a Text Adventure right now but once I do make a game, I've hit one bump in the road.
When I code something in C++, it runs it in what looks like Command Prompt.
Confused...
I'd assume it's because C++ won't come with anything super-fancy and I guess I'm fine with it but my real question is:
How do you turn your C++ .exe file look like a regular old program/game on Windows?
I believe it has something to do with .txt files and collecting files from your computer, but I just need to know HOW to do it.

Thanks in Advance.

Regards, King of the Boneheads.
A Noobie C++ Developer.

I use Code::Blocks with GNU GCC Compiler, and Allegro 5 Libraries.

I'm a W.I.P., please be patient with me!

Sponsor:

#2 Olof Hedman   Crossbones+   -  Reputation: 2654

Like
3Likes
Like

Posted 10 October 2012 - 02:09 AM

Your program need to use the windows api:s to create a window, and define a message loop that handles the messages the windowing system generates for user input and redraws and such. And then respond in a sensible way to some of them.

That you don't have to write yourself though, the easiest is to use a library like SDL to handle the gritty details of the windows api.
It will let you easily create a window and define how it draws itself and handle user input.

#3 SimonForsman   Crossbones+   -  Reputation: 5770

Like
2Likes
Like

Posted 10 October 2012 - 02:13 AM

Hello people of GameDev.net (This is my first forum thread)

So I'm fairly new to C++ and I've made basic things and I'm working on a Text Adventure right now but once I do make a game, I've hit one bump in the road.
When I code something in C++, it runs it in what looks like Command Prompt.
Confused...
I'd assume it's because C++ won't come with anything super-fancy and I guess I'm fine with it but my real question is:
How do you turn your C++ .exe file look like a regular old program/game on Windows?
I believe it has something to do with .txt files and collecting files from your computer, but I just need to know HOW to do it.

Thanks in Advance.

Regards, King of the Boneheads.


C++ doesn't have any concept of Windows etc so you have to use the OS API (Win32 for Windows), or a library that wraps it, (SFML is nice for games, QT or wxWidgets are nice for desktop applications). (Google SFML tutorials to get started)

Edited by SimonForsman, 10 October 2012 - 02:16 AM.

I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#4 kidman171   Members   -  Reputation: 498

Like
1Likes
Like

Posted 10 October 2012 - 06:10 AM

Hello people of GameDev.net (This is my first forum thread)

So I'm fairly new to C++ and I've made basic things and I'm working on a Text Adventure right now but once I do make a game, I've hit one bump in the road.
When I code something in C++, it runs it in what looks like Command Prompt.
Confused...
I'd assume it's because C++ won't come with anything super-fancy and I guess I'm fine with it but my real question is:
How do you turn your C++ .exe file look like a regular old program/game on Windows?
I believe it has something to do with .txt files and collecting files from your computer, but I just need to know HOW to do it.

Thanks in Advance.

Regards, King of the Boneheads.


King of the Boneheads:
When you use a standard library function such as
std::cout
, your program will output the results to the default standard output which is a console window. If you want to output the results of your program to your own graphical window ( commonly referred to as a gui (pronounced "gooey") ), you need to create one. One option is to use the Win32 API, but it is not that beginner-friendly. What you might want to do is check out some of the great GUI libraries available, such as the ones mentioned above.

Edited by kidman171, 10 October 2012 - 06:12 AM.


#5 ByteTroll   Prime Members   -  Reputation: 1164

Like
1Likes
Like

Posted 10 October 2012 - 08:43 AM

I'd assume it's because C++ won't come with anything super-fancy

C++ is a programming language, not an API. API's are created with programming languages.

How do you turn your C++ .exe file look like a regular old program/game on Windows?

If you want to create a graphical GUI under Windows you are going to need to use the Win32 API. Here is a start http://www.winprog.org/tutorial/
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
I see the future in 1's and 0's
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

#6 menyo   Members   -  Reputation: 401

Like
-3Likes
Like

Posted 10 October 2012 - 12:56 PM

Are you aware that you picked the most difficult and harsh programming language out there?

Yes C++ gives you control over everything especially the memory usage to create state of the art games because you can make things run very efficient. But what is your goal here? Creating games i assume? My guess is you would be better off with another language, at least for the time being. You will notice that most languages use fairly same syntax so jumping over to another should not give you much trouble.

There are several option here, i personally like C# + XNA, while still fully in control of what you create XNA lets you jump right into drawing sprites on the screen and coding behavior. Even with XNA a finished game takes a long time to make but all the back end is done for you. You can see XNA as SFML for C++, but visual studio c# is a much user friendly environment.

Java and Python are also good options to explore.

You could also go for a game engine like UDK or Unity. Both are 3D engines that can be used right away to import assets. UDK is amazing if you want to make somekind of 1st or 3th person view game. It requires no coding to still make something very unique but does allow you to input code in the form of unreal script (much like C++). I never tried unity i believe it gives you a bit more freedom on the type of game you want and works with C#, C++ and Javascript.

If you really want to save yourself from coding, which i doubt since you started in C++, you could take a look at RPG maker or game creator.

-edit-
Whats with the down voting? I am giving more pointers then you haters ever give. C++ is the most difficult language out there and the guy is a beginner so i give him choices. Up to him what he chooses.

Edited by menyo, 11 October 2012 - 04:36 PM.

Current Project: TechnoFlux read all about it on my

DEV BLOG


#7 Pointer2APointer   Members   -  Reputation: 283

Like
2Likes
Like

Posted 10 October 2012 - 02:47 PM

When I code something in C++, it runs it in what looks like Command Prompt.


Because your build target is set to a console/terminal command-line window(in Windows this is DOS-style command-prompt).

It is text-based only - no images or graphics(unless they're made with character symbols or ASCII art).

There are a few options you have here, and quite some understanding that would help you out here.

Windows graphic-based applications on Windows OS run through software known as DirectX or DirectDraw for windowed graphics, and use the Windows API to manage the controls for the windows(GDI/GDI+ are used as well).

This stuff is a complete different implementation on command-prompt windows.

There are libraries that offer "wrapping" for this to avoid directly interfacing with this stuff for development if you find Windows API and DirectX to be hard(which many do find them to be).

As mentioned, SDL will "wrap" around the lower-level abstractions necessary for window management and graphics(such as DirectX and WinAPI). What this does is gives you an interface that will get you things done faster and easier than with Windows API/DirectX directly.

SFML will do the same, and so will many other libraries providing abstraction from the lower-levels of user-space software rendering of the operating system.

Aside from what the C++ disliker above is saying, SDL or Allegro is probably what you should be working on and studying now:

http://lazyfoo.net/S...rials/index.php

http://wiki.allegro....egro_5_Tutorial

All of the lower-level abstractions come with more programming experience. The Windows API is the lowest-level API that controls all window structuring and management on all Windows OSes so far, to note. It works alongside with DirectX for optimum software rendering. Learning them both can be ideal and useful, but at this point it would be a little farfetched.

I believe it has something to do with .txt files


Absolutely nothing to do with text files.

Edited by Pointer2APointer, 10 October 2012 - 02:51 PM.

Yes, this is red text.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS