Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Simulating a console program?


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
13 replies to this topic

#1 lmsmi1   Members   -  Reputation: 126

Like
0Likes
Like

Posted 16 June 2013 - 07:25 PM

Apparently standard C++ doesn't offer fullscreen consoles in Win7, so I've come to OpenGL with high hopes. I figure there's some way to make a virtual console in C++ with OpenGL somehow, so let's get to what I want to make:

 

1. I don't want to make an OS, I just want a fullscreen (no window or borders, just a black BG with text on it) application.

2. I want it to look like DOS (refer to 1).

3. I don't want to make a CLI, I want to make a small console program that takes up the whole screen.

 

Does anyone know how to achieve my goal? Do I even need to use OpenGL?



Sponsor:

#2 zacaj   Members   -  Reputation: 643

Like
0Likes
Like

Posted 16 June 2013 - 08:11 PM

SDL should be enough.  Just get a BMP of all the characters you can print and make an array you can "print" into.



#3 lmsmi1   Members   -  Reputation: 126

Like
0Likes
Like

Posted 16 June 2013 - 08:31 PM

SDL should be enough.  Just get a BMP of all the characters you can print and make an array you can "print" into.

How am I supposed to get a BMP of every character? And by array you mean a BITMAP array?



#4 AfroFire   Members   -  Reputation: 393

Like
0Likes
Like

Posted 16 June 2013 - 08:32 PM

Could you tell us what this is for? There is lots of ways to get something that "looks" like a console but functions nothing like one. Is the functionality important?
AfroFire | Brin"The only thing that interferes with my learning is my education."-Albert Einstein

#5 zacaj   Members   -  Reputation: 643

Like
0Likes
Like

Posted 16 June 2013 - 08:34 PM

Make a console program that prints out each character and then take a screenshot?  



#6 alnite   Crossbones+   -  Reputation: 2123

Like
0Likes
Like

Posted 17 June 2013 - 12:36 AM

 

SDL should be enough.  Just get a BMP of all the characters you can print and make an array you can "print" into.

How am I supposed to get a BMP of every character? And by array you mean a BITMAP array?

 

 

Oh look what I found on Google:

 

http://www.dafont.com/perfect-dos-vga-437.font



#7 lmsmi1   Members   -  Reputation: 126

Like
0Likes
Like

Posted 17 June 2013 - 09:03 AM

 

 

SDL should be enough.  Just get a BMP of all the characters you can print and make an array you can "print" into.

How am I supposed to get a BMP of every character? And by array you mean a BITMAP array?

 

 

Oh look what I found on Google:

 

http://www.dafont.com/perfect-dos-vga-437.font

 

 

How am I supposed to use a TTF in SDL? (I know about SDL_ttf() and such.) I'm assuming I make a black BG that takes up the whole screen, then assign a letter in the TTF to each keystroke? That should work, correct?


Edited by lmsmi1, 17 June 2013 - 09:03 AM.


#8 zacaj   Members   -  Reputation: 643

Like
0Likes
Like

Posted 17 June 2013 - 10:39 AM

 

 

 

SDL should be enough.  Just get a BMP of all the characters you can print and make an array you can "print" into.

How am I supposed to get a BMP of every character? And by array you mean a BITMAP array?

 

 

Oh look what I found on Google:

 

http://www.dafont.com/perfect-dos-vga-437.font

 

 

How am I supposed to use a TTF in SDL? (I know about SDL_ttf() and such.) I'm assuming I make a black BG that takes up the whole screen, then assign a letter in the TTF to each keystroke? That should work, correct?

 

If you know about SDL_ttf then what's the problem?



#9 lmsmi1   Members   -  Reputation: 126

Like
0Likes
Like

Posted 17 June 2013 - 10:57 AM

@zacaj

 

The problem is getting individual characters from the TTF and assigning them each to a keystroke.



#10 japro   Members   -  Reputation: 887

Like
0Likes
Like

Posted 17 June 2013 - 11:17 AM

For a monospaced console font just use a "spritesheet" Its fairly easy to then create a console by either instancing those or doing it via clever texture lookups on a fullscreen quad (see how libtcod does it for example).



#11 kunos   Crossbones+   -  Reputation: 2207

Like
0Likes
Like

Posted 18 June 2013 - 02:48 AM

Why would you use a 3D api or a game api to create a black borderless window with some text on it?

It can be done with pretty much every language that can talk to Win32.. C++/Win32 for sure (as I've said, just create a borderless maximized window and put text on it).. C++/MFC (yuk).

In C# this is done with zero code in 3 minutes.

You can bazinga the planet and do it in a Windows Store App in C++ using DX11.. but what's the point?

 

Maybe I am missing the point.


Stefano Casillo
Lead Programmer
TWITTER: @KunosStefano
AssettoCorsa - netKar PRO - Kunos Simulazioni

#12 japro   Members   -  Reputation: 887

Like
0Likes
Like

Posted 18 June 2013 - 06:51 AM

Actual console APIs (curses?) tend to be very restrictive and not very portable depending on your requirements (color...). As a result a lot of "ascii games" like roguelikes or Dwarf Fortress actually run their own console emulation in OpenGL. Also its most likely faster. I can run a full screen "console" in OpenGL on my crappy netbook (GMA3150) at a cost of less than a millisecond per frame while doing the same in a console API is significantly slower.

 

btw. modern style dx/ogl are really just general purpose graphics APIs and using them for non 3D isn't overkill at all.



#13 kunos   Crossbones+   -  Reputation: 2207

Like
0Likes
Like

Posted 18 June 2013 - 07:20 AM

I have must missed the requirement that it needs to have a big black window with characters and run at 50000fps my bad :-S

 

So ya sure.. roll on your DX11/OpenGL font rendering system to do the same thing you can do in 3 minutes with C#.. it's your time mate.


Stefano Casillo
Lead Programmer
TWITTER: @KunosStefano
AssettoCorsa - netKar PRO - Kunos Simulazioni

#14 BitMaster   Crossbones+   -  Reputation: 4233

Like
0Likes
Like

Posted 19 June 2013 - 06:07 AM

Actual console APIs (curses?) tend to be very restrictive and not very portable depending on your requirements (color...). As a result a lot of "ascii games" like roguelikes or Dwarf Fortress actually run their own console emulation in OpenGL. Also its most likely faster.


Are you certain about that? When I looked into it (admittedly, quite a while ago) the standard Dwarf Fortress client used pdcurses. However, pdcurses has several versions. One version uses the standard native OS console and one version uses SDL to render using a supplied bitmap font.




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