Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Switching between graphical mode?

This thread is locked; no one can reply to it. rss feed Print
Switching between graphical mode?
Zdravko
Member #6,994
March 2006
avatar

I am writing a win32 console application under MVC++ 2005. After the iser inputs some data via std::cin, I graphical visualization begins. I have 2 questions:
1. By pressing a key, how do I return back to console mode, that is to close the graphical screen. Or just pass the current focus to the console window in order for my std::cin to work again?
2. How do I return back to graphical mode?

miran
Member #2,407
June 2002

set_gfx_mode(GFX_TEXT,80,25,0,0);
Might work, might not, I don't know.

But the real question here is, why do you want to force your user to type input at the command prompt. Why not make a proper user interface instead?

--
sig used to be here

Zdravko
Member #6,994
March 2006
avatar

miran , ok. Now tell me how do I input real numbers with Allegro? That is input like 1, 2, 300, 5.5454, -43.0021 ?

miran
Member #2,407
June 2002

Or use the Allegro GUI or one of the GUI add-on libraries (such as for example MASkinG), put an editbox on the screen (or a slider or whatever you want) and get input from there...

--
sig used to be here

Zdravko
Member #6,994
March 2006
avatar

miran, thank you fot the help.
With uatof(); I can convert a C string into a double. But how do I create the GUI for the input? I need something very simple - a couple of edit boxes and a few buttons will do the work.

miran
Member #2,407
June 2002

Read the Allegro manual, the section about the GUI.

--
sig used to be here

piccolo
Member #3,163
January 2003
avatar

hey take a look at my game i do some input there along with some other goodies

http://www.allegro.cc/depot/Thegame/

look in "Textbox.h"

good luck

ps:right a review if you have a spear min . good luck

wow
-------------------------------
i am who you are not am i

Go to: