• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[C++/SDL] Console class (GUI)

Custom Title Activated
Loyal Member
Joined
Jun 28, 2007
Messages
2,986
Reaction score
3
Hi there,

I've been working on a GUI console class, which will (in SDL) draw a console for you :). Its written in C++ and uses SDL + SDL_ttf for the drawings.

The console contains:
- ttf font handling
- a cursor, indicating at which position you are (movable)
- automatically add an enter if it exceeds the width
- a variable line in which people can edit, once they press return it will submit it, if Shift+return is pressed it will just add an enter

I think it can be optimised and improved more, so every suggestion or complaint can go here :).

Thanks for using and/or discussing/improving :)

Download:

Keys useable:
- any character key
- return (and with shift pressed)
- delete, backspace, tab
- left, right, up, down
- home, end

Source files:
- codeblocks project files
- main.cpp: example script of how to use it
- gui_console.h: the class definition
- gui_console_cursor.h: functions related to cursor coordination
- gui_console_gui.h: main console drawing functions
- gui_console_input.h: keyboard input handling

Needed library: sdlmain, SDL.dll, SDL_ttf.dll

Executable is for Windows XP 32bit

Screenshot:
Daevius - [C++/SDL] Console class (GUI) - RaGEZONE Forums
 
Custom Title Activated
Loyal Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20
Nicely done! I've stopped developping in C++ a while ago, will remember this in case I ever start it up again :icon6:
 
Junior Spellweaver
Joined
Nov 30, 2007
Messages
187
Reaction score
0
Nice !!!!!!!!!!!! For Copy Paste cuz them don't work :)
 
Back
Top