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

Simulating a console program?

Started by lmsmi1 Jun 17, 2013 at 1:25 AM 12 replies 4k views
Original Post
lmsmi1
lmsmi1

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?

zacaj
zacaj

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

lmsmi1
lmsmi1

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?

AfroFire
AfroFire
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
zacaj
zacaj

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

alnite
alnite

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

lmsmi1
lmsmi1

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?

zacaj
zacaj

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?

lmsmi1
lmsmi1

@zacaj

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

kunos
kunos

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.

japro
japro

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.

kunos
kunos

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.

BitMaster
BitMaster

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.

Topic Locked

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

Sign in to reply to this topic.