Skip to main content
GameDev.net gamedev.net
🔒 Locked

Question about C++

Started by fishfin Aug 19, 2006 at 3:11 AM 11 replies 1.4k views
Original Post
fishfin
fishfin
Is it possible to create a program in C++ that has pictures, buttons... in it insteasd of that window with a black backround and white text?
dave
dave
Yes.

What you are currently writing is something called a console application. You want to look into using a Win32 Application project if you are using Visual Studio, if not, well its named something very similar in most other IDEs so poke around.

If you want to display real-time graphics then you will need to start working with a graphics API such as OpenGL, SDL or Direct3D. Google for any of these names and you will get lots of help.

Hope that helps,

Dave
fishfin
fishfin
How would I make like a menu where you click on whatever you want (as aposed to arrow keys and enter)

and are any of those programs free?
dave
dave
You will have to start learning the WIN32 API for that. Alternatively you can use wxWidgets, a rapper for the WIN32 API, to make your programs.

Google WIN32 and wxWidgets.

If you want a bog standard windows app, try C#.

Dave
bballmitch
bballmitch
It sounds like you might want to look into Java instead of C++ (java is much easier for creating a very quick and easy GUI)
Mitchen Games
fishfin
fishfin
I've tried java but the only compiler I can find is on the java home page and I can't figure out how to installed right...
dave
dave
I strongly recommend C# for this. Java is fine ofcourse.
fishfin
fishfin
What is C#?
bballmitch
bballmitch
Quote:
Original post by fishfin
I've tried java but the only compiler I can find is on the java home page and I can't figure out how to installed right...



There's two really good IDEs that you could try (both free). Netbeans and JCreator ...google either one. They're both very good.
Mitchen Games
fishfin
fishfin
Ok, let me change my origional question slightly, how would I write a program, using C++, and all it does is dispalays a single bmp image (and closes once you hit enter)?
Aardvajk
Aardvajk
Assuming Windows, you would need to create a Windows application somehow, either directly or with a library as suggested above.

If you create a new project in Visual Studio and specify Windows Application in the create project wizard, that will give you a skeleton application that creates a window.

There is an API call called LoadImage that can give you a handle to a bitmap loaded from a file, and another one called StretchBlt that will let you draw the bitmap onto your window in the OnPaint handler.

To close on Enter, you'd need to add a WM_KEYDOWN or WM_KEYPRESS handler to the WndProc function that called PostMessage(Hw,WM_CLOSE,0,0).
memento_mori
memento_mori
Hello

Writing Win32 apps with no console (the black window with white text) is a bit harder to understand if you're new to programming.

I suggest you don't learn this stuff until you are already a little advanced in C++.. a complete newbie in C++ might get discouraged by this.

now here are 2 Tutorials I found:
http://www.mdstud.chalmers.se/%7Emd7amag/code/wintut/
http://www.winprog.org/tutorial/

Remember, avoid Java like the plague (and C# for that matter :P) The pros stick with C++.. (I better run before they start flaming me :P LOL )

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.